#include "Encoding.h"
#include "Language.h"
#include "LaTeXFeatures.h"
-#include "Lexer.h"
#include "LyXRC.h"
#include "output_latex.h"
#include "OutputParams.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/gettext.h"
+#include "support/Lexer.h"
#include "support/lstrings.h"
#include <cstring>
os << "\\textLR{";
count += 8;
// currently the remaining RTL languages are arabic_arabtex and hebrew
- } else if (isRightToLeft() != prev.isRightToLeft()) {
+ } else if (isRightToLeft() != prev.isRightToLeft() && !runparams.isFullUnicode()) {
if (needs_cprotection) {
os << "\\cprotect";
count += 9;
// the numbers are written Left-to-Right. ArabTeX package
// and bidi (polyglossia with XeTeX) reorder the number automatically
// but the packages used for Hebrew and Farsi (Arabi) do not.
- if (!runparams.useBidiPackage()
+ if (!bparams.useBidiPackage(runparams)
&& !runparams.pass_thru
&& bits_.number() == FONT_ON
&& prev.fontInfo().number() != FONT_ON
|| language()->lang() == "arabic_arabi")) {
if (runparams.use_polyglossia) {
// LuaTeX/luabidi
- os << "\\LR{";
- count += 5;
- } else {
+ // \LR needs extra grouping
+ // (possibly a LuaTeX bug)
+ os << "{\\LR{";
+ count += 6;
+ } else if (!runparams.isFullUnicode()) {
+ // not needed with babel/lua|xetex
os << "{\\beginL ";
count += 9;
}
if (runparams.inulemcmd) {
// needed with nested uwave in xout
// see https://tex.stackexchange.com/a/263042
- os << "\\ULdepth=1000pt";
- count += 15;
+ os << "\\ULdepth=\\maxdimen";
+ count += 18;
}
if (needs_cprotection) {
os << "\\cprotect";
// the numbers are written Left-to-Right. ArabTeX package
// and bidi (polyglossia with XeTeX) reorder the number automatically
// but the packages used for Hebrew and Farsi (Arabi) do not.
- if (!runparams.useBidiPackage()
+ if (!bparams.useBidiPackage(runparams)
&& !runparams.pass_thru
&& bits_.number() == FONT_ON
&& next.fontInfo().number() != FONT_ON
|| language()->lang() == "arabic_arabi")) {
if (runparams.use_polyglossia) {
// LuaTeX/luabidi
- os << "}";
- count += 1;
- } else {
+ // luabidi's \LR needs extra grouping
+ // (possibly a LuaTeX bug)
+ os << "}}";
+ count += 2;
+ } else if (!runparams.isFullUnicode()) {
+ // not needed with babel/lua|xetex
os << "\\endL}";
count += 6;
}