[latex3-commits] [git/LaTeX3-latex3-latex2e] gh218: Update ltxdoc.dtx, github-0218.lvt, and github-0218.tlg to support filenames with space in \DocInput (d25bf32f)

Johannes Braams texniek at braams.xs4all.nl
Sun May 17 10:44:28 CEST 2020


Repository : https://github.com/latex3/latex2e
On branch  : gh218
Link       : https://github.com/latex3/latex2e/commit/d25bf32f188f8e2fd6c657ae570fa69f8574ac81

>---------------------------------------------------------------

commit d25bf32f188f8e2fd6c657ae570fa69f8574ac81
Author: Johannes Braams <texniek at braams.xs4all.nl>
Date:   Sun May 17 10:44:28 2020 +0200

    Update ltxdoc.dtx, github-0218.lvt, and github-0218.tlg to support filenames with space in \DocInput


>---------------------------------------------------------------

d25bf32f188f8e2fd6c657ae570fa69f8574ac81
 base/ltxdoc.dtx                       | 13 +++++++++----
 base/testfiles/github-0218.luatex.tlg |  9 +++++++++
 base/testfiles/github-0218.lvt        | 20 ++++++++++++++++++++
 base/testfiles/github-0218.tlg        |  9 +++++++++
 4 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/base/ltxdoc.dtx b/base/ltxdoc.dtx
index f250b2cb..3b82ccd7 100644
--- a/base/ltxdoc.dtx
+++ b/base/ltxdoc.dtx
@@ -30,7 +30,7 @@
 %
 %<class>\NeedsTeXFormat{LaTeX2e}
 %<class>\ProvidesClass{ltxdoc}
-%<class>         [2019/09/16 v2.0y Standard LaTeX documentation class]
+%<class>         [2020/05/17 v2.0z Standard LaTeX documentation class]
 %
 %<*driver>
 \documentclass{ltxdoc}
@@ -422,6 +422,8 @@
 \def\partname{File}
 %    \end{macrocode}
 %
+% \changes{v2.0z}{2020/05/17}{Support spaces \emph{within} filenames
+%    (gh/218)}
 %    \begin{macrocode}
 \newcommand*{\DocInclude}[1]{%
   \relax
@@ -432,13 +434,16 @@
     {\def\currentfile{#1.dtx}}%
   \ifnum\@auxout=\@partaux
     \@latexerr{\string\include\space cannot be nested}\@eha
-  \else \@docinclude#1 \fi}
+  \else
+    \set at curr@file at trim@spaces{#1}%
+    \expandafter\@docinclude\expandafter{\@curr at file}
+ \fi}
 \def\@docinclude#1 {\clearpage
-\if at filesw \immediate\write\@mainaux{\string\@input{#1.aux}}\fi
+\if at filesw \immediate\write\@mainaux{\string\@input{"#1.aux"}}\fi
 \@tempswatrue\if at partsw \@tempswafalse\edef\@tempb{#1}\@for
 \@tempa:=\@partlist\do{\ifx\@tempa\@tempb\@tempswatrue\fi}\fi
 \if at tempswa \let\@auxout\@partaux \if at filesw
-\immediate\openout\@partaux #1.aux
+\immediate\openout\@partaux "#1.aux"
 \immediate\write\@partaux{\relax}\fi
 %    \end{macrocode}
 % We need to save (and later restore) various index-related
diff --git a/base/testfiles/github-0218.luatex.tlg b/base/testfiles/github-0218.luatex.tlg
new file mode 100644
index 00000000..7a98b4b8
--- /dev/null
+++ b/base/testfiles/github-0218.luatex.tlg
@@ -0,0 +1,9 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+Author: Bruno Le Floch
+Format: LaTeX2e<2020-10-01>
+Main Class: ltxdoc
+("./file name.dtx"
+file name.dtx
+) [1
+] (github-0218.aux ("./file name.aux"))
diff --git a/base/testfiles/github-0218.lvt b/base/testfiles/github-0218.lvt
new file mode 100644
index 00000000..2ab842f4
--- /dev/null
+++ b/base/testfiles/github-0218.lvt
@@ -0,0 +1,20 @@
+%
+% Testfile to show that \DocInput worjks fith filenames with spaces
+%
+\documentclass{ltxdoc}
+\begin{filecontents}{file name.dtx}
+\typeout{file name.dtx}
+\end{filecontents}
+\input{test2e}
+
+\START
+\AUTHOR{Bruno Le Floch}
+\FORMAT{LaTeX2e<2020-10-01>}
+\CLASS{ltxdoc}
+
+\OMIT
+\begin{document}
+\TIMO
+
+\DocInclude{file name}
+\end{document}
diff --git a/base/testfiles/github-0218.tlg b/base/testfiles/github-0218.tlg
new file mode 100644
index 00000000..15b24c3a
--- /dev/null
+++ b/base/testfiles/github-0218.tlg
@@ -0,0 +1,9 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+Author: Bruno Le Floch
+Format: LaTeX2e<2020-10-01>
+Main Class: ltxdoc
+(file name.dtx
+file name.dtx
+) [1
+] (github-0218.aux (file name.aux))





More information about the latex3-commits mailing list.