mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Use LTR environment for forceLTR content with polyglossia
Fixes: #10548
This commit is contained in:
parent
92ccf0a1a2
commit
10c06f67c9
@ -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,8 +1210,8 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
|
||||
}
|
||||
|
||||
if (close) {
|
||||
if (running_font.language()->lang() == "farsi")
|
||||
os << "\\endL" << termcmd;
|
||||
if (runparams.use_polyglossia && !style.isCommand())
|
||||
os << "\\end{LTR}";
|
||||
else
|
||||
os << '}';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user