如何将 bibtex 引用转换为脚注

如何将 bibtex 引用转换为脚注

我有一个 LaTeX 文件和一个 bibtex 文件,使用 natbib 包进行参考书目管理。我想使用以下代码将其转换为 HTMLhttps://github.com/softcover/softcover。但是 softcover 一般不支持 bibtex 和书目。作者建议改用脚注。但这意味着我必须将所有内容转换\cite为相应的\footnote命令。

因为手动执行此操作确实很费力,所以我想知道是否有办法自动进行此转换。基本上我想转换以下两个文件

\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}

@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"
}

\footnote使用命令而不是\citenatbib 命令将其合并到一个文件中

\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}

我通过将文件中的引用内容复制.bbl到命令中来手动生成后者文件\footnote。如果引用太多,这会变得非常繁琐且容易出错。有没有办法以编程方式进行这样的转换?

相关内容