Graphics, Figures & TablesGrayscale output with latex (via GS)

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Faust
Posts: 55
Joined: Thu Oct 29, 2009 12:45 pm

Grayscale output with latex (via GS)

Post by Faust »

I have been asked to supply a black/white copy of some pdf's.

I presume this is for decreased size and for those who do not own a color printer.

Anyways, I have 2 questions regarding this:

-is there a way to make grayscale pfs with pdf2latex (what command if there is)

-Im using the latex- ps- pdf route via ghostscript and added commands for grayscale output, however this is as fast as a snale in hibernation. Is there a way to speed it up? I used this:

Arguments for the ghostscript postprocessing in the profile I made:

-sPAPERSIZE=a4 -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile="%bm.pdf" -c save pop -f "%bm.ps"


it looks nice and grey though but took like 5 mins to build.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Grayscale output with latex (via GS)

Post by phi »

Try \selectcolormodel from the xcolor package:

Code: Select all

\documentclass{article}

\usepackage{xcolor}

\selectcolormodel{gray}

\begin{document}

\textcolor{blue}{\rule{5cm}{2cm}}
\textcolor{yellow}{\rule{5cm}{2cm}}

\end{document}
Faust
Posts: 55
Joined: Thu Oct 29, 2009 12:45 pm

Re: Grayscale output with latex (via GS)

Post by Faust »

This doesnt work for figures Im using, just text.
Post Reply