I am working with multiple LaTeX projects at any given point in time, each of which is stored in a separate git repository. I have also accumulated a set of commands and environments which I am familiar with which help me to save time when writing LaTeX code. My question is how to merge the style file contained in each git repository into a single style file that can be shared across git repositories.
Currently, in each git repository I have a single style file which I put in a localtexmf tree inside the git repository. The file tree hierarchy might look like the following:
project-a/doc1/main.tex project-a/doc2/main.tex project-a/localtexmf/tex/latex/mymacros/mymacros.sty
This approach has the following advantanges:
- All the documents in the git repository can share the same style file.
- The style file is also under version control.
The disadvantage of this approach is that I have multiple style files which share a lot of similar code, e.g.
project-a/localtexmf/tex/latex/mymacros/mymacros.sty project-b/localtexmf/tex/latex/mymacros/mymacros.sty project-c/localtexmf/tex/latex/mymacros/mymacros.sty
This results in unnecessary code duplication.
Often when I fix a bug or change a command definition,
I want the change to occur in all the
What I want to do is to somehow have a single style file that is under version control, but is shared by multiple git repositories. How do I do this?
My operating system of choice is Ubuntu Linux or OS X.
Based on How do you perform version control on TeX-related files that are used in multiple projects?,
I suspect that
git submodule is part of the answer.