一、效果示例
\documentclass[12pt]{article}
\usepackage{changes}
\begin{document}
This is \added{added text}.
This is \deleted[comment={two words}]{deleted text}.
This is \replaced{new}{old} text.
This is \highlight{highlight} text.
This is \comment{comment} commented text.
\end{document}
二、使用步骤
1. 引入changes包,\usepackege{changes},一般都已默认安装,没有的话可以再另外下载
Latex之安装宏包_MemRay-CSDN博客_latex导入宏包
2. 基本功能就是添加、删除、替换、高亮、批注,可以浏览一下使用手册\texlive\2021\texmf-dist\doc\latex\changes\changes.english.withcode.pdf,或者以下功能也基本够用了
\added{这里放要添加的内容}
\deleted{这里放要删除的内容}
\replaced{这里放要添加的内容}{这里放被替换掉的内容}
\highlight{这里放要高亮的内容}
\comment{这里放评论内容,不会显示在正文}
3. 若想输出pdf不显示批注,只需要把\usepackege{changes}换成\usepackege[final]{changes}即可,效果如下
4. 若想tex文件中删除批注,则需要借助\texlive\2021\texmf-dist\scripts\pyMergeChanges.py,使用方法为“win+R”——>输入“cmd”回车——>输入“cd/d input.tex文件的路径” 回车实现路径切换——>输入”python pyMergeChanges.py [-arh] <Input File> <Output File>“回车运行python代码实现批量删除修订和批注
-a:接受所有修订;-r:拒绝所有修订;-h:取消所有高亮
注意事项:需要安装好python;pyMergeChanges.py和input.tex文件放在一个文件夹里面;接受所有修订时的输入示例python pyMergeChanges.py -a input.tex output.tex,文件命名注意不要多个单词,输入输出两个文件不可同名