PdfLateX hangs on a single-line unnumbered equation,

here is a (possibly) minimal example:

\documentclass[english,pointlessnumbers, abstracton, headsepline, open=any]{scrreprt}
% the following is useful when we have the old nomencl.sty package
 breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=false]


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.

%% Because html converters don't know tabularnewline
  {\def\RSsubtxt{section~}\newref{sub}{name = \RSsubtxt}}
  {\def\RSthmtxt{theorem~}\newref{thm}{name = \RSthmtxt}}
  {\def\RSlemtxt{lemma~}\newref{lem}{name = \RSlemtxt}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
% Special symbols as (c), �

% Custom enumeration lists

% Line spacing
% \usepackage{setspace}
% \usepackage[onehalfspacing]{setspace}

\usepackage{        %a4wide,
            ellipsis, fixltx2e, mparhack,       % correct errors with margins
            booktabs, longtable                 % better tables

\usepackage[automark]{scrpage2}     % Page number at bottom right
\ohead{\\\headmark}     % Paragraph heading
\setheadsepline{1pt}    % Header bottom line
\setfootsepline{0pt}    % Footnote top line
\setfootbotline{0pt}    % Footnote bottom line

% Better justify

\usepackage{ifpdf}  % part of the hyperref bundle
\ifpdf      % if pdflatex is used

% Set fonts for nicer pdf view
    \usepackage{courier} }

% Increase distance between the caption table and the table 
\renewcommand{\table}{ %
                 \setlength{\@tempdima}{\abovecaptionskip} %
                 \setlength{\abovecaptionskip}{\belowcaptionskip} %
                 \setlength{\belowcaptionskip}{\@tempdima} %

% Table column height



m=m_{0}+\delta_{M}M_{s},                    % INFINITE LOOP



\[  ->\x@protect \[\protect \[  

\x@protect #1->\ifx \protect \@typeset@protect \else \@x@protect #1\fi 

\[  ->\x@protect \[\protect \[  

\x@protect #1->\ifx \protect \@typeset@protect \else \@x@protect #1\fi 
{\relax} ...
  • 1
    Welcome to TeX.SX! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Commented Jun 19, 2013 at 16:01
  • 1
    "Hanging" without errors can be caused by an indefinite loop. With a working minimal example it can be analyzed (e.g. \tracingall and friends). Thus it helps, if you can generate a MWE. Remove sections, chapters, pages, packages, ..., which are not involved or are causing the hanging. Commented Jun 19, 2013 at 16:06
  • 1
    Once again, a very warm welcome to TeX.SX! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. Commented Jun 19, 2013 at 16:19
  • Well, I'll try to figure this out. A noob question: should I put \tracing all anywhere after \begin{document} or where?
    – Rubi Shnol
    Commented Jun 19, 2013 at 16:56
  • @ValerySaharov -- you say that if you have only about ten formulae it works, but if you add one more, it hangs. i'd start by putting the \tracing command just before the addition. with luck, something will happen to make the job crash instead of hang, and then you'd have the benefit of a log to check. if not, and it does hang, figure out how to interrupt the job and x out of it to preserve the log. a likely problem is a redefined command that references its own name in a definition (or a chain of definitions). good luck. Commented Jun 19, 2013 at 17:50

1 Answer 1


A minimal example would have been:



The tracing shows that \[ is broken. If LaTeX makes a command robust (\DeclareRobustCommand), it uses two definitions for the macro, the original macro and a macro, whose name is appended by a space that contains the real definition of the macro, e.g.:

\typeout{[\string\.\space->\expandafter\meaning\csname . \endcsname]}

prints the following on the console/.log file:

[\.->macro:->\x@protect \.\protect \.  ]
[\. ->\long macro:->bar]

That gives a little background for analyzing the minimal example:

  \typeout{[#1: \string\[->\meaning\[]}%
  \typeout{[#1: \string\[ ->\expandafter\meaning\csname [ \endcsname]}%


Discussion of the output of \debug:

Initially \[ is not robust:

[initial: \[->macro:->\relax \ifmmode \@badmath \else \ifvmode \nointerlineskip \makebox [.6\linewidth ]{}\fi $$\fi ]

Package amsmath changes the implementation of \[ to use environment equation*. It also defines it using \DeclareRobustCommand:

[amsmath: \[->macro:->\x@protect \[\protect \[  ]
[amsmath: \[ ->\long macro:->\begin {equation*}]

Package ulem does not touch \[, but it defines \MakeRobust:

  \csname \expandafter\@gobble\string#1 \endcsname= #1%
 \edef#1{\noexpand\protect \expandafter\noexpand
  \csname\expandafter\@gobble\string#1 \endcsname}

It adds the protection layer of \DeclareRobustCommand to add robustness to a fragile macro.

Package fixltx2e also defines \MakeRobust:

    \@latex@error{The control sequence `\string#1' is undefined!%
      \MessageBreak There is nothing here to make robust}%
    {\@latex@info{The control sequence `\string#1' is already robust}}%

And makes \[ robust:


Package fixltx2e uses \providecommand, but \MakeRobust is already defined. But the simpler version of package ulem has a serious shortcoming, it does not check, if the command is already made robust. Then following happens. The top macro calls the macro with space and the macro with space contains the original definition. Doing it twice creates a loop, if the macro is called.

[fixltx2e: \[->macro:->\protect \[  ]
[fixltx2e: \[ ->macro:->\x@protect \[\protect \[  ]

The \[␣ calls itself instead of the original macro.


\let\MakeRobust\relax % undefine this insufficient version

Then the more elaborate version of \MakeRobust of package fixltx2e is used that checks, whether the command is already robust. That avoids the redefinition with the loop.

  • It works well. The question is solved
    – Rubi Shnol
    Commented Jun 20, 2013 at 8:34

You must log in to answer this question.

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