]> git.lyx.org Git - features.git/commitdiff
Re-fix #11146 with recent LaTeX
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 20 Nov 2019 10:48:18 +0000 (11:48 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 27 Jan 2020 07:29:12 +0000 (08:29 +0100)
(cherry picked from commit e75fa6f3ac5735dfcd588acb5c187556bface16d)

lib/chkconfig.ltx
src/Buffer.cpp
status.23x

index 9d743d259666a84bd3933cbf0c9755bc212c8848..305045fa1802b255c9f87aa0de4bcb648397ac73 100644 (file)
     #6
   \fi}
 
+% Test for the LaTeX version
+\newcommand{\TestLaTeXVersion}[1]{
+  \message{^^J\prefix checking for LaTeX version at least as of #1...}
+  \@ifl@t@r\fmtversion{#1}{\existstrue}{\existsfalse}
+  \ifexists
+    \message{yes^^J}
+    \AddVariable{#1}{yes}
+    \AddPackage{LaTeX-#1}
+  \else
+    \message{no^^J}
+    \AddVariable{#1}{no}
+  \fi}
+
+
 % Adapted from ltxcheck.tex
 \newcommand{\TestFont}[2][\default]{
   \def\default{#2}
 \message{^^J\prefix checking for LaTeX version... \fmtversion}
 \AddVariable{fmtversion}{\fmtversion}
 
+%%% Crucial versions
+% This one introduces path encoding changes
+\TestLaTeXVersion{2019/10/01}
+
 %%% And now, the list of available languages
 % The trick is to know that \the\everyjob contains something like
 %  \typeout{LaTeX2e <2001/06/01>}
index dd0cca62434dfb74e3165ed8f8c9065d651aa3e6..912baec403b239a938c4c6e2fe9533fada78c26a 100644 (file)
@@ -1911,9 +1911,14 @@ void Buffer::writeLaTeXSource(otexstream & os,
                                        os << "\\catcode`\\%=11"
                                              "\\def\\%{%}\\catcode`\\%=14\n";
                                }
-                               bool const detokenize = !isAscii(from_utf8(docdir))
-                                               || contains(docdir, '~');
+                               bool const nonascii = !isAscii(from_utf8(docdir));
+                               // LaTeX 2019/10/01 handles non-ascii path without detokenize
+                               bool const utfpathlatex = features.isAvailable("LaTeX-2019/10/01");
+                               bool const detokenize = !utfpathlatex
+                                               && (nonascii || contains(docdir, '~'));
                                bool const quote = contains(docdir, ' ');
+                               if (utfpathlatex && nonascii)
+                                       os << "\\UseRawInputEncoding\n";
                                os << "\\makeatletter\n"
                                   << "\\def\\input@path{{";
                                if (detokenize)
index 354c5552a7010729421acb8048252c2e268a187d..5cb8a2b4e4232e04011ba2cdd828f05ca8098826 100644 (file)
@@ -41,6 +41,9 @@ What's new
 
 * DOCUMENT INPUT/OUTPUT
 
+- Fix problems with non-ASCII characters in file path with recent LaTeX
+  (bug 11146).
+
 
 * USER INTERFACE