Page LayoutPage setup with no margins

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
haaj86
Posts: 21
Joined: Mon Apr 06, 2009 11:18 pm

Page setup with no margins

Post by haaj86 »

Hi, is there an automatic way (a package perhaps) to set up the page size exactly to the content of the pdf with no margins, header or footer (or page number). For example, I need a single equation line to appear in the pdf without any white margins surrounding it, and I need to create such equations repeatedly. So, is there a way to define something in the preamble such that whatever I type between \begin{document} and \end{document} will appear by itself without any margins.

Reason (in case you are interested or might have other suggestions):
I’m creating a poster with illustrator and using latex to produce the equations and figures. After creating the pdf (from latex) I just drop it into illustrator and it will be automatically treated as a vector image (as expected). But, it is not possible to crop the vector images in illustrator which means that all the white spaces created by latex in the pdf will be hard to remove, and hence, I would have to set the page size to that exactly that of the equation/figure for each equation/figure, which is time consuming and frustrating.


Thanks very much!
Last edited by haaj86 on Tue Aug 03, 2010 10:38 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Page setup with no margins

Post by Stefan Kottwitz »

You could use the pdfcrop tool. It can remove all white margins automatically.

Stefan
LaTeX.org admin
haaj86
Posts: 21
Joined: Mon Apr 06, 2009 11:18 pm

Page setup with no margins

Post by haaj86 »

Thanks Stefan, I installed the pdfcrop package using the package manager, but I get an error when I compile the code.

Can you please suggest how to use it exactly? is this valid:

Code: Select all

\documentclass{article}
\usepackage{pdfcrop}
\begin{document}
Testing
\end{document}
I appreciate it a lot.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Page setup with no margins

Post by Stefan Kottwitz »

Use it at the command prompt (Windows-key + R or Start/Run: cmd)

Code: Select all

pdfcrop filename.pdf
Stefan
LaTeX.org admin
haaj86
Posts: 21
Joined: Mon Apr 06, 2009 11:18 pm

Re: Page setup with no margins

Post by haaj86 »

Thanks! I installed Perl and run the command line as you have suggested and it worked perfectly.
Post Reply