pit_type & pit, otexstream & os)
{
ParagraphList const & paragraphs = text.paragraphs();
pit_type & pit, otexstream & os)
{
ParagraphList const & paragraphs = text.paragraphs();
LYXERR(Debug::LATEX, "TeXEnvironment for paragraph " << pit);
Layout const & current_layout = ipar->layout();
LYXERR(Debug::LATEX, "TeXEnvironment for paragraph " << pit);
Layout const & current_layout = ipar->layout();
// This is for debugging purpose at the end.
pit_type const par_begin = pit;
for (; pit < runparams.par_end; ++pit) {
// This is for debugging purpose at the end.
pit_type const par_begin = pit;
for (; pit < runparams.par_end; ++pit) {
// check first if this is an higher depth paragraph.
bool go_out = (par->params().depth() < current_depth);
// check first if this is an higher depth paragraph.
bool go_out = (par->params().depth() < current_depth);
// Do not output empty environments if the whole paragraph has
// been deleted with ct and changes are not output.
if (size_t(pit + 1) < paragraphs.size()) {
// Do not output empty environments if the whole paragraph has
// been deleted with ct and changes are not output.
if (size_t(pit + 1) < paragraphs.size()) {
Paragraph const & cpar = paragraphs.at(pit);
if ((par->layout() != nextpar->layout()
|| par->params().depth() == nextpar->params().depth()
Paragraph const & cpar = paragraphs.at(pit);
if ((par->layout() != nextpar->layout()
|| par->params().depth() == nextpar->params().depth()
Layout const current_layout = pit->layout();
// get the first paragraph in sequence with this layout and depth
Layout const current_layout = pit->layout();
// get the first paragraph in sequence with this layout and depth
DocumentClass const & tclass = bparams.documentClass();
// Did we already warn about inTitle layout mixing? (we only warn once)
bool gave_layout_warning = false;
for (; pit < runparams.par_end; ++pit) {
lastpit = pit;
DocumentClass const & tclass = bparams.documentClass();
// Did we already warn about inTitle layout mixing? (we only warn once)
bool gave_layout_warning = false;
for (; pit < runparams.par_end; ++pit) {
lastpit = pit;
if (!gave_layout_warning && !runparams.dryrun) {
gave_layout_warning = true;
frontend::Alert::warning(_("Error in latexParagraphs"),
if (!gave_layout_warning && !runparams.dryrun) {
gave_layout_warning = true;
frontend::Alert::warning(_("Error in latexParagraphs"),
// Do not output empty environments if the whole paragraph has
// been deleted with ct and changes are not output.
if (size_t(pit + 1) < paragraphs.size()) {
// Do not output empty environments if the whole paragraph has
// been deleted with ct and changes are not output.
if (size_t(pit + 1) < paragraphs.size()) {
Paragraph const & cpar = paragraphs.at(pit);
if ((par->layout() != nextpar->layout()
|| par->params().depth() == nextpar->params().depth()
Paragraph const & cpar = paragraphs.at(pit);
if ((par->layout() != nextpar->layout()
|| par->params().depth() == nextpar->params().depth()