2019-05-20 Converting BibTeX files to AMSrefs

It’s been a long time since I’ve written anything TeX-related here. But I’m still working with LaTeX (though less often than I used to), and here is a problem I encountered a few days ago – and a solution.

I received a file with BibTeX-encoded bibliography. Obviously, I wanted to convert it to AMSrefs. Being lazy, I started to search for an automated solution – and I was not disappointed at all! It turns out that AMSrefs itself has a feature I needed.

Assume the following structure. The file example.tex looks like this:

\documentclass{article}

\begin{document}
Lorem ipsum.  See \cite{fasc-paper}.

\bibliography{example}
\bibliographystyle{abbrv}

\end{document}  

The file example.bib looks like this:

@article{fasc-paper,
  Author = {Thor, A. U.},
  Journal = {Some journal},
  Pages = {111-222},
  Title = {A fascinating paper},
  Volume = {1},
  Year = {2009},
}

After the usual compile-bibtex-compile-view cycle, we get the example.bbl file and a nicely produced pdf.

However, what we can do is to change the abbrv to amsrn, and voilà! our example.bbl file now looks like this:

% \bib, bibdiv, biblist are defined by the amsrefs package.
\begin{bibdiv}
\begin{biblist}

\bib{fasc-paper}{article}{
      author={Thor, A.~U.},
       title={A fascinating paper},
        date={1987},
     journal={Some journal},
      volume={1},
       pages={111\ndash 222},
}

\end{biblist}
\end{bibdiv}

In order to properly compile example.tex we only need to add \usepackage{amsrefs} and we’re done! (Of course, there is now no need to use the bbl file – I prefer to copy-paste it to the main one.)

If you want to learn more (in particular, how to use other styles when converting to AMSrefs), look for the amsxport.pdf file in your TeX distribution. The easiest way to find it is by saying texdoc amsxport in your terminal.

CategoryEnglish, CategoryBlog, CategoryTeX