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}
Best Answer
This can best be done using a Markdown-to-LaTeX-Compiler and a Makefile to build the project. Here's an example rundown of how you could proceed:
Create a Makefile or equivalent (Batch file, script, ...) with the following content, repeating the first line for every project readme you wish to include:
Add
\include{/path/to/GitHub/project/readme}
statements in your LaTeX document where applicable.Alternatively, you could follow this answer and use pandoc in LaTeX on-the-fly. I consider this a less elegant solution, but nonetheless here's a quick rundown on how you would use this to accomplish what you want:
To embed Markdown files, embed them in your document like this: