I would like to produce two kinds of formattings for my documents.
- The 1st formatting will use colors. This is typically for reading on a screen.
- The 2nd formatting will use gray colors for printing.
Which method can I use to say to LaTeX which kind of formatting rules to use ?
Here is a very small example of the commands that I'm building.
\documentclass[10pt,a4paper]{article}
\usepackage[utf8x]{inputenc}
\usepackage{ucs}
\usepackage{graphicx}
\usepackage{xparse}
\usepackage[x11names, svgnames]{xcolor}
\usepackage{fourier-orns}
\newcommand{\boldit}[1]{%
\mathversion{bold}\textbf{#1}\mathversion{normal} %
}
\newbox\FBox
\NewDocumentCommand\boxit{O{black}O{white}mO{0.5pt}O{0pt}O{0pt}}{%
\setlength\fboxsep{#4}\sbox\FBox{\fcolorbox{#1}{#2}{#3\rule[-#5]{0pt}{#6}}}\usebox\FBox}
% The colored version.
\newcommand{\warning}[1]{\textcolor{Red3}{\raisebox{\depth}{\danger}\boldit{\,#1}}}
% The gray version that must be used instead
% of \warning if the mode is black and white.
\newcommand{\warningBW}[1]{\boxit[black!80][black!30]{\raisebox{\depth}{\danger}\boldit{\,#1}}}
\begin{document}
Let's try one example... \warning{Danger !}
\end{document}
\ifthen
for the parts which differ. The argument could be a value you declare in the preamble and set before compiling. – Count Zero Nov 21 '11 at 17:13