I have one git repository that I'm calling my book directory.

Within that I have a tex file that calls a bunch of chapters or sections that are in their own git directories.

My goal is to the get the watermark throughout the book to display the git information for the book repository, while the header of each chapter displays the git metadata for the individual chapter repository.

A slightly simplified version of the book file looks like this.

\documentclass[twoside, openright]{book}
%many more packages here 
%git package 


The watermark here asks for git metadata about the book as a whole.

But the beginning of an input file also asks for a git metadata about the individual chapter.

 \fancyhead[RO]{Librum I, Quaestio 1}
 \fancyhead[LE]{Peter Gracilis}
 \chapter*{Librum I, Quaestio 1}

Here you can see that each chapter has its own git source history. And I'd like the header of that chapter to display the current tag information (i.e. \gitDescribe) unique to the chapter itself.

Nevertheless, I'd like the watermark to continue to display the git tag information for the book as a whole.

Right now, it's almost working. But the information in the header of chapter 1 is actually the git metadata for the book repository and not the information from its own repository.

I'm grateful for any and all suggestions.

1 Answer 1


This is more a git comment, but if your book is one project with interrelated pieces (chapters, whatever), you should handle it as one repository with common history. What you describe made sense with one-file version control, like the venerable rcs(1).

  • hmm, but the nature of the chapters are such that they can also live on their own. There better thought of as articles. The book is like a unique collection of articles. But another books could be made that is a collection of only some of these articles or some of these articles combined with others. Each article as a different author, editor, etc. So I thought it made sense to try to give their own version history, while the book/collection is also a unique text that needs a different history, that is nevertheless affected by the history of the individual articles.
    – Jeff
    Commented Jan 10, 2016 at 1:19
  • 1
    maybe I should think about gitsubmodules, where chapters can be submodules within the book. Then the git commit info of the book will contain an accurate reference to the current state an individual chapter. The git info for an individual chapter will not be needed in the output display because the git info for the book will retain that information.
    – Jeff
    Commented Jan 10, 2016 at 13:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .