While compiling a LateX file I keep on getting the following error message:

! LaTeX Error: Not in outer par mode.

See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ...

l.400 \end{document}


I get this error from a text containing this sentence:

In Yang the authors review the application of process mining

If I remove from the text above the word "mining" the error disappears. I am using MikTeX 2.9 and the editor TexWorks 0.6.1. This looks to me as a bug but reinstallation of MikTeX did not fix the problem.

I think I need a methodological approach to spot the source of the error. Any suggestion on what I could do?

Further details

As suggested below by egreg I have removed all \marginpar instruction but that did not fix the error. Then I removed all embedded figures and this fixed the error. It looks like the offending block of code is the following:

    \caption{Time elapsed for critical activities}

I do not know what is wrong in this block of code, but if I comment it the error disappears. What I do also not know is why this is block of code, that is at the end of the document, makes an error appear when I add the a single word at the beginning of the document.

  • 4
    Welcome to TeX.SX! That error is only issued in contexts of floats (figure or table) and \marginpar.
    – egreg
    Commented Aug 21, 2016 at 7:53
  • 1
    The methodological approach most recommended for the *TeX world is to isolate the error by constructing what is known as a minimal working example or 'MWE' (see also here).
    – jon
    Commented Aug 21, 2016 at 18:56
  • What's the reason for \afterpage? I see none. You just want \begin{figure}[p].
    – egreg
    Commented Aug 22, 2016 at 7:18
  • The use of \afterpage to force the figure to be in a separate page (it is a pretty big figure) is suggested at tex.stackexchange.com/questions/22191/… Commented Aug 22, 2016 at 9:26
  • Removing \afterpage as suggested by egreg completely fixed the problem. Thanks a lot for helping. Commented Aug 22, 2016 at 12:42

1 Answer 1


I'm not sure, for lack of information, what the cause for the error is. However, for a ”pretty big figure“ (but also for all figures) the best approach is to do

<code for the figure>

I'm not saying that the \afterpage trick has no value, but it should be attempted only in rare cases when the final figure positioning is awkward and no other method succeeds.

Never use the [h] option alone.

  • Egreg, thanks for very much for the suggestion. Unfortunately it was not enough to fix my problem. I realized that I was having also a problem due to the twocolumn format that required the use of the figure* environment of whose existence I was not aware. See [tex.stackexchange.com/questions/30985/… for details. Commented Aug 27, 2016 at 12:38

You must log in to answer this question.

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