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

Is there a way to insert a document within a document? The inserted code is fully .tex compliant and could be compiled as a document on its own.

I envision an article document, where inside the document, I show multiple beamer documents. The purpose of this is to demonstrate various beamer features and how they affect the final beamer presentation.

I would guess the code would look something like this,

\usepackage{latexinsert} % hypothetical package


\begin[frame = single]{insert_environment} % hypothetical environment name
%frame around the inserted document compiled from LaTeX code

Hello, world!
a^2 + b^2 = c^2



Thanks for your assistance.

share|improve this question
Maybe look at the source code for the beamer manual for an implementation? – Matthew Leingang Sep 24 '12 at 0:10
Look at the package docmute. It will allow you to have individually compilable tex documents which can be either inputed or includeded into your main document. – R. Schumacher Sep 24 '12 at 0:17
up vote 11 down vote accepted

This sounds like a job for the standalone bundle. Note that I use the word 'bundle' because standalone represents both a documentclass and a package!

Let's say that you have a file framefile.tex that has the following code



Hello, world!
    a^2 + b^2 = c^2

This file can be compiled on its own. Note that this file uses standalone as documentclass.

Now let's create your mainfile.tex which can input your framefile.tex





Note that this file uses standalone as a package.

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.