mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
Proper number ordering with luabidi
As opposed to bidi (XeTeX), luabidi (LuaTeX) does no automatic reordering,
so we need to use \\LR{}
(cherry picked from commit 1d0929b5d9
)
This commit is contained in:
parent
f0f4b98c6e
commit
5679dc5c6f
28
src/Font.cpp
28
src/Font.cpp
@ -398,17 +398,23 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
|
|||||||
*/
|
*/
|
||||||
// If the current language is Hebrew, Arabic, or Farsi
|
// If the current language is Hebrew, Arabic, or Farsi
|
||||||
// the numbers are written Left-to-Right. ArabTeX package
|
// the numbers are written Left-to-Right. ArabTeX package
|
||||||
// and bidi (polyglossia) reorder the number automatically
|
// and bidi (polyglossia with XeTeX) reorder the number automatically
|
||||||
// but the packages used for Hebrew and Farsi (Arabi) do not.
|
// but the packages used for Hebrew and Farsi (Arabi) do not.
|
||||||
if (!runparams.use_polyglossia
|
if (!(runparams.use_polyglossia && runparams.flavor == OutputParams::XETEX)
|
||||||
&& !runparams.pass_thru
|
&& !runparams.pass_thru
|
||||||
&& bits_.number() == FONT_ON
|
&& bits_.number() == FONT_ON
|
||||||
&& prev.fontInfo().number() != FONT_ON
|
&& prev.fontInfo().number() != FONT_ON
|
||||||
&& (language()->lang() == "hebrew"
|
&& (language()->lang() == "hebrew"
|
||||||
|| language()->lang() == "farsi"
|
|| language()->lang() == "farsi"
|
||||||
|| language()->lang() == "arabic_arabi")) {
|
|| language()->lang() == "arabic_arabi")) {
|
||||||
os << "{\\beginL ";
|
if (runparams.use_polyglossia) {
|
||||||
count += 9;
|
// LuaTeX/luabidi
|
||||||
|
os << "\\LR{";
|
||||||
|
count += 5;
|
||||||
|
} else {
|
||||||
|
os << "{\\beginL ";
|
||||||
|
count += 9;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (f.emph() == FONT_ON) {
|
if (f.emph() == FONT_ON) {
|
||||||
os << "\\emph{";
|
os << "\\emph{";
|
||||||
@ -559,17 +565,23 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
|
|||||||
|
|
||||||
// If the current language is Hebrew, Arabic, or Farsi
|
// If the current language is Hebrew, Arabic, or Farsi
|
||||||
// the numbers are written Left-to-Right. ArabTeX package
|
// the numbers are written Left-to-Right. ArabTeX package
|
||||||
// and bidi (polyglossia) reorder the number automatically
|
// and bidi (polyglossia with XeTeX) reorder the number automatically
|
||||||
// but the packages used for Hebrew and Farsi (Arabi) do not.
|
// but the packages used for Hebrew and Farsi (Arabi) do not.
|
||||||
if (!runparams.use_polyglossia
|
if (!(runparams.use_polyglossia && runparams.flavor == OutputParams::XETEX)
|
||||||
&& !runparams.pass_thru
|
&& !runparams.pass_thru
|
||||||
&& bits_.number() == FONT_ON
|
&& bits_.number() == FONT_ON
|
||||||
&& next.fontInfo().number() != FONT_ON
|
&& next.fontInfo().number() != FONT_ON
|
||||||
&& (language()->lang() == "hebrew"
|
&& (language()->lang() == "hebrew"
|
||||||
|| language()->lang() == "farsi"
|
|| language()->lang() == "farsi"
|
||||||
|| language()->lang() == "arabic_arabi")) {
|
|| language()->lang() == "arabic_arabi")) {
|
||||||
os << "\\endL}";
|
if (runparams.use_polyglossia) {
|
||||||
count += 6;
|
// LuaTeX/luabidi
|
||||||
|
os << "}";
|
||||||
|
count += 1;
|
||||||
|
} else {
|
||||||
|
os << "\\endL}";
|
||||||
|
count += 6;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (open_encoding_) {
|
if (open_encoding_) {
|
||||||
|
@ -76,6 +76,8 @@ What's new
|
|||||||
|
|
||||||
- Fix direction of brackets with RTL documents and LuaTeX (part of bug 11187).
|
- Fix direction of brackets with RTL documents and LuaTeX (part of bug 11187).
|
||||||
|
|
||||||
|
- Fix direction of roman numbers with RTL documents and LuaTeX.
|
||||||
|
|
||||||
|
|
||||||
* USER INTERFACE
|
* USER INTERFACE
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user