[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/gh201-202: fixes for #201 and #202 (a128e23d)
Frank Mittelbach
frank.mittelbach at latex-project.org
Fri Oct 25 15:58:57 CEST 2019
Repository : https://github.com/latex3/latex2e
On branch : hotfix/gh201-202
Link : https://github.com/latex3/latex2e/commit/a128e23dc3966c77da49076d318f28e90adeb190
>---------------------------------------------------------------
commit a128e23dc3966c77da49076d318f28e90adeb190
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Fri Oct 25 15:58:57 2019 +0200
fixes for #201 and #202
>---------------------------------------------------------------
a128e23dc3966c77da49076d318f28e90adeb190
base/changes.txt | 10 ++++++
base/classes.dtx | 10 ++++--
base/ltmiscen.dtx | 42 ++++++++++++++--------
base/testfiles/github-0201.lvt | 14 ++++++++
.../{github-0060.luatex.tlg => github-0201.tlg} | 0
base/testfiles/github-0202.lvt | 20 +++++++++++
base/testfiles/{tlb1783b.tlg => github-0202.tlg} | 10 ++----
7 files changed, 81 insertions(+), 25 deletions(-)
diff --git a/base/changes.txt b/base/changes.txt
index 81c14d88..7b98e200 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -4,6 +4,16 @@ completeness or accuracy and it contains some references to files that
are not part of the distribution.
=======================================================================
+2019-10-25 Frank Mittelbach <Frank.Mittelbach at latex-project.org>
+
+ * ltmiscen.dtx (subsection{Environments}):
+ Allow unbalanced conditionals in toc entries (gh/202)
+
+2019-10-25 Frank Mittelbach <Frank.Mittelbach at latex-project.org>
+
+ * classes.dtx (subsection{Fonts}):
+ Don't use \MakeRobust if in rollback prior to 2015 (gh/201)
+
2019-10-22 David Carlisle <David.Carlisle at latex-project.org>
* ltluatex.dtx: page_objnum_provider and process_pdf_image_content classified data
diff --git a/base/classes.dtx b/base/classes.dtx
index 9fed94df..1de8095a 100644
--- a/base/classes.dtx
+++ b/base/classes.dtx
@@ -53,7 +53,7 @@
%<*driver>
\ProvidesFile{classes.drv}
%</driver>
- [2019/08/27 v1.4j
+ [2019/10/25 v1.4k
%<article|report|book> Standard LaTeX document class]
%<10pt|11pt|12pt> Standard LaTeX file (size option)]
% \end{macrocode}
@@ -611,9 +611,13 @@
\normalsize
% \end{macrocode}
% We use |\MakeRobust| instead of |\DeclareRobustCommand| above to avoid a log
-% entry for the redefinition.
+% entry for the redefinition. But if we are running in in a rollback situation
+% (prior to 2015) we don't touch it.
+% \changes{v1.4k}{2019/10/25}{Roll back handling (gh/201)}
% \begin{macrocode}
-\MakeRobust\normalsize
+\ifx\MakeRobust\@undefined \else
+ \MakeRobust\normalsize
+\fi
% \end{macrocode}
% \end{macro}
% \end{macro}
diff --git a/base/ltmiscen.dtx b/base/ltmiscen.dtx
index 8cd61207..2a88438d 100644
--- a/base/ltmiscen.dtx
+++ b/base/ltmiscen.dtx
@@ -32,7 +32,7 @@
%<*driver>
% \fi
\ProvidesFile{ltmiscen.dtx}
- [2019/08/29 v1.1p LaTeX Kernel (Misc. Environments)]
+ [2019/10/25 v1.1q LaTeX Kernel (Misc. Environments)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltmiscen.dtx}
@@ -370,17 +370,7 @@
% percent. The result is saved in \cs{@temptokena} for later use.
% \changes{v1.1n}{2018/09/26}{Sometimes mask the endline char when
% writing to files (github/73)}
-% \begin{macrocode}
-\begingroup
-\catcode`\%=12
-% \end{macrocode}
-% \texttt{latexrelease} will read this code in high-speed
-% mode in certain situations. During that it will only look for
-% \cs{if} tests but not actually execute the \cs{catcode} change
-% above. As a result it will drop anything after the |%| character
-% in the definition. Therefore the |\fi| needs to be on the next
-% line and we need locally another comment character to avoid
-% getting spaces into the definition---a weird problem :-)
+%
% \begin{macrocode}
\catcode`\^^A=9
\long\gdef\add at percent@to at temptokena
@@ -390,13 +380,33 @@
% the beginning, so that in case the tokenlist consists of a single brace
% group the braces aren't stripped. The |\expandafter| then expands
% this extra token away again.
+% \changes{v1.1q}{2019/10/25}{Allow unbalanced conditionals in \texttt{\#1} (gh/202)}
% \begin{macrocode}
- {\ifx!#2!\@temptokena\expandafter{#1}\else
- \@temptokena\expandafter{#1%^^A
+ {\ifx!#2!\expandafter\dont at add@percent at to@temptokena\else
+ \expandafter\do at add@percent at to@temptokena\fi{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\long\def\dont at add@percent at to@temptokena#1{%
+ \@temptokena\expandafter{#1}}
+% \end{macrocode}
+% \texttt{latexrelease} will read this code in high-speed
+% mode in certain situations. During that it will only look for
+% \cs{if} tests but not actually execute the \cs{catcode} change
+% above. As a result it will drop anything after the |%| character
+% in the definition. Therefore the |\fi| needs to be on the next
+% line and we need locally another comment character to avoid
+% getting spaces into the definition---a weird problem :-)
+%
+% \begin{macrocode}
+\begingroup
+\catcode`\%=12
+\long\gdef\do at add@percent at to@temptokena#1{%
+ \@temptokena\expandafter{#1%^^A
% \end{macrocode}
% Can't be on the same line as the |%| --- see above.
% \begin{macrocode}
- }\fi}
+ }}
\endgroup
% \end{macrocode}
% \end{macro}
@@ -432,6 +442,8 @@
%<latexrelease> {\protected at file@percent}{Mask line endings}%
%<latexrelease>\let\protected at file@percent\@undefined
%<latexrelease>\let\add at percent@to at temptokena\@undefined
+%<latexrelease>\let\do at add@percent at to@temptokena\@undefined
+%<latexrelease>\let\dont at add@percent at to@temptokena\@undefined
%<latexrelease>\long\def\@writefile#1#2{%
%<latexrelease> \@ifundefined{tf@#1}\relax
%<latexrelease> {\@temptokena{#2}%
diff --git a/base/testfiles/github-0201.lvt b/base/testfiles/github-0201.lvt
new file mode 100644
index 00000000..7011c30a
--- /dev/null
+++ b/base/testfiles/github-0201.lvt
@@ -0,0 +1,14 @@
+
+\RequirePackage[2014/12/31]{latexrelease} % can we go that far back?
+
+\documentclass{article}
+
+\input{test2e}
+
+\begin{document}
+
+\START
+
+Arrg
+
+\END
diff --git a/base/testfiles/github-0060.luatex.tlg b/base/testfiles/github-0201.tlg
similarity index 100%
copy from base/testfiles/github-0060.luatex.tlg
copy to base/testfiles/github-0201.tlg
diff --git a/base/testfiles/github-0202.lvt b/base/testfiles/github-0202.lvt
new file mode 100644
index 00000000..6a66095e
--- /dev/null
+++ b/base/testfiles/github-0202.lvt
@@ -0,0 +1,20 @@
+
+%% \RequirePackage[2018/31/01]{latexrelease} % that's when it worked
+
+\documentclass{article}
+
+\input{test2e}
+
+\begin{document}
+
+\START
+
+\addtocontents{toc}{\protect\iffalse}
+\addtocontents{toc}{something}
+\addtocontents{toc}{\protect\fi}
+\tableofcontents
+\section{test}
+
+\end{document}
+
+
diff --git a/base/testfiles/tlb1783b.tlg b/base/testfiles/github-0202.tlg
similarity index 69%
copy from base/testfiles/tlb1783b.tlg
copy to base/testfiles/github-0202.tlg
index f651b428..39d216cf 100644
--- a/base/testfiles/tlb1783b.tlg
+++ b/base/testfiles/github-0202.tlg
@@ -1,10 +1,6 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
-[1
-] (tlb1783b.toc)
+(github-0202.toc)
\tf at toc=\write...
-[2
-]
-Chapter 1.
-[3
-] (tlb1783b.aux)
+[1
+] (github-0202.aux)
More information about the latex3-commits
mailing list