[latex3-commits] [git/LaTeX3-latex3-latex2e] gh486: try again with a text closer to the truth (2cac45ea)

Frank Mittelbach frank.mittelbach at latex-project.org
Wed Feb 17 01:36:32 CET 2021


Repository : https://github.com/latex3/latex2e
On branch  : gh486
Link       : https://github.com/latex3/latex2e/commit/2cac45ea41a12c2aa6c9f0b769fd7ce13e90f405

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

commit 2cac45ea41a12c2aa6c9f0b769fd7ce13e90f405
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Wed Feb 17 01:36:32 2021 +0100

    try again with a text closer to the truth


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

2cac45ea41a12c2aa6c9f0b769fd7ce13e90f405
 base/doc/ltnews33.tex | 43 +++++++++++++++++++++++++------------------
 1 file changed, 25 insertions(+), 18 deletions(-)

diff --git a/base/doc/ltnews33.tex b/base/doc/ltnews33.tex
index 07483259..b6e0bd66 100644
--- a/base/doc/ltnews33.tex
+++ b/base/doc/ltnews33.tex
@@ -157,24 +157,31 @@ it. In the past this was only possible by applying a special syntax
 (in cases of spaces), not at all for most \acro{utf8} characters and
 not in all circumstances for files with several dots.
 
-There is, however, one restriction to this: the syntax for
-\cs{include} and \cs{includeonly} expects not a file name but a file
-without its extension, which has to be \texttt{.tex}. That is, you are
-supposed to specify \verb=\include{mychap}= to include the file
-\file{mychap.tex} because \cs{include} internally also used its
-argument to write to \file{mychap.aux} and has to construct this name.
-However, because \TeX{} treats files in special manner when when they
-have the extension \texttt{.tex} it turned out one could add this
-extension in the argument to \cs{include} and the code would somehow
-loose it and still access the right \texttt{.aux} file.
-
-This is no longer the case and with the new implementation the
-official syntax is now enforced, i.e., the argument to \cs{include} is
-always interpreted as the file without its extension. Thus specifying
-\file{mychap.tex} now results in \LaTeX{} trying to include
-\file{mychap.tex.tex} and using \file{mychap.tex.aux}, because the
-argument is \emph{correctly} interpreted as the file name without its
-extension.
+However, \TeX{} has a built-in rule saying that you can leave out the
+extension if it is \texttt{.tex}. Because of that \verb=\input{file}=
+or \verb=\input{file.tex}= both load \file{file.tex} if it
+exists. While this is convenient most of the time it is a little
+awkward in some scenarios (for example, when both \file{file} and
+\file{file.tex} exist) and also when you manually try to implement
+that rule.
+
+\LaTeX{} therefore had one special syntax for \cs{include} and
+\cs{includeonly}: they always expected that their arguments contains a
+file name\footnote{In case of \cs{includeonly} a comma separated list
+  of such names.} without its extension, which had to be
+\texttt{.tex}.  Thus when you mistakenly wrote
+\verb=\include{mychap.tex}= (for example, when you changed from \cs{input}
+to \cs{include} somewhere), \LaTeX{} went ahead and looked for the
+file \file{mychap.tex.tex} for inclusion and tried to write support
+information to the file \file{mychap.tex.aux}.  The reason was that
+\cs{include} had to construct both physical file names from the
+argument and it didn't bother to do something special about the
+extension \texttt{.tex}.
+
+As a side effect of the new implementation this has now changed and
+the argument of \cs{include} now gets the extension \texttt{.tex}
+removed if it was used. Thus \verb=\include{mychap.tex}= now loads
+\file{mychap.tex} and no longer looks for \file{mychap.tex.tex}.
 %
 \githubissue{486}
 





More information about the latex3-commits mailing list.