Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spurious bibitem in {thebibliography} with custom macros #2403

Closed
dginev opened this issue Aug 19, 2024 · 0 comments · Fixed by #2409
Closed

Spurious bibitem in {thebibliography} with custom macros #2403

dginev opened this issue Aug 19, 2024 · 0 comments · Fixed by #2409

Comments

@dginev
Copy link
Collaborator

dginev commented Aug 19, 2024

This is a subtle issue that arises in .bbl files which also contain some custom bookkeeping macros - things like conditionals and assignments to registers - just before some or all concnrete \bibitem cases.

A distilled minimal example is:

\documentclass{article}
\begin{document}
\begin{thebibliography}{1}

\relax\bibitem[Author et~al.(2019)Author, Other]{Author2019}
  Some content.

\end{thebibliography}
\end{document}

which produces the bibliography:

  <bibliography xml:id="bib">
    <title>References</title>
    <biblist>
      <bibitem xml:id="bib.bib1">
        <tags>
          <tag>[1]</tag>
          <tag role="refnum">1</tag>
        </tags>
        <bibblock/>
      </bibitem>
      <bibitem key="Author2019" xml:id="bib.bibx1">
        <tags>
          <tag>[Author et al.(2019)Author, Other]</tag>
          <tag role="refnum">Author et al.(2019)Author, Other</tag>
        </tags>
        <bibblock>
Some content.
</bibblock>
      </bibitem>
    </biblist>
  </bibliography>

It should be possible to avoid creating the leading empty [1] bibitem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant