我使用更改来建议对共享文档进行更改。为了更改添加和删除的文本的颜色,我为每个文本创建了新命令:
\documentclass[pdf,12pt]{article}
\usepackage{changes}
\newcommand\del[1]{\deleted{\textcolor{red}{#1}}}
\newcommand\add[1]{\added{\textcolor{blue}{#1}}}
\begin{document}
\indent a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch \add{of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch} of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of \del{text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch} of text a bunch of text a bunch of text a bunch of
text.
\end{document}
出于某种原因,当我在文本中使用新命令 \del 时,如果删除的文本跨越多行,则删除的文本会被推到边距之外。我该如何解决这个问题?
答案1
嗯,你不能在已删除的内容中使用颜色命令。这会与下划线冲突。你也许可以使用作者 ID 来更改颜色(也许有更好的方法,请查看文档)。
\documentclass[pdf,12pt]{article}
\usepackage[authormarkup=none]{changes}
\definechangesauthor[name=ZZZ, color=red]{ZZZ}
\newcommand\del[1]{\deleted[id=ZZZ]{#1}}
\newcommand\add[1]{\added{\textcolor{blue}{#1}}}
\begin{document}
\indent a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch \add{of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch} of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of \del{text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch} of text a bunch of text a bunch of text a bunch of
text.
\end{document}
答案2
使用提供的命令变化用于更改标记的包。这样,您可以直接看到哪些标记有效,哪些无效。
\documentclass[pdf,12pt]{article}
\usepackage{changes}
\setaddedmarkup{\textcolor{green}{#1}}
\setdeletedmarkup{\textcolor{red}{\sout{#1}}}
\begin{document}
\indent a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch \added{of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch} of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of \deleted{text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch} of text a bunch of text a bunch of text a bunch of
text.
\end{document}