TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For example there is a simple tex-file with following text:

\draw (0,0) circle (0.4cm);

Is it possible to modifiy it so: if I \include it another TeX file it is compiled as a picture in a document, while if it is compiled alone (say:pdflatex myfile.tex) it results in a standalone pdf file as the unmodified file?

share|improve this question
The standalone package (not class) in the main file should help. – egreg Feb 12 '13 at 22:09
Does stackoverflow.com/a/2703707 answer the question? – e-birk Feb 12 '13 at 22:17
You won't be using \include, but \input: the former always adds a page break. – egreg Feb 12 '13 at 23:42
The standalone package is just what I needed! Thanks :) – Iohann Feb 13 '13 at 9:45
up vote 4 down vote accepted

Working example tex-file using standalone package (based on answer by egreg):

master.tex file:

\caption{That's it!}

Where myfile.tex contains text from the initial question.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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