1

I need to mark two different types of changes in a document, but I cannot use different colours. The only solution I found so far is to change the \changebarwidth, but using a thin and a thick changebar, respectively, is not a 'beautiful' solution for my needs. Instead, I am looking for a solution to change the type of the changebar, e.g. using a "double-changebar" (two parallel changebars) or a dashed changebar or something like that. I have tried to use nested changebars but I was not able to alternate the \changebarsep for the second changebar only. Is there a feasible solution for getting different changebars?

Update: The solution should also work for changes that go over two (or more) pages.

Here is an example code:

\documentclass{article}

\usepackage{changebar}

\setlength\changebarsep{30pt}

\begin{document}

This is some text.\\

\cbstart 
Here is some text that has to be marked with the usual changebar.
\cbend 

\bigskip
This is some further text.\\

\cbstart 
\setlength\changebarsep{15pt} %this seems not to have any effect at all 
\cbstart
Here is some text that has to be marked with a different changebar.
\cbend 
\cbend

\end{document}```

1 Answer 1

1

A tikz solution:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,positioning}
\newcommand{\tikzmark}[1]{\begin{tikzpicture}[overlay,remember picture] \coordinate (#1);\end{tikzpicture}}
\makeatletter
\newcommand{\myfsize}{\f@size pt}
\makeatother
\newcommand{\cbstart}[1][1]{\xdef\myArg{#1}\tikzmark{cbstart}}
\newcommand{\cbend}{\tikzmark{cbend}\foreach \i in {1,...,\myArg}{\begin{tikzpicture}[overlay,remember picture]\draw let \p1=(cbstart),\p2=(cbend),\p3=(current page.east) in ({\x3-2cm+\i*0.1cm},{\y1+\myfsize})--({\x3-2cm+\i*0.1cm},{\y2});\end{tikzpicture}}}


\begin{document}

This is some text.\\

\cbstart 
Here is some text that has to be marked with the usual changebar.
\cbend 

\bigskip
This is some further text.\\

\cbstart[2] 
Here is some text that has to be marked with a changebar different Here is some text that has to be marked with a different.
\cbend 

Some other text

\large
\cbstart[3] 
Here is some text that has to be marked with a changebar different Here is some text that has to be marked with a different.Here is some text that has to be marked with a changebar different Here is some text that has to be marked with a different.
\cbend 

\end{document}

enter image description here

2
  • 1
    For changes that are only within one page, the proposed solution seems to work fine. However, if the changes go over two (or more) pages, the solution does no longer work. In this case, the changebar is shown only in the very end of the respective paragraph. Is there a solution for this as well?
    – Jack
    Commented Nov 10, 2019 at 10:18
  • @Jack you are right ... I didn't thought about that when answering ... I can't work on this right now because I have something more urgent ... I could try do it soon... but I am thinking that in more than two pages it will be difficult to work
    – koleygr
    Commented Nov 10, 2019 at 11:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .