1

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 \input them 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}
  • I don't know for other but i didn't get the whole idea, maybe summarazing what are you trying to achieve in a short example of different source files would help to understand better. – Cfun Jul 05 '16 at 20:05
  • I've added an edit that links to the actual files I'm working with. – Andrey Mishchenko Jul 05 '16 at 20:20
  • You might look at \newif, @ifundefined, the ifthen package and \pgfkeys from (tikz or pgfkeyx). – John Kormylo Jul 05 '16 at 21:03
  • Make an example small enough to include here. Most people won't bother to follow links and links die, so your question will be easily deprecated and answers of little use to others. People don't want, in any case, to figure out the problem from your entire project. They want to see the problem immediately from the code in the question. – cfr Jul 06 '16 at 00:38
  • I use L3 to set up template-type things. I then configure defaults in a file. Some of this is also conditional, depending on an option passed to the class. I can't really tell if this is the kind of thing you are trying to do or not. It works nicely if it is what you need, though. That is, it works nicely for me. (And I'm sharing it between way more than 2 documents.) – cfr Jul 06 '16 at 00:40
  • @cfr alright, I edited in a simple example. – Andrey Mishchenko Jul 06 '16 at 01:14
  • Some of the functionality of the 'datatool' package could help you. It includes the ability to do mail-merge type operations from external databases of content. – Ross Jul 06 '16 at 02:00
  • datatool as 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
  • @cfr What is L3? –  Jul 06 '16 at 13:45
  • You use key-value pairs, for example pgfkeys, to define a pairs of macros that you would use as \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:52
  • The expl3 syntax, 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

0 Answers0