1

I am looking for a way to use multibib and external bibliography(ies) in my document but use number labels for my references and letter labels for my enclosures. For example, I want to write: Reference (1) and Enclosure (a). I have more than 26 enclosures, so they'd have to wrap around and start over again with enclosure (aa), (bb) etc.

I have found this example on Stack Exchange that talks about how to change references to letters. This is what I'd like to do, but not exactly how I want to execute it.

Here's an example code:

  \documentclass{article}
  \usepackage[utf8]{inputenc}
  \usepackage[resetlabels]{multibib}
  \newcites{enc}{Enclosures}
  \newcites{ref}{References}

\begin{document}

Here I'd like to cite reference \citeref{number1} and \citeref{number2}, and enclosures \citeenc{letter1} and \citeenc{letter2}.

\bibliographystyleenc{plain} \bibliographyenc{enclosures}

\bibliographystyleref{ieeetr} \bibliographyref{references}

\end{document}

My references bibliography looks like this:

  @Article{number1,
author  =   {number author 1},
title       =   {number title 1},
year        =   {2023},
month   =   {January}
  }

@Article{number2, author = {number author 2}, title = {number title 2}, year = {2023}, month = {January} }

And my enclosures bibliography (the one I want to have alphabetic letters as my callouts) looks like this:

  \makeatletter
  \def\@bibitem#1{\item\if@filesw \immediate\write\@auxout
    {\string\bibcite{#1}{\alphalph{\value{\@listctr}}}}\fi\ignorespaces}
  \def\@biblabel#1{[\alphalph{#1}]}
  \makeatother

@Article{letter1, author = {letter author 1}, title = {Letter title 1}, year = {2023}, month = {January} }

@Article{letter2, author = {letter author 2}, title = {Letter title 2}, year = {2023}, month = {January} }

Based on the answer given in this example. Basically, I want to do exactly what's in this example, but presented in the way I have shown here. Andrew Swann indicates in his reply in this example that it can be done with the multibib environment and external bibliography, but I can't figure out how to do it. I'm still in the learning curve with LaTeX, any help is appreciated.

1 Answers1

0

I managed to figure out how to do this with an external bibliography. For future self, here's what I did:

When using multibib, performing PDFLaTeX on the main document will create 2 .aux files for the two bibliographys, enclosures.aux and references.aux. These both need to be manually compiled with BibTeX. After compiling, .bbl files are created. Within the enclosures.bbl file, paste the command

  \makeatletter
  \def\@bibitem#1{\item\if@filesw \immediate\write\@auxout
   {\string\bibcite{#1}{\alphalph{\value{\@listctr}}}}\fi\ignorespaces}
  \def\@biblabel#1{[\alphalph{#1}]}
  \makeatother

just below the \begin{thebibliography}. Compile the .bbl file and then rerun the main file.

This Overleaf Page helped me understand what's happening with the \begin(thebibliography) environment and what the .bbl files do. This question on StackExchange put the final piece together for how to solve my problem.

I also need to add

    \usepackage{alphalph,cite}

to my preamble.

An example code then looks like this:

  \documentclass{article}
  \usepackage[resetlabels]{multibib}
  \usepackage{alphalph,cite}

\newcites{num}{Numbers} \newcites{let}{Letters}

\begin{document}

Here I'd like to cite reference \citenum{number1} and \citenum{number2}, and enclosures \citelet{letter1} and \citelet{letter2}.

\bibliographystylenum{plain} \bibliographynum{numberbib}

\bibliographystylelet{plain} \bibliographylet{letterbib} \end{document}

The enclosures bibliography then looks like this:

  @Article{letter1,
  author    =   {letter author 1},
  title     =   {Letter title 1},
  year      =   {2023},
  month =   {January}
  }

@Article{letter2, author = {letter author 2}, title = {Letter title 2}, year = {2023}, month = {January} }

and the .bbl file looks like this

  \begin{thebibliography}{1}
  \makeatletter
  \def\@bibitem#1{\item\if@filesw \immediate\write\@auxout
    {\string\bibcite{#1}{\alphalph{\value{\@listctr}}}}\fi\ignorespaces}
  \def\@biblabel#1{[\alphalph{#1}]}
  \makeatother

\bibitem{letter1} letter~author 1. \newblock Letter title 1. \newblock January 2023.

\bibitem{letter2} letter~author 2. \newblock Letter title 2. \newblock January 2023.

\end{thebibliography}

HOWEVER, I will have to copy/paste

  \makeatletter
  \def\@bibitem#1{\item\if@filesw \immediate\write\@auxout
    {\string\bibcite{#1}{\alphalph{\value{\@listctr}}}}\fi\ignorespaces}
  \def\@biblabel#1{[\alphalph{#1}]}
  \makeatother

into the .bbl file every time I add in a new enclosure reference because it creates a new .bbl file every time the bibliography is recompiled with new data.