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.

I'm creating PNGs directly from LaTeX using the xelatex, the standalone document class and the convert option of standalone. I have ImageMagick installed, and it all works fine. The only issue is that the PNGs it's creating have a transparent background instead of the default white.

\documentclass[multi={minipage}, border=5, convert={true}]{standalone}

\usepackage{standalone}
\standaloneconfig{convert={convertexe={convert}}}
\pagestyle{empty}
\begin{document}
\begin{minipage}{500bp}
Some text
\end{minipage}
\end{document}

I'm using the empty pagestyle to make sure that there is no whitespace at the bottom of the pages. Does anyone know what could be causing the PNGs to be transparent? What is the syntax to manually set the background color?

share|improve this question
1  
I think your minipage is missing an argument. But it is odd: with pdftoppm -png <file>.pdf outfile.png, the background is not transparent! One temporary workaround might be to use \usepackage{xcolor} and \pagecolor{white}. But I realize that is not a good solution. –  jon Mar 26 '13 at 15:34
    
Edited code to include the missing argument. Even using xcolor and setting the pagecolor manually, I'm still getting a transparent background. –  ekrah Mar 26 '13 at 15:43
    
Well, I tried changing the color to orange, just to experiment, and that worked fine. It's only when the pagecolor is white that I have the transparency issue. –  ekrah Mar 26 '13 at 15:55
    
Really? It comes through as white (or orange) for me if I use \pagecolor and \xcolor, and compiling with pdflatex -shell-escape. How are you compiling? –  jon Mar 26 '13 at 20:00
    
Ah I should've mentioned, I'm using xelatex since I need to use the fontspec package. –  ekrah Mar 26 '13 at 20:42

1 Answer 1

I hope someone can give a real solution, but 'white' seems to be a problem with XeTeX; I don't see the problem with LuaTeX. You can do 'almost-white', however:

\documentclass[multi={minipage}, border=5, convert={true}]{standalone}                
\usepackage{standalone}  
\standaloneconfig{convert={convertexe={convert}}}  
\pagestyle{empty}  
\usepackage{fontspec} 
\usepackage{xcolor}  
\begin{document}%\pagecolor{white}     
\begin{minipage}{500bp}  
% \pagecolor[HTML]{FFFFFE}%   white = FFFFFF
\pagecolor[RGB]{255,255,254}% white = 255,255,255 
Some text  
\end{minipage}    
\end{document}

It looks like 'white' is a problem for XeTeX; see @egreg's answer here.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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