1

I have a .tex file that produces a pdf of one page. This pdf contains some information that doesn't fill the full page and leave a big white space.

Is there any code / command / environment that modifies the resulting pdf (or produces an image) so that it deletes the white space.

This is an example of my .tex file:

\documentclass[a4paper]{article}
\usepackage[left=2cm , right = 2cm, top=2cm]{geometry}
\usepackage{tcolorbox}
\begin{document}

\begin{tcolorbox}[colback=white, title=Bla]
    Bla Ble
\end{tcolorbox}

\section{Tiz}
Aw
\end{document}
5
  • the standalone class wil make a pdf sized to closely fit the content, or several pdf tools can crop a pdf pdfcrop for example, most are wrappers aroud ghostscript Jun 19, 2021 at 18:30
  • Thanks for that. Could you provide an example using standalone class? .
    – user232560
    Jun 19, 2021 at 18:33
  • look for \documentclass{standalone} here tex.stackexchange.com/questions/tagged/standalone Jun 19, 2021 at 18:35
  • 1
    but \documentclass{standalone}\begin{document}hello\end{document} is a complete example Jun 19, 2021 at 18:37
  • I add a .tex example, could you show me how implement the standalone class ?
    – user232560
    Jun 19, 2021 at 18:52

1 Answer 1

0

enter image description here

\documentclass[varwidth]{standalone}

\usepackage{tcolorbox}
\begin{document}

\begin{tcolorbox}[colback=white, title=Bla]
    Bla Ble
\end{tcolorbox}

\section{Tiz}
Aw
\end{document}

This crops very closely, the class has several options to add padding or other things to control the output.

3
  • Hey, If You Could Show Me (I don't Know) how change border / margin of Output ?
    – user232560
    Jun 19, 2021 at 19:26
  • there is a manual texdoc standalone there are lots of optiions, but try \documentclass[varwidth,border=1cm]{standalone} @user232560 Jun 19, 2021 at 19:29
  • Thanks for your help.
    – user232560
    Jun 19, 2021 at 19:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .