Search code examples
latextextcolor

how to overrule all color statements in latex to get all text in 1 color


I have a latex file with quite some text highlighted in another color using the \textcolor{}{} statement. But regularly I need to output the full document with only black text (I keep updating the document with colored text).

I am therefore looking for a way to set all text color in the entire document in such a way that it overrules the individual \textcolor statements. Is that possible? If not, what would be the most efficient way to do this? I don't want to manually remove all those \textcolor statements every time..

I have really tried to search before asking but I couldn't find it, so I think/hope it is not a duplicate.


Solution

  • You could use the monochrome option of xcolor:

    \documentclass{article}
    
    \usepackage[
    monochrome
    ]{xcolor}
    
    \begin{document}
    
    \textcolor{red}{test}
    \textcolor{cyan}{test}
    \textcolor{violet}{test}
    \textcolor{orange}{test}
    \end{document}
    

    enter image description here