Skip to content

Commit

Permalink
make \@title and \@author robust
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed Jan 21, 2024
1 parent c602ead commit a457a92
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
4 changes: 4 additions & 0 deletions required/latex-lab/changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-01-18 Ulrike Fischer <[email protected]>
* latex-lab-title.dtx: make \@title and \@author robust to avoid errors
if they are not set.

2024-01-18 Ulrike Fischer <[email protected]>
* latex-lab-block.dtx: add support to set an attribute-class for para-main.

Expand Down
13 changes: 9 additions & 4 deletions required/latex-lab/latex-lab-title.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
%
% for those people who are interested or want to report an issue.
%
\def\ltlabtitledate{2023-12-22}
\def\ltlabtitleversion{0.85a}
\def\ltlabtitledate{2024-01-21}
\def\ltlabtitleversion{0.85b}

%<*driver>
\documentclass{l3doc}
Expand Down Expand Up @@ -134,7 +134,7 @@
\ProvidesExplPackage {latex-lab-testphase-title} {\ltlabtitledate} {\ltlabtitleversion}
{Changes related to the tagging of the title}
% \end{macrocode}

%
% \subsection{\cs{maketitle} in article class}
%
% \begin{macrocode}
Expand Down Expand Up @@ -316,7 +316,12 @@
%
% A helper command to convert the title into a pdfstring similar to
% \cs{pdfstringdef}.
%
% As we use \cs{text_purify} we must ensure that the default definitions
% of \cs{@title} and \cs{@author} are robust:
% \begin{macrocode}
\protected\def\@title{\@latex@error{No \noexpand\title given}\@ehc}
\protected\def\@author{\@latex@warning@no@line{No \noexpand\author given}}
% \end{macrocode}
% TODO: This should be improved and moved into the pdf module so that
% it is generally available.
% \begin{macrocode}
Expand Down
11 changes: 11 additions & 0 deletions required/latex-lab/testfiles-title/title-empty.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
\ExplSyntaxOn
\debug_on:n { check-declarations , deprecation }
\sys_gset_rand_seed:n{1000}
\ExplSyntaxOff
\DocumentMetadata{testphase={phase-III,title},pdfversion=2.0}
\input{regression-test}
\documentclass{article}
\begin{document}
\START
\maketitle
\end{document}
18 changes: 18 additions & 0 deletions required/latex-lab/testfiles-title/title-empty.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
! LaTeX Error: No\title given.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l. ...\maketitle
Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <12> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <8> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <6> on input line ....
LaTeX Warning: No\author given.
[1
] (title-empty.aux)

0 comments on commit a457a92

Please sign in to comment.