diff --git a/src/output_latex.cpp b/src/output_latex.cpp index cacd6b2046..66ac2a08c1 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -82,13 +82,12 @@ TeXDeeper(Buffer const & buf, ParagraphList const & paragraphs = text.paragraphs(); - // FIXME This test should not be necessary. - // We should perhaps issue an error if it is. - Layout const & style = par->forcePlainLayout() ? - buf.params().documentClass().plainLayout() : par->layout(); - while (par != paragraphs.end() && - par->params().depth() == pit->params().depth()) { + par->params().depth() == pit->params().depth()) { + // FIXME This test should not be necessary. + // We should perhaps issue an error if it is. + Layout const & style = par->forcePlainLayout() ? + buf.params().documentClass().plainLayout() : par->layout(); if (style.isEnvironment()) { par = TeXEnvironment(buf, text, par, os, texrow, runparams);