I think my .tex document got corrupted on disk (or something). I cannot figure out what has changed. I get one of two possibilities each time I try to compile it. First time it tells me that I have a "Missing number, treated as a zero" as the first of 31 errors, and marks a line which says "\newpage". The second time I try to compile it, it hangs.
I cannot make an MWE (sorry), so I am attaching my whole file and two log files. And I am completely lost as to how to fix this (and a little desperate). Please can someone figure out what's wrong?
The problem might be with the included graphics. But these have all been used in latex documents before, so I doubt it.
TY
General ⇒ Compile hangs
-
- Posts: 156
- Joined: Sat Jan 22, 2011 9:55 pm
Compile hangs
- Attachments
-
- includeTheseGraphics.zip
- (51.91 KiB) Downloaded 294 times
-
- Final Exam.log
- (24.63 KiB) Downloaded 276 times
-
- Final Exam - hangs while compiling.log
- (24.63 KiB) Downloaded 275 times
-
- Final Exam - Copy.tex
- (19.95 KiB) Downloaded 283 times
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Compile hangs
You can always do a minimal example, that is the normal way that hellpers find error 
Boiling down your example leads me to
Multicols in a single line? This will break the whole thing.
By the way, out there are great editors that can help you with your files. The habit of trying to save typing time by hinding question behind a single letter q is bad. Really really bad. To think you can save time, but you don't. And it makes working with colleagues more complicated (i had to look at the definitions first).
That is not the worst tough, but never think of doing that for math stuff. Never ever do it.

Boiling down your example leads me to
Code: Select all
\q Determine which plot shows the strongest linear correlation.
\begin{oneparchoices}
\begin{multicols}{2}
\ch \includegraphics{T2_Q1_C.png}
\ch \includegraphics{T2_Q1_B.png}
\cc \includegraphics{T2_Q1_D.png}
\ch \includegraphics{T2_Q1_A.png}
\end{multicols}
\end{oneparchoices}
\al{C}
By the way, out there are great editors that can help you with your files. The habit of trying to save typing time by hinding question behind a single letter q is bad. Really really bad. To think you can save time, but you don't. And it makes working with colleagues more complicated (i had to look at the definitions first).
That is not the worst tough, but never think of doing that for math stuff. Never ever do it.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
-
- Posts: 156
- Joined: Sat Jan 22, 2011 9:55 pm
Re: Compile hangs
Thanks, Johannes.
Can you clarify why that's such a bad habit?
Can you clarify why that's such a bad habit?
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Compile hangs
There might be a time, when you regret having done this.
Suppose you want to change macro
Another issue arises if you are working with others (colleagues/editors). Suppose you have worked with minipages for some time, and later just called mp to get a minipage. You know what it means, but somebody working with your file has to familiarize himself. mp could stand for marginpar as well.
It is hard to explain, maybe another approach, think of your code as plain text (which it is), but more of the readable kind. When writing code, do you think »now, new q, and some ch. But do not forget the cc«
I myself am the verbose kind, and communication is easier this way: Now, new question and some choices. But do not forget the correct choice.
Or another way, when writing a document (maybe not an exam paper), most time is not spent on the few macros. As a fast typer, typing
The above are some general advice. You don't have to follow them. But doing support every day, i have seen much worse things. Trust me
Using the right editor, you can use shorthands. You can define
There are two among the great editor, namely vi and emacs.
I prefer vi, but that is a decision of personal taste and comfort.
Suppose you want to change macro
\a
to \c
. You cannot simply redefine \a
for some reasons, and you cannot search&replace all letters a (obviously). Replacing all instances of \a might work, but there is still the chance, that you replace something that should not have been replaced. Another issue arises if you are working with others (colleagues/editors). Suppose you have worked with minipages for some time, and later just called mp to get a minipage. You know what it means, but somebody working with your file has to familiarize himself. mp could stand for marginpar as well.
It is hard to explain, maybe another approach, think of your code as plain text (which it is), but more of the readable kind. When writing code, do you think »now, new q, and some ch. But do not forget the cc«
I myself am the verbose kind, and communication is easier this way: Now, new question and some choices. But do not forget the correct choice.
Or another way, when writing a document (maybe not an exam paper), most time is not spent on the few macros. As a fast typer, typing
\begin{flushleft}
takes about a second, maybe second and a half (haven't stopped actually). Where is the time saving compared to just typing \q
instead of \question
?The above are some general advice. You don't have to follow them. But doing support every day, i have seen much worse things. Trust me

Using the right editor, you can use shorthands. You can define
\q␣
to be expanded automatically to \question
saving you keystrokes but keep the code readable. Many users are learning that the hard way. There are two among the great editor, namely vi and emacs.
I prefer vi, but that is a decision of personal taste and comfort.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.