0

The following code will result in command pdflatex -interaction=nonstopmode file.tex hanging when encounter the error. Could someone give me some reason?

It only happens when the backslash \ goes before \midrule. If I remove \midrule, it works well.

% !TEX encoding = UTF-8 Unicode
\documentclass{article}
\usepackage{booktabs}

\begin{document}
% \begin{table}\small
  % \caption{Test the backslash after newline}
    \begin{tabular}{cc}
      \toprule
        6050 &   2.06e-05\\
        \ \midrule                            % backslash was before \midrule.
        1038 &   3.37e-06\\
      \bottomrule
    \end{tabular}
% \end{table}

\end{document}
1
  • well errors can be so severe that they loop. One reason why I never use nonstopmode. I get a normal error and can stop the compilation. Jan 20, 2021 at 10:47

1 Answer 1

1

You can hit contrl-c (in most systems) to interrupt it and you see

! Interruption.
<to be read again> 
                   \vskip 
l.13     \end
             {tabular}
? 

You can stop with x at that prompt, but it also shows that this is essentially a repeat of a case that came up the other day

A simpler example is

\documentclass{article}

\scrollmode
\begin{document}

{\let\par\relax

x\vskip 2pt

}

\end{document}

\scrollmode tells TeX not to stop but just do its default error recovery and carry on.

If it sees \vskip in horizontal mode, that recovery is to add \par to (hopefully) get into vertical mode and then see the skip again.

But if \par has been defined to do nothing then adding \par does nothing, and so the \vskip is again seen in horizontal mode, and \par is inserted again for error recovery and it again does nothing....

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .