]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetRef.cpp
Fix text direction of references with XeTeX/bidi
[lyx.git] / src / insets / InsetRef.cpp
index e8eecedde90d8dc9bf6295e0dd1e358b223ff53e..82db322320aaae7d5d89bba6537ecfa69b65a120 100644 (file)
@@ -471,11 +471,16 @@ void InsetRef::validate(LaTeXFeatures & features) const
                features.require("nameref");
 }
 
-bool InsetRef::forceLTR() const
+bool InsetRef::forceLTR(OutputParams const & rp) const
 {
-       // We force LTR for references. Namerefs are output in the scripts direction
-       // at least with fontspec/bidi, though (see #11518).
+       // We force LTR for references. However,
+       // * Namerefs are output in the scripts direction
+       //   at least with fontspec/bidi and luabidi, though (see #11518).
+       // * Parentheses are automatically swapped with XeTeX/bidi 
+       //   [not with LuaTeX/luabidi] (see #11626).
        // FIXME: Re-Audit all other RTL cases.
+       if (rp.useBidiPackage())
+               return false;
        return (getCmdName() != "nameref" || !buffer().masterParams().useNonTeXFonts);
 }