这是一篇教程,教你用最快的方式将Word文件转化成Latex文件,最后生成高质量的PDF文档。 国际知名的出版社(比如Elsevier, Springer, and Wiley)基本都提供两种提交文章的方式: Word模板和Latex模板。
什么是Latex,以及它有什么优势:
- LaTeX是一类用于文件编辑和排版的系统,生成高印刷质量的各种文档。
- LaTeX编辑和排版的核心思想在于,通过,规定了每一句话在文章中所从属的层次,从而极大方便了对各个层次批量处理。
- LaTeX在使用体验方面,最不易被Word替代的有四个方面:方便美观的数学公式编辑、不会乱动的退格对齐、非所见即所得因此可以在编辑的时候用退格和换行整理思路但生成PDF出来不影响美观、部分导师和刊物不接受Word排版的文章。
软件安装
- Pandoc: If you need to convert files from one markup format into another, pandoc is your swiss-army knife.
- JabRef: Native BibTeX and BibLaTeX support, perfect for text-based typesetting systems such as LaTeX and Markdown.
- LaTex: MikTex, GhostScript and PDF viewer, and TexStudio
三步教程
Step1. Word2Latex using Pandoc
- Reference in word using Endnote
- Reference in Latex using JabRef
pandoc [options] [input-file]…
-s: standalone
–wrap=auto, none, or preserve
–extract-media=. : extract figures from the document
Check details in the pandoc manual
pandoc --extract-media=. --wrap=none -s input.docx -t latex –o output.tex
Step2a. 公式,表格和图片
- Equations: Convert to default math format in Word
%equation
begin{equation}
label{eq:eq1}
x + y = z
end{equation}
%table
begin{table}[H]
caption{Table 1label{tab:tab1}}
begin{tabular}{ll}
toprule
Tabe Head
midrule
text
bottomrule
end{tabular}
end{table}
%figure
begin{figure}
caption{Figure 1label{fig:fig1}}
includegraphics[width=linewidth]{Fig.jpg}
end{figure}
Cite by: ref{eq:eq1}; ref{tab:tab1}; ref{fig:fig1}
Step2b. 参考文献管理
- JabRef: Generate Citation keys (e.g., RN1)
%in the preamble
bibliographystyle{plain}
%Where the bibliography will be printed
bibliography{name of .bib file}
@book{RN1,
author = {Gastel, Barbara and Day, Robert A.},
title = {How to Write and Publisher a Scientific Paper},
publisher = {Cambridge University Press},
address = {New York, USA},
year = {2017},
type = {Book}
}
Cite by: cite{RN1}
Step3. 转换成任何其他模版
- Document class (e.g., elsarticle.cls)
- Bibliography style (e.g., elsarticle-num.bst)
%Default class: article, book, thesis
documentclass[12pt]{article}
bibliographystyle{plain}
%Elsevier
documentclass[review]{elsarticle}
bibliographystyle{elsarticle-num}
其他工具
- Support collaborative online editing
- Overleaf
- Authorea
- Support fully reproducible document using multiple languages, eg R or Python
- Rmarkdown