3

I have a LaTeX file and a bibtex file using the natbib package for bibliography management. I wanted to convert this to HTML using https://github.com/softcover/softcover . However softcover does not support bibtex and bibliographies in general. The author recommends to use footnotes instead. But this means, that I have to convert all \cite into corresponding \footnote commands.

Because doing this manually is really a lot of work, I'm wondering if there is a way to do this conversion automatically. Basically I want to convert the following two files

\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{natbib}

\begin{document}
\chapter{Example}
This document is an example of bibliography 
management\footnote{We are using the \texttt{natbib} package.}. Three items are cited: \textit{The \LaTeX\ Companion} book \cite{latexcompanion}, the \citet{einstein} journal paper, and the 
Donald Knuth's website \citep{knuthwebsite}. The \LaTeX\ related items are
\cite{latexcompanion,knuthwebsite}. 

\bibliographystyle{apalike} 
\bibliography{natbib}

\end{document}

and

@article{einstein,
    author =       "Albert Einstein",
    title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
        [{On} the electrodynamics of moving bodies]",
    journal =      "Annalen der Physik",
    volume =       "322",
    number =       "10",
    pages =        "891--921",
    year =         "1905",
    DOI =          "http://dx.doi.org/10.1002/andp.19053221004"
}

@book{latexcompanion,
    author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title     = "The \LaTeX\ Companion",
    year      = "1993",
    publisher = "Addison-Wesley",
    address   = "Reading, Massachusetts"
}

@misc{knuthwebsite,
    author    = "Donald Knuth",
    title     = "Knuth: Computers and Typesetting",
    Note    = "URL: http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html",
    url       = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html",
    year    = "1999"
}

into one file using the \footnote command instead of \cite commands of natbib like

\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\begin{document}
\chapter{Example}
This document is an example of bibliography 
management\footnote{We are not using the \texttt{natbib} package.}. Three items are cited: \textit{The \LaTeX\ Companion} book\footnote{Goossens, M., Mittelbach, F., and Samarin, A. (1993). Addison-Wesley, Reading, Massachusetts.}, 
the\footnote{Einstein, A. (1905).{\em Annalen der Physik}, 322(10):891--921} 
journal paper, and the Donald Knuth's website\footnote{Knuth, D. (1999). URL: http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html.}. 
The \LaTeX\ related items are\footnote{Goossens, M., Mittelbach, F., and Samarin, A. (1993). Addison-Wesley, Reading, Massachusetts., Knuth, D. (1999). URL: http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html.}. 

\end{document}

I generated the latter file manually by copying the content of the references from the .bbl file into the \footnote commands. With many references this becomes very tedious and errorprone. Is there a way to do such a conversion programmatically?

  • You might find pandoc gives you more flexibility. In terms of getting the references right, you might want to switch the .bst involved. pandoc is supposed to work with both traditional BibTeX and the more modern biblatex. – jon Sep 27 '15 at 15:40
  • Is there any news here? – Johannes_B Jul 30 '17 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.