I am writing a report and want to include another TEX file in it, which I update separately. I use the input command
\documentclass[11pt,a4paper]{report}
\usepackage{amsmath,amssymb}
\usepackage{pdfpages}
\usepackage{float}
\begin{document}
...
\input{extra.tex}
...
\end{document}
In this extra.tex file I need only a certain part of the document, the body of the document between BEGIN and END or a certain section. In particular, I don't need to include the file's header.
\documentclass[11pt,a4paper]{report}
% header
\usepackage{amsmath,amssymb}
\usepackage{pdfpages}
\usepackage{float}
\begin{document}
...
% include only
I want to include only this, $E = mc^2$.
% end include
...
I don't want to include this.
...
\end{document}
How do I include only a certain part of this extra.tex file in the main report report.tex?
extra.tex
has a header you don't want to include?clipboard
package to include [graphs] (tex.stackexchange.com/a/378703/11604) or footnotes of another document but it should work equally with any other chunk of text without problem (but taking care of do not break environments, maintain definitions and so on). That solve the question?