LATEX中保留论文修改痕迹,生成论文修订稿

最近需要在latex中修改论文,并保留修改痕迹,收集总结了以下三种实现方式。

法一:使用changes宏包

我觉得最方便最有效的方式。在导言区加入如下代码,可以一键生成保留/禁用修订的方式。

% 修订痕迹保留 法一
\usepackage[defaultcolor=red]{changes}  %使用changes宏包
%\usepackage[final]{changes} %禁用修订,输出最终修订完成的版本
\definechangesauthor[name={Author}, color=red]{A} %修订作者

文中需要增删的地方,采用相应的命令\added{}和\deleted{}就够用了。

法二:

参考链接latex实现pdf中带有注释或批注
导言区加入如下代码:

% 修订痕迹保留 法二
\usepackage{xargs} % Use more than one optional parameter in a new commands
% \usepackage[pdftex,dvipsnames]{xcolor}  % Coloured text etc.
%
% \usepackage[colorinlistoftodos,prependcaption,textsize=tiny]{todonotes}
\newcommandx{\unsure}[2][1=]{\todo[linecolor=red,backgroundcolor=red!25,bordercolor=red,#1]{#2}}
\newcommandx{\change}[2][1=]{\todo[linecolor=blue,backgroundcolor=blue!25,bordercolor=blue,#1]{#2}}

% \newcommandx{\thiswillnotshow}[2][1=]{\todo[disable,#1]{#2}}
%

正文中在需要添加批注的地方,使用相应的命令\unsure{}和\change{}即可,链接里说的蛮详细。

法三:使用marginpar命令

代码更复杂一点,但是可以更细致的调大小、位置等参数。参考边注 新样式
在导言区加入:

% 修订痕迹保留 法三
\usepackage{tikz}

\newcommand{\annmark}[1]{%
    \textcolor{red}{#1}%
}%

\newcommand{\ann}[1]{%
    \begin{tikzpicture}[remember picture, baseline=-0.75ex]%
        \node[coordinate] (inText) {};%
    \end{tikzpicture}%
    \marginpar{%
        \renewcommand{\baselinestretch}{1.0}%
        \begin{tikzpicture}[remember picture]%
            \definecolor{orange}{rgb}{1,0.5,0}%
            \draw node[fill=red!20,text width=\marginparwidth] (inNote){\footnotesize#1};%
        \end{tikzpicture}%
    }%
    \begin{tikzpicture}[remember picture, overlay]%
        \draw[draw = orange, thick]
            ([yshift=-0.2cm] inText)
                -| ([xshift=-0.2cm] inNote.west)
                -| (inNote.west);%
    \end{tikzpicture}%
}%

% \setlength{\marginparwidth}{1cm}
% \renewcommand{\baselinestretch}{1.3}
\setlength{\marginparwidth}{1.4cm}
\setlength{\marginparsep}{0.3cm}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值