Open mbertucci47 opened 1 month ago
The problem is that the \endlist
code tries to close structures that never have been opened as there is no \item
in the bibliography. One could fake an empty structure with
\DocumentMetadata
{
lang=en-US,
pdfversion=2.0,
pdfstandard=ua-2,
testphase={phase-III,math,title,table,firstaid},
}
\documentclass{article}
\makeatletter
\renewenvironment{thebibliography}[1]
{\section*{\refname}%
\@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode`\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}%
\tagstructbegin{tag=LI}\tagstructbegin{tag=LBody}% start empty structure
}%
\endlist}
\begin{document}
\begin{thebibliography}{9} % or this
\end{thebibliography}
\end{document}
The (probably better) alternative would be to test in \__block_list_end:
if there is an open body/item to close.
Not clear to me, whether an empty list without items should be treated as a list (with, say, vertical spacing being added before and after) or whether it should be treated as an error. In some sense it seems to me "error" is the right answer, but not low-level error.
An empty
thebibliography
environment, either in the main tex file or the bbl file, produces the errorWithout tagging code loading you just get the usual warning
I'd say an error is not desirable since an author often starts writing a paper with
\bibliography
given but no\cite
commands.Example: