Is there a way to dynamically change text colors?

Viewed 41

Can I dynamically change the colors of "all" words for which I set the font color? E.g; All fonts that I have set as green are red.

1 Answers

You could use a custom colour for your text and then change the definition of it to be red, green or whatever you want to change it to:

\documentclass{article}

\usepackage{xcolor}

\colorlet{mycol}{green}

\begin{document}

\textcolor{mycol}{text}

text

\textcolor{mycol}{text}

\end{document}
Related