Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Edit: Duplicate-clickers, please read on - I believe this case is different, for the following reasons:

a) As I said in original post, I am not printing with Acrobat, but using Skim and Mac OSX preview. In fact, Acrobat prints the colors correctly!

b) If it were the said problem, then the suggested solution by Martin Heller (pdf page attributes / transparency) should cure it. But it does not.

c) I did further tests, because I found that OpenOffice also uses cairo (the PDF engine used by Inkscape). So, to really rule out Inkscape/cairo, I created the included PDF file from printing a HTML file into pdf (on OSX), that included both a single-colored png image and a plain colored area (style="background:#67b737"). I additionally included the png directly in LaTeX (includegraphics), besides the pdf.

Result:
1) The plain HTML color prints correctly and matches the LaTeX color.
2) The png in the included pdf file prints in the wrong color (too light).
3) Also the directly included png prints in the wrong color!!
4) As before, Acrobat Reader prints the colors correctly.

From 3) I conclude that it is not specifically a problem of including PDFs.

I found the long answer in PDF color model and LaTeX very informative, and I tried the pdfx package to create a PDF/A (a-1b), but it did not seem to help in my case, or maybe I missed something...

My test pages are piling up, and I am still clueless.
Any ideas?

I have a feeling that maybe things behave differently on Mac OSX, because color management seems to be implemented differently. But does this explain my findings? Still, printing my PDF on a Linux PC (using okular) produces the same color mismatch.


Possible Duplicate:
\includegraphics PDF, color problem

I use Inkscape to design a cover page (rgb colors), and save the file as pdf.
In LaTeX (pdflatex), I include the pdf using the wallpaper package, and write some title text on that same page (reason: title should be editable in LaTeX code without using inkscape, and wallpaper because I need the title running across the graphics, not below it).
For the title text in LaTeX, I use exactly the same rgb color as for my graphics in inkscape.

On screen, all looks ok (using Skim or Mac OSX Preview).
When I print the PDF, the title text has a clearly different color than the graphics from inkscape!

The resulting pdf is here

Printout: Photo of printout - the text should be same color as the rectangle

Minimal working example:

\documentclass[11pt]{amsart}
\usepackage{wallpaper}
\usepackage{graphicx}

\definecolor{mygreen}{rgb}{0.404, 0.718, 0.216} %% equivalent to 103,183,55
% \pdfpageattr {/Group << /S /Transparency /I true /CS /DeviceRGB>>} (Martin Heller) does not solve the problem
\begin{document}
\ThisULCornerWallPaper{1}{Colortest-OO}
\textbf{\Huge{\color{mygreen}LaTeX - 103,183,55}}\\
\textbf{\Huge{\color{mygreen}LaTeX - 103,183,55}}
\end{document}  

I believe it is not this and not directly this problem.

A funny thing is: When I take the output pdf (from LaTeX) and include it in a second LaTeX file (again with wallpaper or with includegraphics), the final pdf has matching colors.
How weird is that!?

To summarize my problem:
I dont need exact color reproduction.
But I want my PDF document to have consistent colors for the same rgb values.

What I tried so far:

  1. Fiddle with CMYK and color profiles in Inkscape. I came to the conclusion that it should not matter as long as I stay with plain RGB in both InkScape and LaTeX.
  2. Fiddle with color model in the PDF by converting color space with Acobat Pro before including it in LaTeX... a lot of possibilities, no clear success.
  3. Rule out Inkscape. I created a PDF with NeoOffice (OpenOffice) and included it in LaTeX. Problem remains.
  4. I tried specifying the rgb option in \usepackage[rgb]{xcolor}. No difference.
  5. Updated my MacTeX to 2012. No difference.

Any ideas what is going on here?
It would be greatly appreciated.

share|improve this question

marked as duplicate by Martin Schröder, Kurt, Andrew Swann, Paul Gaborit, Thorsten Oct 29 '12 at 6:38

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
You don't have to sign with your name since it automatically appears in the lower right corner of your post. –  Kurt Oct 28 '12 at 15:16
    
Thanks, Kurt - I will try to avoid such redundancy in the future :-) –  Philippp Oct 28 '12 at 16:51
1  
@Philippp: It's probably better to post a question to TeX - LaTeX Meta about the reopening of your question, you'll have a better chance of people seeing it there. –  doncherry Oct 31 '12 at 23:16
    
@doncherry, Thank you very much! I will do so, when I deal with the problem again (currently, I just dont have the time, and I think it would be inappropriate to ask for help when I dont have the time to go and try the suggested solutions). –  Philippp Jan 6 '13 at 12:46

2 Answers 2

The exact values found in the PDF file are:

\definecolor{mygreen}{rgb}{0.40392,0.71764,0.21568}

Found by

pdftk test.pdf cat output t.pdf uncompress

and looking for the operator rg or RG with three numbers as arguments in front of the operator.

Perhaps it helps a little.

share|improve this answer
    
Thanks Heiko! We looked into the PDF, and found that the numbers are slightly different, so we thought it could be a rounding problem between 8-bit integer in Inkscape vs. decimal rgb in LaTeX, and replaced the values in a crafted PS file - problem remains. In fact it is very weird - see my next edit... –  Philippp Oct 31 '12 at 21:21

I had the same problem when I exported Inkscape graphics to .png. You have to avoid transparency.

share|improve this answer
    
Well, good to know, but does not mean "3. Rule out Inkscape. I created a PDF with NeoOffice (OpenOffice) and included it in LaTeX. Problem remains." that the problem is not caused by Inkscape? –  Stephen Oct 28 '12 at 16:15
    
Thanks - Yes, exactly. The same thing happens with OpenOffice instead of Inkscape. And, my text is 100% opaque, so I would not expect transparency to be an issue... –  Philippp Oct 28 '12 at 16:45
    
Jonas: I remember having that effect, too. I found it helps to just add a white, 100% opaque rectangle in Inkscape to give the png a solid background (or, I believe there is an option somewhere). But this case is different (I just verified it to be sure). –  Philippp Oct 28 '12 at 17:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.