I'm writing some kind of a notebook using LaTex. I'd like to have basically one page for each note, the page being fitted to the text of the note. For the moment I'm using a very long page by default, generate the pdfs using pdflatex, and then crop them using pdfcrop, and finally merge them using gs. Everything runs fine, but the links inside the cropped pdfs are broken.

Can I generate fitted pdf directly from pdflatex? Otherwise, can I crop the pdfs and preserve the links? Thanks!


Next code was taken from this answer and slightly modified adding multi=task, border=2mm options.

It uses standalone class as cropping tool and tcolorbox to produce notes (task in this case).


\usepackage[theorems]{tcolorbox}% version 2.51 (2013/09/16)

\newtcbtheorem{task}{\strut Task}{fonttitle=\bfseries}{tk}


\begin{task}[width=3in]{Important homework}{major}



This code produces a pdf file with to pages like:

enter image description here enter image description here

  • Thanks! One issue however is that my notes are not LaTeX environments like the newtcbtheorem in your example. So apparently standalone doesn't seem to understand that it needs to crop the file. Do you see any solution? Thanks again. – Martin Jan 29 '15 at 10:31
  • @Martin Please read page 9 from standalone documentation. You need to fix some environment to be cropped. But it can be something like \newenvironment{note}{}{}. If you could post some example with your notes ... – Ignasi Jan 29 '15 at 11:29
  • Thanks Ignasi. Finally I created an environment for my notes, now it works just perfectly. Thanks again! – Martin Jan 30 '15 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.