开发者

How to add changebar in latex?

In Latex, I've created a new command 'changedtext' to mark specifics parts in my document and make it appear blue:

\newcommand{\changedtext}[1]{\textcolor{blue}{#1} }

Is there any easy way to alter the command to have change bars appear next to the text in the resulting PDF? If not possible, any other suggestion for a visual ma开发者_如何转开发rkup (other than change bars) that would be clear on a black & white printout would be useful as well.

Update: It might be of interest to readers of this question that some time ago I started using the latexdiff script to mark up changes between two versions. I use it in combination with SVN, which I think works great; if you split up your LaTeX files, you might want to look at this tex.stackexchange question though.


Use one of the changebar macro packages in your command.


One other way which would be very clear in B&W would be highlight (shows as gray background).

Use packages soul and color and define your highlight color:

\usepackage{soul}
\usepackage{color}
\definecolor{lightgray}{rgb}{.92,.92,.92}
\sethlcolor{lightgray}

Now you can use \hl{highlighted text} in text to highlight.


Some half-baked solution (not satisfactory) I just came up with myself, is the use of \marginpar to have some arbitrary indication in the margin, e.g.:

\newcommand{\changedtext}[1]{\textcolor{blue}{#1 \marginpar{r1}} }

will put the text 'r1' (from revision 1) in the margin.

However, when using this, the \changedtext command can not be used everywhere (e.g. in formulas, captions) because LateX will complain (in my case) about 'float(s) lost'.

Still,it might be useful to some people...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜