Hi,
How can I fix the page size of the PDF to fit the text, i.e no margins at all? I am wondering if there is a command or a page options that does it automatically.
Ultimately I want to create only a line of text or symbols and use the pdfs as vector images, so I don't want any white margines/space surrounding the text.
Thank you!
Page Layout ⇒ PDF Page Size fits Text
PDF Page Size fits Text
Last edited by MrH86A on Tue Nov 08, 2011 5:59 pm, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
PDF Page Size fits Text
User either the preview package or the standalone class (which in turn uses the mentioned package).
Best regards and welcome to the board
Thorsten
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
PDF Page Size fits Text
Thank you for your very fast reply! I still couldn't figure it out. The preview package seems to do nothing. If we consider a simple example:
Can you please tell me how to modify this code to produce a pdf with no white space or magines surrounding the work "test"?
Thanks in advance!
Code: Select all
Code, edit and compile here:
\documentclass{article}\usepackage[<active>]{preview}\begin{document}test\end{document}
Thanks in advance!
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
PDF Page Size fits Text
For a standard class you have to specify the content for the preview.
For details refer to the preview manual.
The standalone class makes this easier.
Code: Select all
Code, edit and compile here:
\documentclass{article}\usepackage[active,tightpage]{preview}\begin{document}\begin{preview}Test\end{preview}\end{document}
The standalone class makes this easier.
Code: Select all
Code, edit and compile here:
\documentclass{standalone}\begin{document}Test\end{document}
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: PDF Page Size fits Text
Thank you Sir! This is exactly what I was looking for.
I spent the entire day looking for an easy solution to crop the pdf with at third party software with no luck. you have saved me time and money
. Thank you!
I spent the entire day looking for an easy solution to crop the pdf with at third party software with no luck. you have saved me time and money
