diff --git a/base/changes.txt b/base/changes.txt index 81c14d889..7b98e2005 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 + + * ltmiscen.dtx (subsection{Environments}): + Allow unbalanced conditionals in toc entries (gh/202) + +2019-10-25 Frank Mittelbach + + * classes.dtx (subsection{Fonts}): + Don't use \MakeRobust if in rollback prior to 2015 (gh/201) + 2019-10-22 David Carlisle * ltluatex.dtx: page_objnum_provider and process_pdf_image_content classified data diff --git a/base/classes.dtx b/base/classes.dtx index 9fed94dfd..1de8095a6 100644 --- a/base/classes.dtx +++ b/base/classes.dtx @@ -53,7 +53,7 @@ %<*driver> \ProvidesFile{classes.drv} % - [2019/08/27 v1.4j + [2019/10/25 v1.4k % 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 8cd612075..2a88438de 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@percent@to@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@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} @@ -432,6 +442,8 @@ % {\protected@file@percent}{Mask line endings}% %\let\protected@file@percent\@undefined %\let\add@percent@to@temptokena\@undefined +%\let\do@add@percent@to@temptokena\@undefined +%\let\dont@add@percent@to@temptokena\@undefined %\long\def\@writefile#1#2{% % \@ifundefined{tf@#1}\relax % {\@temptokena{#2}% diff --git a/base/testfiles/github-0201.lvt b/base/testfiles/github-0201.lvt new file mode 100644 index 000000000..7011c30a8 --- /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-0201.tlg b/base/testfiles/github-0201.tlg new file mode 100644 index 000000000..1d0c69753 --- /dev/null +++ b/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. diff --git a/base/testfiles/github-0202.lvt b/base/testfiles/github-0202.lvt new file mode 100644 index 000000000..6a66095ea --- /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/github-0202.tlg b/base/testfiles/github-0202.tlg new file mode 100644 index 000000000..39d216cfd --- /dev/null +++ b/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)