- LYXERR(Debug::LATEX, "TeXDeeper... " << &*par);
- bool const force_plain_layout = text.inset().forcePlainLayout();
- depth_type const max_depth = par->params().depth();
-
- // FIXME: move that to a for loop!
- while (par != paragraphs.end()
- && par->params().depth() == max_depth) {
- // FIXME This test should not be necessary.
- // We should perhaps issue an error if it is.
- Layout const & style = force_plain_layout
- ? buf.params().documentClass().plainLayout() : par->layout();
- if (style.isEnvironment()) {
- TeXEnvironementData const inner_data = prepareEnvironement(buf,
- text, par, os, texrow, runparams);
- // Recursive call to TeXEnvironment!
- par = TeXEnvironment(buf, text, par, os, texrow, runparams,
- inner_data);
- finishEnvironement(os, texrow, runparams, inner_data);
- } else {
- TeXOnePar(buf, text, par, os, texrow, runparams);
- if (par != text.paragraphs().end())
- par++;
- }
- }
- LYXERR(Debug::LATEX, "TeXDeeper...done ");
+ // FIXME This test should not be necessary.
+ // We should perhaps issue an error if it is.
+ bool const force_plain_layout = text.inset().forcePlainLayout();
+ Layout const & style = force_plain_layout
+ ? buf.params().documentClass().plainLayout()
+ : par->layout();
+
+ if (!style.isEnvironment()) {
+ // This is a standard paragraph, no need to call TeXEnvironment.
+ TeXOnePar(buf, text, pit, os, runparams);
+ continue;