General ⇒ Use User Macros From File1, In File2
-
- Posts: 27
- Joined: Thu Feb 07, 2019 4:25 pm
Use User Macros From File1, In File2
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
-
- Posts: 27
- Joined: Thu Feb 07, 2019 4:25 pm
Use User Macros From File1, In File2
Clipboard is a simple elegant solution.