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}
Lev Bishop
  • 45,462

1 Answers1

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}
Lev Bishop
  • 45,462
  • 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. – PascalTurbo Oct 02 '12 at 16:19
  • 2
    @PascalTurbo, edit an example showing the gradient problem into the question and maybe someone can help.... – Lev Bishop Oct 02 '12 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 http://ctan.mirror.garr.it/mirrors/CTAN/graphics/pgf/base/doc/pgfmanual.pdf, pag. 36, lines -8 and -7)? Can I say \PassOptionsToPackage{cmyk}{xcolor} \usepackage{tikz}? – MattAllegro Nov 09 '14 at 16:55