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:
- The student edition: questions only
- The examiner edition: questions and guidelines for answers
- 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:
Student.tex:
\documentclass[disable]{memoir} % [disable] is passed to todonotes
\input{preamble}
\excludecomment{answers}
\input{master}
Examiner.tex:
\documentclass[disable]{memoir}
\input{preamble}
\includecomment{answers}
\input{master}
Supervisor.tex:
\documentclass{memoir}
\input{preamble}
\includecomment{answers}
\input{master}
preamble.tex:
\usepackage{kantlipsum}
\usepackage{comment}
\usepackage{todonotes}
\newcommand{\mynote}[1]{\todo[inline]{#1}}
master.tex:
\begin{document}
\section{Philosophy}
Compare and contrast Aristotle's view with that of Kant, expressed in the following quotation:
\begin{quote}
\kant[2]
\end{quote}
\mynote{Should that be Aristotle, or would Plato be more demanding?}
\begin{answers}
\textbf{Answer Notes:}
bear this in mind: \kant[2]
\end{answers}
\listoftodos
\end{document}
You should not use version control for generated files, period.
git
can store binary (non text) files, but it is quite bad at it. And asking for e.g. differences between binary files will just give gibberish, unless you go the extra mile to write a specialized "show differences in humanly understandable format". And without such, the whole point of having files under version control is moot. Or almost.
I.e., my lecture notes in LaTeX are under git
's control. If I want to see differences between versions, they are apparent in the sources, not in the PDFs.
Best Answer
The main assumption is that
abc.pdf
is being tracked bygit
.Here is a list of command line steps, that keeps the release number up to date (this assumes that
abc.pdf
has been committed at some point previously)(start with clean repo, make changes to abc.tex and compile)
Here is the file I have used for
abc.tex
One reason your release tag might not be as you intend could be because it isn't being picked up by
files. If your tag starts with anything other than a number, then you need to change the
--match
part accordingly. For example, if your tag starts with aV
, as inV3.2.2
, then you might use