Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fit the paper-size to the content in LaTeX

Tags:

I'd like to create a pdf/ps/eps that contains only one single formula. I thought the easiest way would be to use latex. Unfortunately, I found no option to specify, that the paper-size should automatically be set to fit the contents.

I found that dvipng has a "-T tight" option, that actually does the trick, but... I want it in vector-graphics format.

Any suggestions?

Thanks.

like image 635
mefiX Avatar asked Apr 01 '10 15:04

mefiX


People also ask

How do I fit a contents page in LaTeX?

How do you fit text to a page in LaTeX? The paper size can be set to any size you need by means of the command papersize={⟨width⟩,⟨height⟩} . Here the text area, the left margin and the top margin are set. The right and bottom margins are automatically computed to fit the page.

Why are LaTeX margins so big?

They were designed for handwriting (which is usually much bigger) or for typewriters. Typewriters produced 10 or 12 characters per inch: so on (say) 8.5 inch wide paper, with 1 inch margins, you had 6.5 inches of type, giving ... around 65 to 78 characters: in other words something pretty close to ideal.

How do I reduce margins in LaTeX?

Modifying a document's paper size, orientation and margins is a common requirement which can easily be achieved using the geometry package. There are two ways to set the desired values: provide them them as parameters to the \usepackage statement as in the example above, or. use the \geometry command in the preamble.

What is standard margin size for LaTeX?

LaTeX's margins are, by default, 1.5 inches wide on 12pt documents, 1.75 inches wide on 11pt documents, and 1.875 inches wide on 10pt documents. This is the standard for book margins.


2 Answers

With the standalone class, you get exactly what you want.

\documentclass{standalone} \begin{document} \[    x + y = z \] \end{document} 
like image 77
François Legendre Avatar answered Oct 13 '22 20:10

François Legendre


Try pdfcrop, it crops your pdf to the minimum. You need to have Perl installed.

like image 35
Juri Robl Avatar answered Oct 13 '22 18:10

Juri Robl