1
votes

I'm trying to import a very specific section or subsection from another latex document.
I basically have an export tool that creates a nice tex document and makes the sections for the headers. It's nice to call the whole file but at some point in my combined document I have to just call a subsection over and over again.

How do I call a specific subsection from a whole document?

I have a file call aa.tex and I'm able to use \subimport{}{aa} and it brings in the whole file.

In the file it look similar to

\section{Test Descriptions}
\subsection{Setup}
Hardware and Software... CPU, GPU, RAM etc
\subsection{test1}
\subsubsection{Steps1}
a,b,c,
\subsubsection{Steps2}
a,b,c

I want to be able to call \subsection{setup} over and over again because of what I have to reference.

So, logically how do I only call \subsection{Setup} from aa.tex?

1
The simpler is to put the section is a separate file and to \input it from whatever file it is required, including aa.Alain Merigot

1 Answers

1
votes

With the catchfilebetweentags package one can selectivity input parts of a file

Main file:

\documentclass{article}

\usepackage{catchfilebetweentags}

\begin{document}

zzz

\ExecuteMetaData[subdocument]{setup}

zzz

\ExecuteMetaData[subdocument]{setup}

\end{document}

subdocument.tex:

xxx

%<*setup>

\subsection{Setup}

%</setup>

xxx