X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FParagraph.cpp;h=ea2c8366a06755a8e818d9654c6d8cfa64d7d673;hb=90f7007a2e6c78ffd031e4636ff909ab1bc2ddec;hp=223d2eb53eb2942e2ab2cd29461bd551527ce9f6;hpb=6b2232a29c682d8e62d1d2b963bb1a70bee4330b;p=lyx.git diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 223d2eb53e..ea2c8366a0 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -1461,18 +1461,25 @@ void Paragraph::Private::validate(LaTeXFeatures & features) const // we have to provide all the optional arguments here, even though // the last one is the only one we care about. // Separate handling of optional argument inset. - if (layout_->optargs != 0 || layout_->reqargs != 0) - latexArgInsets(*owner_, os, features.runparams(), - layout_->reqargs, layout_->optargs); - else - os << from_ascii(layout_->latexparam()); + if (!layout_->latexargs().empty()) { + OutputParams rp = features.runparams(); + rp.local_font = &owner_->getFirstFontSettings(bp); + latexArgInsets(*owner_, os, rp, layout_->latexargs()); + } + os << from_ascii(layout_->latexparam()); } docstring::size_type const length = ods.str().length(); // this will output "{" at the beginning, but not at the end owner_->latex(bp, f, os, features.runparams(), 0, -1, true); if (ods.str().length() > length) { - if (is_command) + if (is_command) { ods << '}'; + if (!layout_->postcommandargs().empty()) { + OutputParams rp = features.runparams(); + rp.local_font = &owner_->getFirstFontSettings(bp); + latexArgInsets(*owner_, os, rp, layout_->postcommandargs(), "post:"); + } + } string const snippet = to_utf8(ods.str()); features.addPreambleSnippet(snippet); } @@ -2169,7 +2176,7 @@ bool Paragraph::usePlainLayout() const bool Paragraph::isPassThru() const { - return inInset().getLayout().isPassThru() || d->layout_->pass_thru; + return inInset().isPassThru() || d->layout_->pass_thru; } namespace { @@ -2428,6 +2435,10 @@ void Paragraph::latex(BufferParams const & bparams, os << '{'; ++column; } + if (!style.leftdelim().empty()) { + os << style.leftdelim(); + column += style.leftdelim().size(); + } if (allowcust) column += d->startTeXParParams(bparams, os, runparams); } @@ -2458,6 +2469,11 @@ void Paragraph::latex(BufferParams const & bparams, ++column; } + if (!style.leftdelim().empty()) { + os << style.leftdelim(); + column += style.leftdelim().size(); + } + if (allowcust) column += d->startTeXParParams(bparams, os, runparams); @@ -2648,6 +2664,11 @@ void Paragraph::latex(BufferParams const & bparams, os << "}]~"; } + if (!style.rightdelim().empty()) { + os << style.rightdelim(); + column += style.rightdelim().size(); + } + if (allowcust && d->endTeXParParams(bparams, os, runparams) && runparams.encoding != prev_encoding) { runparams.encoding = prev_encoding; @@ -2875,7 +2896,7 @@ docstring Paragraph::simpleLyXHTMLOnePar(Buffer const & buf, } else { char_type c = getUChar(buf.params(), i); - if (style.pass_thru) + if (style.pass_thru || runparams.pass_thru) xs << c; else if (c == '-') { docstring str;