My particular use case is that I have a long academic CV, and a short résumé. The two of them share a reasonable amount of textual content, but, for example, the order of the content varies, some content is included selectively in one but not the other, etc.
I would like to factor the shared content out. The ways that I can see to do this are:
- Create, e.g.,
PositionName.tex,UniversityName.tex, and\inputthem as desired. This has the disadvantage that it's hard to configure the\input, for example, to include or not the name of your advisor from university. - Create, e.g., one big
SharedCode.tex, which defines macros to render/display/whatever all of the shared portions of the two (or more) documents. Even if I took this route, it's not totally clear to me how to most cleanly set up the "configurability" I describe in the previous point.
I think that if I were working with snippets sized on the order of a book/thesis chapter, the first option would be better. But what about when the snippets are much smaller? Is it somehow bad practice to have a dozen little 10-line .tex files lying around?
Edit:
Very concretely, I have the files mishchea-resume.tex and mishchea-cv.tex here https://github.com/mishchea/cv, and their outputs are at http://www.mishchea.com/mishchea-cv.pdf and http://www.mishchea.com/mishchea-resume.pdf. Much of the tex files is copy-pasted across them, and I would like to factor the copy-pasted portions out.
Edit:
For example, in my résumé, I have something like:
\item \textbf{University of Michigan}, Ann Arbor\hfill 2007--2012
\begin{itemize}
\item Won millions of awards, here's a long list: best haircut, ...
\end{itemize}
And in my CV, I have something like:
\item \textbf{University of Michigan}, Ann Arbor\hfill 2007--2012
\begin{itemize}
\item Won millions of awards, here's a long list: best haircut, ...
\item Advisor: Dr. John Smith
\end{itemize}
datatoolas Ross mentioned is great if you have lots of information which needs to be shared. But if it isn't too much, you could set up some commands, like\newcommand{\uniMich}{University of Michigan} \newcommand{\Arbor}{Ann Arbor} \newcommand{\ArborAwards}{Won a ton of awards, here's a long list\ldots}which you would have in a inputted.tex-file. You could also define some commands, which strips a name to only the last name, abbriviates. – Runar Jul 06 '16 at 05:38\Save{award}{award text}to save the data and then, to retrieve it, you would write something like\Use{cv}{award},\Use{resume}{award}and\Use{cv,resume}{award}. Somewhere at the top of the file you would set the "mode" to "cv" or "resume" (or both). I wrote something similar for this question. If you're interested I can give more details. – Jul 06 '16 at 13:52expl3syntax, basically, which is available for use with LaTeX 2e as part of the ongoing development of LaTeX 3. – cfr Jul 06 '16 at 16:03