| 1 |
\documentclass[pagesize=auto, fontsize=12pt, DIV=10]{scrartcl} |
| 2 |
|
| 3 |
\usepackage{fixltx2e} |
| 4 |
\usepackage{etex} |
| 5 |
\usepackage{xspace} |
| 6 |
\usepackage{lmodern} |
| 7 |
\usepackage[T1]{fontenc} |
| 8 |
\usepackage{textcomp} |
| 9 |
\usepackage[svgnames]{xcolor} |
| 10 |
\usepackage{listings} |
| 11 |
\usepackage{microtype} |
| 12 |
\usepackage{hyperref} |
| 13 |
|
| 14 |
\newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}} |
| 15 |
\newcommand*{\pkg}[1]{\textsf{#1}} |
| 16 |
\newcommand*{\cs}[1]{\texttt{\textbackslash#1}} |
| 17 |
\makeatletter |
| 18 |
\newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}} |
| 19 |
\makeatother |
| 20 |
\newcommand*{\env}[1]{\texttt{#1}} |
| 21 |
\newcommand*{\meta}[1]{\textlangle\textsl{#1}\textrangle} |
| 22 |
\newcommand*{\marg}[1]{\texttt{\{}\meta{#1}\texttt{\}}} |
| 23 |
\newcommand*{\oarg}[1]{\texttt{[}\meta{#1}\texttt{]}} |
| 24 |
|
| 25 |
\addtokomafont{title}{\rmfamily} |
| 26 |
|
| 27 |
\lstset{% |
| 28 |
language=[LaTeX]TeX,% |
| 29 |
columns=flexible,% |
| 30 |
upquote=true,% |
| 31 |
numbers=left,% |
| 32 |
basicstyle=\ttfamily,% |
| 33 |
keywordstyle=\color{Navy},% |
| 34 |
commentstyle=\color{DimGray},% |
| 35 |
stringstyle=\color{SeaGreen},% |
| 36 |
numberstyle=\scriptsize\color{SlateGray}% |
| 37 |
} |
| 38 |
|
| 39 |
\title{The \pkg{version} package\thanks{This manual corresponds to \pkg{version.sty}~v2.0, dated~2009/09/15.}} |
| 40 |
\author{Donald Arseneau\thanks{\mail{[email protected]}}\and Stephen Bellantoni} |
| 41 |
\date{2009/09/15} |
| 42 |
|
| 43 |
|
| 44 |
\begin{document} |
| 45 |
|
| 46 |
\maketitle |
| 47 |
|
| 48 |
\noindent |
| 49 |
Version control macros. This package lets you define environments whose |
| 50 |
contents will be optionally included in or excluded from the text when |
| 51 |
you run \LaTeX. |
| 52 |
|
| 53 |
Maybe you should be using one of \pkg{versions.sty}, \pkg{comment.sty}, or \pkg{optional.sty}. |
| 54 |
|
| 55 |
|
| 56 |
\section{Usage:} |
| 57 |
|
| 58 |
\begin{description} |
| 59 |
\item[\cmd{\includeversion}\marg{name}] \leavevmode \\ |
| 60 |
After this declaration, contents of the environment \meta{name}, that is, |
| 61 |
text between \cmd{\begin}\marg{name} and \cmd{\end}\marg{name}, will be processed in the |
| 62 |
normal way. If an environment called \meta{name} is already defined, that |
| 63 |
definition is retained; if no such environment exists a simple |
| 64 |
definition is provided. |
| 65 |
|
| 66 |
\item[\cmd{\excludeversion}\marg{name}] \leavevmode \\ |
| 67 |
This indicates that text between \cmd{\begin}\marg{name} and \cmd{\end}\marg{name} will |
| 68 |
be totally deleted. Very long sections of excluded text might cause |
| 69 |
a `\TeX\ capacity exceeded' error. Exclusion ends with the first |
| 70 |
detected \cmd{\end}\marg{name}, even if there are additional \cmd{\begin}\marg{name} |
| 71 |
declarations in the skipped text; that is, nesting of environments |
| 72 |
is not permitted. Skipped text may have unbalanced braces, if |
| 73 |
they would also work in the \cmd{\includeversion} case. |
| 74 |
|
| 75 |
\item[\cmd{\excludeversion}\oarg{text}\marg{name}] \leavevmode \\ |
| 76 |
This indicates that text between \cmd{\begin}\marg{name} and \cmd{\end}\marg{name} will |
| 77 |
be replaced by the specified \meta{text}. |
| 78 |
\end{description} |
| 79 |
|
| 80 |
You can define environments for as many versions as you want. |
| 81 |
A `\env{comment}' environment has already been pre-defined with |
| 82 |
\verb+\excludeversion{comment}+; you can override this by declaring |
| 83 |
\verb+\includeversion{comment}+. |
| 84 |
|
| 85 |
|
| 86 |
\section{Example:} |
| 87 |
|
| 88 |
\begin{lstlisting} |
| 89 |
\includeversion{abridged}\excludeversion{unabridged} |
| 90 |
\excludeversion[(redacted)]{redact} |
| 91 |
Text for the |
| 92 |
\begin{abridged} |
| 93 |
short |
| 94 |
\end{abridged} |
| 95 |
\begin{unabridged} |
| 96 |
long and really longwinded, opaque and boring |
| 97 |
\end{unabridged} |
| 98 |
version of the paper. Punctuation works correctly\begin{unabridged} |
| 99 |
because sphack is used\end{unabridged}. |
| 100 |
\begin{comment} This is deleted by default. \end{comment} |
| 101 |
\begin{redact}This information was withdrawn\end{redact} |
| 102 |
\end{lstlisting} |
| 103 |
|
| 104 |
\end{document} |