[Tex/LaTex] how to create PDF in grayscale mode or TikZ figure only

coloroutputpdftikz-pgf

how to create PDF in grayscale mode?
convert PDF color in PDF grayscale.
I need the PDF in grayscale color.
Or in TikZ figure only.

Best Answer

For TikZ figures, you can use the xcolor command \selectcolormodel{gray} before or at the start of your tikzpicture. This won't turn images that you import with \includegraphics to grayscale, though.

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[radius=0.5cm]
\selectcolormodel{gray}
\fill [red] (0,0) circle;
\fill [green] (1,0) circle;
\fill [blue] (2,0) circle;
\end{tikzpicture}

\begin{tikzpicture}[radius=0.5cm]
\fill [red] (0,0) circle;
\fill [green] (1,0) circle;
\fill [blue] (2,0) circle;
\end{tikzpicture}

\end{document}