Update: Version Control for Latex files

Github can be used to version control your tex files, which is handy if you are working on a large writing project, e.g. a dissertation. Here is a quick tutorial on how to include a footnote in your compiled tex files that tells you the git commit ID and the commit date. See also my first post here.

Install the gitinfo package for Latex. Next, initialize a new git repository, e.g. via the terminal and cd into the hooks folder.


git init
cd ./.git/hooks

Now, replace the files with these hooks (zip). I built them according to gitinfo package (documentation. Next, include this header into your Latex file:


\usepackage{gitinfo}
\title{Selection, Aggregation and Missing data}
\author{sumtxt\footnote{Last commit: \gitCommitterIsoDate\ Git-Hash: \gitAbbrevHash. Please do not distribute without the permission of the author.}}

and compile the tex files. The footnote (should) now read: “Last commit: 2013-01-03 22:09:06 +0100 Git-Hash: 4b23635. Please do not distribute without the permission of the author.”

Update (6/19/13): Some other useful advices here.

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s