使用pandoc,我试图通过组合一个.tex文件和一个.md文件来生成一个.bib文件。在结果的latex文件中,Pandoc已经将格式化为纯文本--内联引用以及书目中的完整引用。但是,我喜欢使用\cite和\bibitem格式的引用。
example.md
---
title: Plain Text Workflow
author: Dennis Tenen, Grant Wythoff
date: January 20, 2014
bibliography: example.bib
---
# Section 1
Some sentence that needs citation [@fyfe_digital_2011 argues that too].
# Bibliographyexample.bib
@article{fyfe_digital_2011,
title = {Digital Pedagogy Unplugged},
volume = {5},
url = {http://digitalhumanities.org/dhq/vol/5/3/000106/000106.html},
number = {3},
urldate = {2013-09-28},
author = {Fyfe, Paul},
year = {2011},
file = {fyfe_digital_pedagogy_unplugged_2011.pdf}
}Pandoc命令
pandoc example.md -t latex -s -S --filter pandoc-citeproc -o example.texexample.tex (节选)
Some sentence that needs citation (Fyfe 2011 argues that too).
\section*{Bibliography}\label{bibliography}
\addcontentsline{toc}{section}{Bibliography}
Fyfe, Paul. 2011. ``Digital Pedagogy Unplugged'' 5 (3).
\url{http://digitalhumanities.org/dhq/vol/5/3/000106/000106.html}.但是,我想要的是这个(本质上是由bibtex生成的.bbl文件中的内容):
Some sentence that needs citation \citep[ argues that too]{fyfe_digital_2011}.
\begin{thebibliography}{1}
\providecommand{\natexlab}[1]{#1}
\providecommand{\url}[1]{\texttt{#1}}
\expandafter\ifx\csname urlstyle\endcsname\relax
\providecommand{\doi}[1]{doi: #1}\else
\providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi
\bibitem[Fyfe(2011)]{fyfe_digital_2011}
Paul Fyfe.
\newblock Digital pedagogy unplugged.
\newblock 5\penalty0 (3), 2011.
\newblock URL
\url{http://digitalhumanities.org/dhq/vol/5/3/000106/000106.html}.
\end{thebibliography}我知道我可以使用--natbib --bibliography=example.bib运行pandoc,然后用pdflatex和bibtex编译,并使用\input{example.bbl}。但是,是否有一种方法可以正确地处理pandoc,而不需要在中间设置bibtex (手动或管道)?
顺便问一下,当pandoc直接用--filter pandoc-citeproc生成一个pdf时,它是如何在内部实现的呢?如果它也只是使用这些预先格式化的纯文本引用,我将深感失望。因为看起来在latex模板的前导中定义的单个样式在本例中不适用。
发布于 2015-05-07 07:35:17
1)你不能。要么是你
pandoc-citeproc,参见第2点)或--natbib)或biblatex (--biblatex),但您必须依赖外部bibtex文件(或另一种兼容格式)。然后,您将需要bibtex或biber来格式化您的引用。( 2) pandoc-citeproc依赖于csl风格。您可以找到一些这里和这里,并且可以轻松地自定义它们( 这里 )。使用--csl=或YAML标题块中的csl:行将其传递给您的pandoc命令。Pandoc在~/.csl中查找文件,如果它不存在,或者在与您的标记文件相同的目录中,则必须给出完整的路径。
https://stackoverflow.com/questions/30092337
复制相似问题