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 am trying to create square images with a fixed size in pixels in LaTeX to be used as buttons. So far, I got the best results using the slides document class in combination with the geometry package, run pdflatex, and then process the resulting PDF using the convert command.

I currently use this as input (I added showcrop to make sure I got the page dimensions right):

\documentclass[preview,border=0.5mm]{slides}
\usepackage[vcentering,dvips]{geometry}
\geometry{papersize={1in,1in},total={1in,1in},showcrop}
\usepackage{amsmath}
\begin{document}
\begin{center}
\tan^{-1}
\end{center}
\end{document}

This mostly works, but I want the resulting PDF to just include the region I have defined in the geometry command. Currently, a big page is output and processing is very slow when compared to using the standalone package (which has its own issues, see below).

I have tried the preview package, but then top and bottom are cropped.

I also have tried to use the standalone class instead, but then the output is cropped on all sides and for each text used as input I get different sizes. Besides that, slides provides the font I want to use.

Is there a way to have pdflatex output just the region defined with the geometry command (after removing the showcrop option)?

share|improve this question
2  
Remove the dvips option in geometry if you want to use pdflatex. –  Ulrike Fischer Feb 2 at 10:39
    
It was as simple as that. Thank you, you saved my day! If you make that an answer, I will accept it. –  Axel Feb 2 at 10:43
    
What exactly are you doing? LaTeX isn't the best tool to create icons, perhaps a graphics editor (using LaTeX fonts?) is a better fit. –  vonbrand Feb 2 at 13:33
    
Now it already works perfectly. I just don't want to use an editor to create 60 icons for 5 different solutions, so I wrote a script to do it. –  Axel Feb 2 at 13:42
add comment

1 Answer

up vote 4 down vote accepted

Remove the dvips option in geometry if you want to use pdflatex.

share|improve this answer
add comment

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.