I am writing my PhD thesis and as I am not the least chaotic guy I also add notes for future reference. Surely, this means it is not production grade, or how you would like to call it.

There is a nice package called versions which takes care of the versions. We also have the helpful answers in Using latexdiff with git to use git. My goal now is to have something similar to versions but that the content is removed when for example it is in between \advisorcannotsee and \allokay and this would be checked out in the advisorbranch. Preferably, only the main version should be compiled (or the one marked as to be compiled).

Would such a thing already exist, or are there better solutions for this problem?

Per request:

Example workflow:

  1. I have a git repository working on the working directory of my thesis which includes all my remarks using \input or whatever.
  2. I have several branches other than the main branch, say paper1 and advisor which contains the same as the main branch (which contains it all) but then pieces cut out.
  3. I modify my document and I add things which are for my eyes only (main) and some which are for my advisor. I would like to use something like the versions package to mark parts which belong to where.
  4. When done editing I commit my changes. As my modification has parts which belong to a different branch I would like to have that the version which is okay for the advisor gets "built" (pieces cut out) and commited to advisor and the whole thing to main.
  • 1
    I don't quite understand what you are asking. Could you perhaps elaborate on how you see this workflow working so that we can see more clearly what you mean? – Seamus Oct 8 '12 at 16:25
  • Thanks. I have added a possible workflow! I hope it makes more sense now. – Jonas Teuwen Oct 8 '12 at 16:49
  • 2
    Experience suggests that mixing version control (with git) and edition control (with versions, todonotes, and suchlike) can lead one into considerable difficulties (if for exxample you try to control editions through the git branch mechanism). I'm sorry; I'm away from home and my workbench, so I can't write you a fuller answer this week, but I'll have a go at it when I get back. There are good, and simpler (IMO) solutions. – Brent.Longborough Oct 8 '12 at 17:05
  • @Brent.Longborough I am looking forward to it :-). – Jonas Teuwen Oct 8 '12 at 17:08
  • 1
    The idea is that I only modify the main file and the generated files do not have the goal to be merged (otherwise I could use latexdiff if I really wanted to), but more to send to people so they can start working on it. More like a fork. Most mathematicians do not use git. – Jonas Teuwen Oct 9 '12 at 14:29

To begin, a couple of definitions:

Revision: One particular state of the files in a project, positioned along one or more lines of history

Edition: One particular variation which has a purpose in being different from other variations

(Notice that I have avided using the word "version"; it's too ambiguous, and will only occur here, if at all, in talking about "version control systems".)

I believe, strongly, that using different Revisions (probably on different branches of a VCS) is not a good way to manage Editions. Personal, embarrassing experience suggests that when branches are created that are not meant ever to merge back together, changes on one branch can get forgotten, or included by mistake, when a change needs to be incorporated in multiple editions.

A far better method is to create a configurable master file, and to include it from a series of top-level files, one for each Edition that is required.

Here is an example with three Editions. It is a very simple exam paper which includes questions, answers, and notes, and uses Viktor Eijkhout's comment package and Hendrik Mittby's todonotes package. You may find other packages more useful for your particular case.

To keep it simple, I haven't used any exam- or Q&A-related packages, just Enrico Gregorio's kantlipsum to pad it out a bit. Please bear in mind that this isn't meant to be an example of "Great Typography", just an illustration of general principles for making polymorphic editions.

The three editions are:

  1. The student edition: questions only
  2. The examiner edition: questions and guidelines for answers
  3. The supervisor edition: questions, guidelines for answers, and my notes to discuss the development of the exam with my supervisor.

The example consists of five TeX files:


\documentclass[disable]{memoir} % [disable] is passed to todonotes









Compare and contrast Aristotle's view with that of Kant, expressed in the following quotation:


\mynote{Should that be Aristotle, or would Plato be more demanding?}

\textbf{Answer Notes:}
bear this in mind: \kant[2]
| improve this answer | |
  • 1
    Thank you! This is helpful. Also thanks for not forgetting it :-). – Jonas Teuwen Oct 17 '12 at 16:09
  • @JonasTeuwen : Glad to be of help. I came home from my travels with much more work than I set out with, but I managed to find half-an-hour to knock that together. – Brent.Longborough Oct 17 '12 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.