From: Juergen Spitzmueller Date: Fri, 28 Sep 2018 06:36:44 +0000 (+0200) Subject: Use LTR environment for forceLTR content with polyglossia X-Git-Tag: lyx-2.4.0dev-acb2ca7b~3024 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=10c06f67c936d8a259b03f00084fd4969f17582b;p=features.git Use LTR environment for forceLTR content with polyglossia Fixes: #10548 --- diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 6410d57085..fa3418229b 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -1143,13 +1143,17 @@ void Paragraph::Private::latexInset(BufferParams const & bparams, odocstream::pos_type const len = os.os().tellp(); if (inset->forceLTR() - && !runparams.use_polyglossia && running_font.isRightToLeft() // ERT is an exception, it should be output with no // decorations at all && inset->lyxCode() != ERT_CODE) { - if (running_font.language()->lang() == "farsi") - os << "\\beginL" << termcmd; + if (runparams.use_polyglossia) { + if (style.isCommand()) + os << "\\LR{"; + os << "\\begin{LTR}"; + } else if (running_font.language()->lang() == "farsi" + || running_font.language()->lang() == "arabic_arabi") + os << "\\textLR{" << termcmd; else os << "\\L{"; close = true; @@ -1206,10 +1210,10 @@ void Paragraph::Private::latexInset(BufferParams const & bparams, } if (close) { - if (running_font.language()->lang() == "farsi") - os << "\\endL" << termcmd; - else - os << '}'; + if (runparams.use_polyglossia && !style.isCommand()) + os << "\\end{LTR}"; + else + os << '}'; } if (os.texrow().rows() > previous_row_count) {