Debian Codegraph @

texmf-dist/doc/latex/commedit/sample.tex

raw
1 \documentclass{book}
2 \usepackage[papersize={204mm,275mm}, top=17mm,
3 bottom=17mm, outer=22mm, inner=20mm, includeheadfoot=false]{geometry}
4 \usepackage{lipsum}
5 \usepackage{commedit}
6 \clearpage
7 \begin{commeditPreamble}{commented.tex}
8 \documentclass{book}
9 \usepackage[papersize={230mm,288mm}, top=15mm,
10 bottom=17mm, outer=11mm, inner=4.5mm, includeheadfoot=false]{geometry}
11 \usepackage{kantlipsum}
12 \usepackage{ragged2e}
13 \usepackage{booktabs}
14 \usepackage{commedit}
15 \basepageargs{width=140mm}
16 \commentsHook{\RaggedRight\parskip=0pt\parindent=1em\relax}
17 \end{commeditPreamble}
18
19 \begin{commeditText}
20 \frontmatter
21 \title{Commented edition}
22 \author{Boris Veytsman}
23 \date{November 2018}
24 \maketitle
25
26 \chapter{Introduction}
27 \label{sec:intro-commented}
28
29 This is the introuduction for the commented edition. Note that we
30 use \textsl{lipsum} for the base edition and \textsl{kantlipsum} for
31 the commented edition.
32
33 Some gibberish\footnote{We can use footnotes here.}\ldots
34
35 \kant[6-20]
36
37 \mainmatter
38
39 \chapter{First chapter}
40 \label{sec:first-commented}
41 \end{commeditText}
42
43 \begin{document}
44 \frontmatter
45 \title{Base edition}
46 \author{Boris Veytsman}
47 \date{November 2018}
48 \maketitle
49
50 \chapter{Foreword}
51 \label{chap:foreword}
52
53 The foreword for the base edition
54
55 \lipsum[1-5]
56
57 \begin{commeditText}
58
59 Now we switch back to the commented edition\footnote{A footnote}.
60
61 Some equation in the text.
62 \begin{equation}
63 \label{eq:pi}
64 e^{i\pi}=-1,
65 \end{equation}
66 and another one
67 \begin{equation}
68 \label{eq:sin}
69 sin^2\phi+\cos^2\phi=1.
70 \end{equation}
71
72 And more gibberish:
73
74 \kant[5-12]
75
76 \end{commeditText}
77
78 \mainmatter
79
80 \chapter{Some thoughts}
81 \label{chap:thoughts}
82
83 Here we switch back to the base edition.
84 \begin{commeditComments}
85 Comments for the chapter~\ref{chap:thoughts} of the base
86 edition\footnote{A footnote}.
87 \begin{equation}
88 e=mc^2
89 \end{equation}
90 \kant[6]
91 \end{commeditComments}
92
93 An equation for the base edition:
94 \begin{equation}
95 \label{eq:Einstein}
96 e=mc^2.
97 \end{equation}
98
99 And pseudo-lating gibberish.
100
101 \lipsum[6-12]
102
103
104 \begin{commeditComments}
105 We can reference base equation~(\ref{eq:Einstein}) on base
106 page~(\pageref{eq:Einstein}) and commented edition
107 equations~(\ref{eq:pi}) and (\ref{eq:sin}) on the commented edition
108 page~(\pageref{eq:pi}).
109
110 More gibberish\footnote{A footnote for the comments.}.
111
112 \kant[7]
113 \end{commeditComments}
114
115 More gibberish for base edition.
116
117 \lipsum[15-17]
118
119 \begin{commeditComments}
120 Comments.
121 \kant[4]
122 \begin{equation}
123 u=v\cdot a
124 \end{equation}
125 \end{commeditComments}
126
127 \lipsum[3-2]
128
129 \begin{commeditComments}
130 \begin{itemize}
131 \item item
132 \item item
133 \item item
134 \end{itemize}
135
136
137 \pagebreak
138 More comments. Note the continuation pages\ldots
139 \kant[8-20]
140 \end{commeditComments}
141
142 \lipsum[9-20]
143
144 \begin{commeditComments}
145 Here we add a figure.
146
147 \begin{figure}
148 \centering
149 \includegraphics[width=\columnwidth]{vitruvian}
150 \caption{Vitruvian man}
151 \label{fig:vitruvian}
152 \end{figure}
153
154 There is no difference between starred and unstarred floats
155 \begin{table*}
156 \centering
157 \begin{tabular}{ll}
158 \toprule
159 Gnus & Gnats\\
160 \midrule
161 12 & 20\\
162 24 & 10\\
163 \bottomrule
164 \end{tabular}
165 \caption{A table}
166 \label{tab:table}
167 \end{table*}
168
169 \end{commeditComments}
170
171 \begin{commeditText}
172 \section{Final text}
173
174
175 Here we add a real float. Note that it floats to the top of the
176 page.
177
178 \begin{figure}[t]
179 \centering
180 \includegraphics[width=.5\columnwidth]{vitruvian}
181 \caption{Another vitruvian man}
182 \label{fig:vitruvian1}
183 \end{figure}
184 \end{commeditText}
185
186 \end{document}