dmp文件转成正常表_将带有bib参考文献的tex文档转化成docx格式文件

本文介绍了如何使用pandoc工具将包含bib参考文献的TeX文件转换成docx格式,以满足英文论文投稿需求。通过pandoc-crossref可以解决转换后参考文献序号丢失的问题,但需要额外安装依赖。
摘要由CSDN通过智能技术生成

本文使用 Zhihu On VSCode 创作并发布

需求

英文论文投稿一般要投 tex 格式,参考文献是 bib 格式,但是导师习惯在 docx 上修改,所以需要将带 bib 参考文件的 tex 格式转成 docx 格式

note:只想预览效果可以直接看图,不看内容

工具

  • pandoc

pandoc 是一款免费的格式转换工具

操作方法

我们准备一个 tex 文件 untitled.tex 和一个 bib 文件 citations.bib ,它们位于同一层目录,文件内容放在本文末尾。

tex编译成pdf后是下面的效果

a0ba4bbc8258baf6bd4e6e822ba5fd83.png
image-20200619221248742

将 tex 文件转成 docx 文件,只要使用下面的命令,其中 output.docx 是输出文件

pandoc Untitled.tex -o output.docx --bibliography citations.bib

我们看一下output.docx的内容

e15ce0882acce771e74a2e03af0a4fc5.png

可以看到,公示能正常转换,但是引用没有序号,参考链接也没有序号

另外我在这篇回答里看到使用 pandoc-crossref 转换,其操作为

pandoc  Untitled.tex -o output.docx --filter pandoc-crossref --bibliography=citations.bib

这样做需要安装 pandoc-crossref, 和 pandoc-citeproc,mac下可以直接使用 brew 命令安装

附件

以下是untitled.tex的文件内容

documentclass{article}

begin{document}
This document is an example of BibTeX using in bibliography management. Three items 
are cited: textit{The LaTeX Companion} book cite{latexcompanion}, the Einstein
journal paper cite{einstein}, and the Donald Knuth's website cite{knuthwebsite}. 
The LaTeX related items are cite{latexcompanion,knuthwebsite}. 

Here is a formula: 
$$sum_{i=1}^{n} a_i = pi $$
medskip

bibliographystyle{unsrt}
bibliography{citations}

end{document}

以下是citations.bib文件内容

@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",
    url       = "http://www-cs-faculty.stanford.edu/~{}uno/abcde.html"
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值