0
%! TEX program = lualatex
\documentclass[]{article}
\usepackage{luatex85}
\usepackage[xcolor,pdftex]{changebar}
\usepackage{lipsum}
\cbcolor{blue}

\begin{document}
\lipsum[2]
\cbstart
{\color{blue} % I want to remove this here and add a configuration to the preamble.
  \lipsum[2]
}
\cbend
\lipsum[2]
\end{document}

I would like to automatically change the textcolor when I activate the changebar with \cbstart and switch back with \cbend.

  • It won't work, at least not for all variants. \cbstart can start in a different grouping level than \cbend. But you could redefine the changebar environment to add a color. – Ulrike Fischer Mar 28 '17 at 11:57
  • Thanks for your comment. I see. I will try out to use a renewed changebar environment. – Hotschke Mar 28 '17 at 11:59
1

My solution redefining the environment changebar as suggested by Ulrike Fischer:

\let\internchangebar\changebar
\let\endinternchangebar\endchangebar
\renewenvironment{changebar}
  {\begin{internchangebar}\bgroup\color{blue}}
  {\egroup\end{internchangebar}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.