Skip to content

Commit

Permalink
fixes for #201 and #202
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed Oct 25, 2019
1 parent c5a4a4c commit a128e23
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 18 deletions.
10 changes: 10 additions & 0 deletions base/changes.txt
Expand Up @@ -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@latex-project.org>

* ltmiscen.dtx (subsection{Environments}):
Allow unbalanced conditionals in toc entries (gh/202)

2019-10-25 Frank Mittelbach <Frank.Mittelbach@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@latex-project.org>

* ltluatex.dtx: page_objnum_provider and process_pdf_image_content classified data
Expand Down
10 changes: 7 additions & 3 deletions base/classes.dtx
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
42 changes: 27 additions & 15 deletions base/ltmiscen.dtx
Expand Up @@ -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}
Expand Down Expand Up @@ -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@percent@to@temptokena
Expand All @@ -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@add@percent@to@temptokena\else
\expandafter\do@add@percent@to@temptokena\fi{#1}}
% \end{macrocode}
%
% \begin{macrocode}
\long\def\dont@add@percent@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@add@percent@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}
Expand Down Expand Up @@ -432,6 +442,8 @@
%<latexrelease> {\protected@file@percent}{Mask line endings}%
%<latexrelease>\let\protected@file@percent\@undefined
%<latexrelease>\let\add@percent@to@temptokena\@undefined
%<latexrelease>\let\do@add@percent@to@temptokena\@undefined
%<latexrelease>\let\dont@add@percent@to@temptokena\@undefined
%<latexrelease>\long\def\@writefile#1#2{%
%<latexrelease> \@ifundefined{tf@#1}\relax
%<latexrelease> {\@temptokena{#2}%
Expand Down
14 changes: 14 additions & 0 deletions 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
2 changes: 2 additions & 0 deletions base/testfiles/github-0201.tlg
@@ -0,0 +1,2 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
20 changes: 20 additions & 0 deletions 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}


6 changes: 6 additions & 0 deletions base/testfiles/github-0202.tlg
@@ -0,0 +1,6 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
(github-0202.toc)
\tf@toc=\write...
[1
] (github-0202.aux)

0 comments on commit a128e23

Please sign in to comment.