4

Consider the following MWE:

\documentclass{article}
\usepackage{xcolor}
\definecolor{orange}{RGB}{255,127,0}
\begin{document}
\textcolor{orange}{Hello!}
\end{document}

When I compile this document in xelatex, it produces an orange colored 'Hello!'

I want to produce a pure monochrome (black and white) document.

How do I get that done without changing the \definecolor or \textcolor commands?

7

Note this is fixed in current releases of the xetex.def graphics driver so the patch here is not needed

The monochrome option (inherited from the standard color package, not needing xcolor) is supposed to work, as in the other answer, but xetex.def currently breaks that option, we should fix that.

this works

\listfiles % <================ to get list of used packages and versions
\documentclass{article}
\usepackage[monochrome]{xcolor} % <=====================================
\makeatletter
\let\check@for@XeTeX@colorstack\relax
\makeatletter

\definecolor{orange}{RGB}{255,127,0}
\begin{document}



\textcolor{orange}{Hello!}
\end{document}

but make sure to remove the redefinition when you do want colour.

3

Just add for example option [monochrome] to xcolor.

See the following MWE (see marked line with <==============):

\listfiles % <================ to get list of used packages and versions
\documentclass{article}
\usepackage[monochrome]{xcolor} % <=====================================
\definecolor{orange}{RGB}{255,127,0}
\begin{document}
\textcolor{orange}{Hello!}
\end{document}

and the resulting pdf:

enter image description here

and my list of used packages including version numbers:

 *File List*
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
  xcolor.sty    2016/05/11 v2.12 LaTeX color extensions (UK)
   color.cfg    2016/01/02 v1.6 sample color configuration
  pdftex.def    2016/07/10 v0.06j Graphics/color for pdfTeX
infwarerr.sty    2016/05/16 v1.4 Providing info/warning/error messages (HO)
 ltxcmds.sty    2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
supp-pdf.mkii
 ***********

 ) 

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.