LaTeX forum ⇒ GeneralUse User Macros From File1, In File2

LaTeX specific issues not fitting into one of the other forums of this category.
kurttodoroff
Posts: 2
Joined: Thu Feb 07, 2019 4:25 pm

Use User Macros From File1, In File2

Postby kurttodoroff » Thu Feb 07, 2019 5:23 pm

Business-Plan.tex (File1.tex) is a proper LaTeX file that contains all of the necessary elements to properly compile it.

File1.tex contains of the following:

\chapter{ABC}

\section{aaa}

\newcommand{\aaa}{text text text text}
\aaa

\section{bbb}

\newcommand{\bbb}{text text text text}
\bbb

\section{ccc}

\newcommand{\ccc}{text text text text}
\ccc

\chapter{BBB}

more sections and narrative

\chapter{CCC}

more sections and narrative



Business-Plan-Executive-Summary.tex (File2.tex) is the executive summary subset of the Business Plan. It consists of a modified version of the business plan. It contains the cover page with the additional words "Executive Summary", and all of chapter one, only. It does not contain the table of contents, list of figures, list of tables, nor index. The chapter, sections, and subsections are absent of enumeration.

This was easy to accomplish. I made a copy of the File1.tex file. I removed the nonessential information and commands. I added the two words to the cover page. I changed \chapter to \chapter* and \section to \section*.

From time to time, I will update the business plan. This will necessitate transferring the updates into the executive summary. I am looking for a method to automate my work. I don’t want to place these \newcommands in a separate file, and, add \include or \input commands in File1.tex and File2.tex. This will slow the editing process. I want to use the File1.tex commands \aaa, \bbb, and \ccc as in File2.tex. Is there a method to do something like:

\chapter*{ABC}

\section*{aaa}

\ref{File1.tex/\aaa} or \input{File1.tex/\aaa}

\section*{bbb}

\ref{File1.tex/\bbb} or \input{File1.tex/\bbb}

\section*{ccc}

\ref{File1.tex/\ccc} or \input{File1.tex/\ccc}


While I have not used the \ref{} and \input{} commands properly, my example conveys my desire.

Thank you.

Kurt Todoroff

kurttodoroff
Posts: 2
Joined: Thu Feb 07, 2019 4:25 pm

Postby kurttodoroff » Thu Feb 07, 2019 7:03 pm

I stumbled over the Clipboard package, without looking for it.

Clipboard is a simple elegant solution.


Return to “General”

Who is online

Users browsing this forum: No registered users and 12 guests