[LyX/master] Pass proper input markup option to xindy with xetex/luatex

Juergen Spitzmueller spitz at lyx.org
Mon Dec 16 10:34:37 UTC 2019


commit b87982189740610e4d2a76cc8f47b030c09ded84
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Mon Dec 16 11:48:01 2019 +0100

    Pass proper input markup option to xindy with xetex/luatex
    
    plain xindy also needs the latex input markup specified
---
 src/LaTeX.cpp |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index fb5af54..9e08ffe 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -514,14 +514,28 @@ int LaTeX::runMakeIndex(string const & f, OutputParams const & rp,
 	if (contains(tmp, "$$x")) {
 		// This adds appropriate [te]xindy options
 		// such as language and codepage (for the
-		// main document language/encoding)
+		// main document language/encoding) as well
+		// as input markup (latex or xelatex)
 		string xdyopts = rp.xindy_language;
 		if (!xdyopts.empty())
 			xdyopts = "-L " + xdyopts;
-		if (rp.encoding->iconvName() == "UTF-8") {
+		if (rp.isFullUnicode() && rp.encoding->package() == Encoding::none) {
 			if (!xdyopts.empty())
 				xdyopts += " ";
-			xdyopts += "-C utf8";
+			// xelatex includes lualatex
+			xdyopts += "-I xelatex";
+		}
+		else if (rp.encoding->iconvName() == "UTF-8") {
+			if (!xdyopts.empty())
+				xdyopts += " ";
+			// -I not really needed for texindy, but for xindy
+			xdyopts += "-C utf8 -I latex";
+		}
+		else {
+			if (!xdyopts.empty())
+				xdyopts += " ";
+			// not really needed for texindy, but for xindy
+			xdyopts += "-I latex";
 		}
 		tmp = subst(tmp, "$$x", xdyopts);
 	}


More information about the lyx-cvs mailing list