http://www.peteryu.ca/tutorials/publishing/latexdiff
论文投出之后,如果好消息,通常是minor/major revision难免; 很少有文不加点直接接受的.
修改的时候为了方便编辑和审稿人,高亮显示文档中改动的部分是专业的.
MS word的comment 审阅修订中"对比compare文档"功能是很方便的.
但是在LaTeX中如何实现? -- 实际上是对tex源代码的两个版本的对比,
如果安装了CTeX,只需要两点:
(1) 确保latexdiff-so.exe等文件所在的bin文件夹也被添加到系统环境变量path中(可能要手动自己添加,否则只能在该文件夹下使用latexdiff-so.exe命令行是郁闷的)
(2)再安装ActivePerl,安装的时候选择把ActivePerl添加到系统环境变量path中即可;
windows下activeperl 5.16的下载地址,可以从这里进入:
点击打开链接:或直接用下面的下载链接:
命令行cmd.exe中输入:
>> latexdiff-so old_tex_source.tex new_tex_source.tex > difference.tex
然后用同样方法编译difference.tex 即可
(比如LaTeX 1次> BibTeX 一次>> LaTeX 2次>> dvi2ps 1次>> ps2pdf 完成;)
尝试之后,发现对使用了gnuplot绘图的命令支持不好,如果有相应的改动,可能无法通过编译. 但其它的则鲜有例外.
Track changes and highlight revisions in LaTeX documents
with latexdiff
WHEN several
authors are editing a paper, it is sometimes necessary to quickly highlight what changes have been made in a particular version of the paper compared to previous versions. Word processors have long had revision tracking features for this but some LaTeX authors
are unaware that there is a handy utility called latexdiff
that
can also highlight changes between two revisions by comparing two LaTeX documents:
This page briefly describes this program. While LaTeX authors can use revision control software like software developers to track changes, there are cases where this is not convenient. For example, grad students may revise papers, get feedback from their advisor
and then revise the paper again (I know I did). The advisor just wants to see quickly and with formatting what changes were made on the manuscript without learning how to use revision control software. latexdiff provides a way to do this. It performs a “diff”
(like the Unix utility) on the two documents and then creates a new LaTeX document where the changes are made clear.
Prerequisites
-
Ensure that the latexdiff program
is in your system path. Windows users with MiKTeX will find that it already comes with latexdiff: there are severallatexdiff*.exe
files
in MiKTeX'sbin
directory.
I usually uselatexdiff-so.exe
. -
Make sure that Perl is on the system
path, as it is required by latexdiff to run.
Usage
Obviously you need to have two versions of your document to compare. latexdiff can be run with the following command:
latexdiff-so old_version.tex new_version.tex > differences.tex
The resulting differences.tex
file
can be run through LaTeX to produce the version with revisions highlighted.
It has been pointed out to me that the file names should not have spaces or else you will have to enclose them in quotes.
Additional Tips
Sometimes latexdiff produces wrong output that will give an error when you run LaTeX on the file. In the cases I have seen, you simply need to go to the place where the error occurs and make sure that the various commands that latexdiff adds are properly closed.
For example, you may have to add some \DIFaddend
to
unclosed \DIFadd
commands.
The program does not necessarily handle complex math equations properly but I have found that it is enough to do the job most of the time. It also has a number of command line options that I have not had to use yet.
Finally, if your document is split up into sections, it might be best to split the LaTeX files up into a file per section so the diff
process
can work more smoothly. I have been particularly lazy and have not done this for my journal submissions but it is probably a good idea.
Discussion
12:36
them to convert their documents to Word. Would LaTexdiff work for this of should I consider LyX? I would really appreciate your help on this one.
Thanks so much,
Glenna Jenkins
01:49
you a way to leave comments. So you'd edit their LaTeX file and then run latexdiff to highlight the differences.
09:38
Regards
Salman
01:02
give V2 and the highlighted file to the reviewers. When you make V3, you can then compare the differences between V2 and V3.