14

I found out, that my color laser printer prints graphics with gray color in RGB-Representation instead of using black (they are more red then gray). So it seems, that PDFLaTeX is creating RGB-PDF-Files.

I only use pstricks-graphics like this one:

\documentclass[letterpaper,dvips]{article}

\usepackage[utf8]{inputenc}
\usepackage{textcomp}

\usepackage{pst-all}

\usepackage{color}

\begin{document}

    \pagestyle{empty}
    \begin{TeXtoEPS}
        \psset{xunit=1cm,yunit=1cm,runit=1cm}
        \begin{pspicture}(2,2)
            \psset{linewidth=1pt}

            \psframe[fillstyle=solid, linewidth=1pt, fillcolor=lightgray](2,2)

        \end{pspicture}

    \end{TeXtoEPS}

\end{document}

I'm creating eps-files with this steps:

  • latex Grafik1.tex
  • dvips Grafik1.dvi -o Grafik1.ps
  • ps2eps --ignoreBB Grafik1.ps

and include the eps-file with \includegraphics

So is there a way to tell the whole document only create CMYK-Colors or an other way to create a document with the wright colors?

EDIT: The basic Problem is solved, but when creating a gradient, colors are used instead of black

\documentclass[letterpaper,dvips]{article}

\usepackage[utf8]{inputenc}
\usepackage{textcomp}

\PassOptionsToPackage{cmyk}{xcolor}% NB: put this *before* \usepackage{pst-all}
\usepackage{pst-all}


\begin{document}

    \pagestyle{empty}
    \begin{TeXtoEPS}
        \psset{xunit=1cm,yunit=1cm,runit=1cm}
        \begin{pspicture}(2,2)
            \psset{linewidth=1pt}

            \psframe[fillstyle=gradient, gradbegin=white, gradend=black](2,2)

        \end{pspicture}

    \end{TeXtoEPS}

\end{document}
3
  • The xcolor package provides the package option cmyk. Also related: PDF colour model and LaTeX Commented Oct 2, 2012 at 14:25
  • Does including \selectcolormodel{gray} help?
    – percusse
    Commented Oct 2, 2012 at 17:59
  • I edited your second example to put the \PassOptionsToPackage line in the correct place.
    – Lev Bishop
    Commented Oct 2, 2012 at 21:57

1 Answer 1

14

Drop the \usepackage{color} and load pstricks this way (because pstricks loads xcolor for you already, at the proper moment):

\PassOptionsToPackage{cmyk}{xcolor}
\usepackage{pst-all}
3
  • Works great - with one exception: gradients. a \psframe with gradient from white to black is created with color instead of black - even if I pass ``gray'' as xcolor option. Commented Oct 2, 2012 at 16:19
  • 2
    @PascalTurbo, edit an example showing the gradient problem into the question and maybe someone can help....
    – Lev Bishop
    Commented Oct 2, 2012 at 17:25
  • @LevBisop Hi, excuse me for posting this in here (this would be no proper SX question) but...can i do the same with TikZ (seen PGFManual ctan.mirror.garr.it/mirrors/CTAN/graphics/pgf/base/doc/…, pag. 36, lines -8 and -7)? Can I say \PassOptionsToPackage{cmyk}{xcolor} \usepackage{tikz}? Commented Nov 9, 2014 at 16:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .