Debian Codegraph @

texmf-dist/doc/latex/xreview/xreview.tex

raw
1 \documentclass[a4paper]{ltxdoc}
2 \usepackage{amsmath}
3 \usepackage{hyperref}
4 \usepackage{parskip}
5 \usepackage{bold-extra}
6 \usepackage{cite}
7 \usepackage{filecontents}
8 \usepackage{listings}
9
10 \usepackage{xreview}
11
12 \newcommand{\writecommand}[1]{\texttt{\textbf{{\textbackslash#1}}}}
13 \newcommand{\writeenv}[1]{\texttt{\textbf{{#1}}}}
14 \newcommand{\writearg}[1]{\{#1\}}
15
16 \begin{filecontents}[overwrite]{bibliography.bib}
17 @book{texbook,
18 author = {Donald E. Knuth},
19 year = {1986},
20 title = {The {\TeX} Book},
21 publisher = {Addison-Wesley Professional}
22 }
23 @book{latex2e,
24 author = {Leslie Lamport},
25 year = {1994},
26 title = {{\LaTeX}: a Document Preparation System},
27 publisher = {Addison Wesley},
28 address = {Massachusetts},
29 edition = {2}
30 }
31 \end{filecontents}
32
33 \title{\textbf{xreview}: \\ \Large{Reviewing
34 \LaTeX~documents made easy}}
35
36 \author{Lorenzo Peri\\\textcolor{blue}{\href{mailto:[email protected]}{[email protected]}}}
37 \date{19/04/2026, v2.0}
38
39 \hypersetup{
40 pdftitle={xreview},
41 pdfauthor={Lorenzo Peri},
42 urlcolor=cyan,
43 }
44
45 \changes{v1.0}{2024/08/27}{First version}
46
47 \showchanges
48
49 \begin{document}
50
51 \maketitle
52
53 \begin{abstract}
54 \textit{xreview} is an attempt to make the painful process of reviewing a \LaTeX~document easy, or, at least, \textit{a little} less painful.
55 \end{abstract}
56
57 \tableofcontents
58
59 \section{Getting Started}
60
61 Have you ever had to make modifications to a manuscript while needing to keep track of the changes? Have you ever been asked by a journal to provide a revised version highlighting the changes \textit{and} a clean version? Is your brain utterly incapable of reasoning about a sentence while it's wrapped in dashes and distracting colors?
62 Now you can \texttt{\textbf{{$\backslash$usepackage}}\{xreview\}} to make your life \textit{a little} less miserable.
63
64 \subsection{The basics}
65
66 \textit{xreview} allows you to quickly show and hide changes to a document.
67 This is achieved providing two commands:
68 \begin{itemize}
69 \item \writecommand{showchanges} to annotate the changes;
70 \item \writecommand{showclean} to compile a clean document.
71 \end{itemize}
72
73 Changes can be annotated mostly using the commands:
74 \begin{itemize}
75 \item \writecommand{removed} for \removed{removed sections}
76 \item \writecommand{added} for \added{added sections}
77 \item \writecommand{changed} for sections that have been \changed{changed}{modified}
78 \end{itemize}
79
80 Sounds great, right? Here is a simple example of the package in use!
81
82 \begin{center}
83 \begin{minipage}[t]{0.3\linewidth}
84 \textbf{\LaTeX Code}
85
86 \writecommand{textit} \writearg{xreview} is a \writecommand{removed} \writearg{fantastic} package to help \writecommand{added} \writearg{\writecommand{LaTeX}} authors review their manuscripts to respond to the \writecommand{changed}\writearg{annoying} \writearg{valuable} modifications suggested by referees.
87
88 \end{minipage}
89 \hfill
90 \begin{minipage}[t]{0.3\linewidth}
91 \writecommand{showchanges}
92 \showchanges
93
94 \textit{xreview} is a \removed{fantastic}\remspace package to help \added{\LaTeX} authors review their manuscripts to respond to the \changed{annoying}{valuable} modifications suggested by referees.
95
96 \end{minipage}
97 \hfill
98 \begin{minipage}[t]{0.3\linewidth}
99 \writecommand{showclean}
100 \showclean
101
102 \textit{xreview} is a \removed{fantastic}\remspace package to help \added{\LaTeX} authors review their manuscripts to respond to the \changed{annoying}{valuable} modifications suggested by referees.
103 \end{minipage}
104 \end{center}
105 \showchanges
106
107 If you look at the source code of this document, you will see that you can toggle \writecommand{showchanges} and \writecommand{showclean} to only show/hide changes in a certain section!
108
109 \subsection{Dealing with equations}
110
111 The author of this package is a \changed{nerd}{physicist}, so they know full well the pain of needing to review mathematical papers with equations.
112 Therefore, \textit{xcite} has first class support for math mode and the more common math environments.
113
114 \subsubsection{Inline math}
115
116 Inline math (defined within \$ symbols) can be safely used within \writecommand{removed}, \writecommand{added}, and \writecommand{changed}. For example \removed{$\tau$ is superior to $\pi$} is a statement that \textit{should} be \writecommand{removed}.
117
118 \subsubsection{\writeenv{remequation} and \writeenv{remequation*} environments}
119
120 Dealing with annotating equations is weird and generally quite annoying.
121 \textit{xcite} attempts to smooth the process as much as possible by providing the \writeenv{remequation} and \writeenv{remequation*} environments.
122 Those markup an equation as if it was \writecommand{removed} while also dealing with numbering correctly, so that \textbf{equation numbering will not change between the annotated and clean versions}.
123
124 To simply mark an equation that must be removed, \writeenv{remequation*} can be used as such.
125
126 \begin{center}
127 \begin{minipage}[t]{0.3\linewidth}
128 \textbf{\LaTeX Code}
129
130 This equation is kept \newline
131 \writecommand{begin}\writearg{equation}
132
133 ~\quad a+b = c\newline
134 \writecommand{end}\writearg{equation}\newline
135 while this is removed.\newline
136 \writecommand{begin}\writearg{remequation*}
137
138 ~\quad a+b = d\newline
139 \writecommand{end}\writearg{remequation*}\newline
140 See?
141
142 \end{minipage}
143 \hfill
144 \begin{minipage}[t]{0.3\linewidth}
145 \writecommand{showchanges}
146 \showchanges
147
148 This equation is kept
149 \begin{equation}
150 a+b = c
151 \end{equation}\addtocounter{equation}{-1}
152 while this is removed.
153 \begin{remequation*}
154 a+b = d
155 \end{remequation*}
156 See?
157
158 \end{minipage}
159 \hfill
160 \begin{minipage}[t]{0.3\linewidth}
161 \writecommand{showclean}
162 \showclean
163
164 This equation is kept
165 \begin{equation}
166 a+b = c
167 \end{equation}\addtocounter{equation}{-1}
168 while this is removed.
169 \begin{remequation*}
170 a+b = d
171 \end{remequation*}
172 See?
173
174 \end{minipage}
175 \end{center}
176 \showchanges
177
178 Sometimes, however, it is useful to be able to reference an equation that is marked to be removed. This may happen because either some text referenced it, or to carry out a discussion around it (i.e. why it was removed).
179 To facilitate this, \textit{xreview} provides the \writeenv{remequation} environment, which \textbf{introduces a separate numbering scheme for removed equations}.
180 The prefix for this separate numbering is normally a capital `R'. However, this can be customized to one's preference (see Section~\ref{sec:custom}).
181 Here's an example
182
183 \begin{center}
184 \begin{minipage}[t]{0.3\linewidth}
185 \textbf{\LaTeX Code}
186
187 This equation is kept \newline
188 \writecommand{begin}\writearg{equation}
189
190 ~\quad a+b = c\newline
191 \writecommand{end}\writearg{equation}\newline
192 while this is removed and labelled\newline
193 \writecommand{begin}\writearg{remequation}
194
195 ~\quad a+b = d\newline
196 \writecommand{end}\writearg{remequation}\newline
197 without altering the normal equation numbering.\newline
198 \writecommand{begin}\writearg{equation}
199
200 ~\quad b+c = d\newline
201 \writecommand{end}\writearg{equation}\newline
202
203 \end{minipage}
204 \hfill
205 \begin{minipage}[t]{0.3\linewidth}
206 \writecommand{showchanges}
207 \showchanges
208
209 This equation is kept
210 \begin{equation}
211 a+b = c
212 \end{equation}
213 while this is removed and labelled
214 \begin{remequation}
215 a+b = d
216 \label{eq:remeq_example}
217 \end{remequation}
218 \makeatletter
219 \addtocounter{xreview@removedeqcounter}{-1}
220 \makeatother
221 without altering the normal equation numbering.
222 \begin{equation}
223 b+c = d
224 \end{equation}\addtocounter{equation}{-2}
225
226 \end{minipage}
227 \hfill
228 \begin{minipage}[t]{0.3\linewidth}
229 \writecommand{showclean}
230 \showclean
231
232 This equation is kept
233 \begin{equation}
234 a+b = c
235 \end{equation}
236 while this is removed and labelled
237 \begin{remequation}
238 a+b = d
239 \end{remequation}
240 without altering the normal equation numbering.
241 \begin{equation}
242 b+c = d
243 \end{equation}\addtocounter{equation}{-2}
244
245 \end{minipage}
246 \end{center}
247 \showchanges
248
249 The \writeenv{remequation} environment is compatible with the standard \writecommand{ref} or \writecommand{eqref} commands. For example, I can now reference equation \ref{eq:remeq_example} from the example.
250
251 Similarly, \textit{xreview} provides \writeenv{addequation} and \writeenv{addequation*} to mark an equation as added. \textbf{Added equations follow the same numbering as regular equations, and they are indistinguishable in the clean version}. Here is an example:
252
253 \begin{center}
254 \begin{minipage}[t]{0.3\linewidth}
255 \textbf{\LaTeX Code}
256
257 This equation is kept \newline
258 \writecommand{begin}\writearg{equation}
259
260 ~\quad a+b = c\newline
261 \writecommand{end}\writearg{equation}\newline
262 and this is colored.\newline
263 \writecommand{begin}\writearg{addequation}
264
265 ~\quad a+b = d\newline
266 \writecommand{end}\writearg{addequation}\newline
267
268 \end{minipage}
269 \hfill
270 \begin{minipage}[t]{0.3\linewidth}
271 \writecommand{showchanges}
272 \showchanges
273
274 This equation is kept
275 \begin{equation}
276 a+b = c
277 \end{equation}
278 and this is colored.
279 \begin{addequation}
280 a+b = d
281 \end{addequation}\addtocounter{equation}{-2}
282
283 \end{minipage}
284 \hfill
285 \begin{minipage}[t]{0.3\linewidth}
286 \writecommand{showclean}
287 \showclean
288
289 This equation is kept
290 \begin{equation}
291 a+b = c
292 \end{equation}
293 and this is colored.
294 \begin{addequation}
295 a+b = d
296 \end{addequation}\addtocounter{equation}{-2}
297
298 \end{minipage}
299 \end{center}
300 \showchanges
301
302 Should one wish to, \writeenv{remequation*} may be replicated with \writeenv{remequation} by using the \writecommand{nonumber} or \writecommand{notag} commands hiding the tag and not incrementing the removed equation counter. The same goes for \writeenv{addequation}.
303
304 \subsubsection{\writecommand{removedeqline} and \texttt{align}-like environments}
305
306 Sometimes, some \textit{tragical} times, one must edit one equation defined within a series of equations (i.e. in an \texttt{align} environment).
307 While \writecommand{removed}, \writecommand{added}, and \writecommand{changed} work just fine to modify the text, the equation ordering may be compromised.
308
309 Even within \textit{xreview} this is \textit{slightly} awkward and generally not recommended. However, we do provide functionality to do so in the most ergonomic way possible. This is achieved by providing the commands:
310 \begin{itemize}
311 \item \writecommand{removedeqline} that turns an \writeenv{equation} line into a \writeenv{remequation};
312 \item \writecommand{addedeqline} that typesets the line as if it was \writecommand{added};
313 \item \writecommand{remaligntab} and \writecommand{remnewline} to help with alignment and typesetting of the clean version.
314 \end{itemize}
315
316 The simplest example reads:
317
318 \begin{center}
319 \begin{minipage}[t]{0.34\linewidth}
320 \textbf{\LaTeX Code}
321
322
323 \writecommand{begin}\writearg{align}
324
325 \& a+b = c \textbackslash\textbackslash
326
327 \writecommand{remaligntab} \writecommand{removedeqline}\writearg{a+b=d} \writecommand{remnewline}
328
329 \& \writecommand{addedeqline}\writearg{b+c=d}\newline
330 \writecommand{end}\writearg{align}\newline
331
332 \end{minipage}
333 \hfill
334 \begin{minipage}[t]{0.3\linewidth}
335 \writecommand{showchanges}
336 \showchanges
337
338 \begin{align}
339 a+b =c \\
340 \removedeqline{a+c=d} \remnewline
341 \addedeqline{b+c = d}
342 \end{align}\addtocounter{equation}{-2}
343 \makeatletter
344 \addtocounter{xreview@removedeqcounter}{-1}
345 \makeatother
346
347 \end{minipage}
348 \hfill
349 \begin{minipage}[t]{0.3\linewidth}
350 \writecommand{showclean}
351 \showclean
352
353 \begin{align}
354 a+b =c \\
355 \removedeqline{a+c=d} \remnewline
356 \addedeqline{b+c = d}
357 \end{align}\addtocounter{equation}{-2}
358
359 \end{minipage}
360 \end{center}
361 \showchanges
362
363 The only caveat is that \textbf{\& be replaced with \writecommand{remaligntab} and \textbackslash\textbackslash be replaced with \writecommand{remnewline} on \writecommand{removedeqline} lines}.
364 However, problems arise if the alignment tab \& is desired \textit{inside} \writecommand{removedeqline} or \writecommand{addedeqline}. In this case, we run into trouble because commands cannot easily cross an alignment point. Thus, we must write \textbf{two} commands:
365 \begin{itemize}
366 \item \writecommand{remnewline}\writearg{\textit{before tab}} \writecommand{remaligntab} \writecommand{removed}\writearg{\textit{after tab}};
367 \item \writecommand{addedeqline}\writearg{\textit{before tab}} \& \writecommand{added}\writearg{\textit{after tab}}
368 \end{itemize}
369
370
371 \begin{center}
372 \begin{minipage}[t]{0.34\linewidth}
373 \textbf{\LaTeX Code}
374
375 This equation is kept \newline
376 \writecommand{begin}\writearg{align}
377
378 a+b \&= c \textbackslash\textbackslash
379
380 \writecommand{removedeqline}\writearg{a+b} \writecommand{remaligntab} \writecommand{removed}\writearg{=d} \writecommand{remnewline}
381
382 \writecommand{addedeqline}\writearg{a+b} \& \writecommand{added}\writearg{=2d}\newline
383 \writecommand{end}\writearg{align}\newline
384
385 \end{minipage}
386 \hfill
387 \begin{minipage}[t]{0.3\linewidth}
388 \writecommand{showchanges}
389 \showchanges
390
391 \begin{align}
392 a+b &=c \\
393 \removedeqline{a+b} \remaligntab \removed{=d} \remnewline
394 \addedeqline{c} & \added{= 2d}
395 \end{align}\addtocounter{equation}{-2}
396 \makeatletter
397 \addtocounter{xreview@removedeqcounter}{-1}
398 \makeatother
399
400 \end{minipage}
401 \hfill
402 \begin{minipage}[t]{0.3\linewidth}
403 \writecommand{showclean}
404 \showclean
405
406 \begin{align}
407 a+b &=c \\
408 \removedeqline{a+b} \remaligntab \removed{=d} \remnewline
409 \addedeqline{c} & \added{= 2d}
410 \end{align}\addtocounter{equation}{-2}
411
412 \end{minipage}
413 \end{center}
414 \showchanges
415
416 If it is desired to hide the \writecommand{removedeqline} tag, the commands \writecommand{nonumber} or \writecommand{notag} can be used \textbf{inside the \writecommand{removedeqline} command}.
417
418 \subsubsection{\writeenv{addalign} and \writeenv{remalign} environments}
419
420 If removing or adding a whole \texttt{align} environment is desired, \textit{xreview} offers a the \writeenv{addalign} and \writeenv{remalign} environments (as well as \writeenv{addalign*} and \writeenv{remalign*}).
421
422 \begin{center}
423 \begin{minipage}[t]{0.3\linewidth}
424 \textbf{\LaTeX Code}
425
426 These equations are added\newline
427 \writecommand{begin}\writearg{addalign}
428
429 ~\quad \& a+b = d\textbackslash\textbackslash
430
431 ~\quad \& b+c=3d\newline
432 \writecommand{end}\writearg{addalign}\newline
433 and these are removed\newline
434 \writecommand{begin}\writearg{remalign}
435
436 ~\quad \& a+b = d\textbackslash\textbackslash
437
438 ~\quad \& b+c=3d\newline
439 \writecommand{end}\writearg{remalign}\newline
440 while these unnumbered\newline
441 \writecommand{begin}\writearg{remalign*}
442
443 ~\quad \& a+b = d\textbackslash\textbackslash
444
445 ~\quad \& b+c=3d\newline
446 \writecommand{end}\writearg{remalign*}\newline
447
448 \end{minipage}
449 \hfill
450 \begin{minipage}[t]{0.3\linewidth}
451 \writecommand{showchanges}
452 \showchanges
453
454 These equations are added
455 \begin{addalign}
456 & a+b = d \\
457 & b+c=3d
458 \end{addalign}\addtocounter{equation}{-2}
459 and these are removed
460 \begin{remalign}
461 & a+b = d \\
462 & b+c=3d
463 \end{remalign}
464 \makeatletter
465 \addtocounter{xreview@removedeqcounter}{-2}
466 \makeatother
467 while these unnumbered
468 \begin{remalign*}
469 & a+b = d \\
470 & b+c=3d
471 \end{remalign*}
472
473 \end{minipage}
474 \hfill
475 \begin{minipage}[t]{0.3\linewidth}
476 \writecommand{showclean}
477 \showclean
478
479 These equations are added
480 \begin{addalign}
481 & a+b = d \\
482 & b+c=3d
483 \end{addalign}\addtocounter{equation}{-2}
484 and these are removed
485 \begin{remalign}
486 & a+b = d \\
487 & b+c=3d
488 \end{remalign}
489 while these unnumbered
490 \begin{remalign*}
491 & a+b = d \\
492 & b+c=3d
493 \end{remalign*}
494
495 \end{minipage}
496 \end{center}
497 \showchanges
498
499 While \writeenv{addalign} and \writeenv{addalign*} works almost indistinguishably from marking each line as a \writecommand{addedeqline}, this is quite clearly not the same for \writeenv{remalign}. The reason is simple: \textit{amsmath} does \textit{not} provide an easy way to \writecommand{sout} through alignment tabs and newlines. Therefore, we pull a simple trick to ``\textit{sout}'' diagonally across. Not \textit{as} pretty, but it is a drop-in replacement for a to-be-removed \writeenv{align}! If an author cares very much about every single line being \textit{beautifully} stricken-through, they unfortunately must use \writecommand{removedeqline} and friends explicitly. Because of these limitations, \writeenv{remalign} and \writeenv{remalign*} try to be as customizable as possible. See Section~\ref{sec:remalign-custom} for more details.
500
501 \subsection{Comments}
502
503 Comments are a great way to communicate with various authors, to carry out a discussion directly on a shared document or to share ideas and questions together with the compiled manuscript.
504
505 \textit{xreview} allows for the possibility to insert comments that out of the box work in one- or two-column documents.
506
507 \subsubsection{The \writecommand{comment} command}
508
509 Simple comments can be attached to a snippet of text and \textbf{are hidden on the clean version}.
510
511 \textbf{\LaTeX Code}
512
513 \begin{quote}
514 \writecommand{textit}\writearg{xreview} is \writecommand{comment}\writearg{the greatest \writecommand{TeX} package ever written!}\writearg{Have you heard of \writecommand{textit}\writearg{amsmath}?}
515 \end{quote}
516
517 \writecommand{showchanges}
518 \showchanges
519
520 \begin{quote}
521 \textit{xreview} is \comment{the greatest \TeX~package ever written!}{Have you heard of \textit{amsmath}?}
522 \end{quote}
523
524 \writecommand{showclean}
525 \showclean
526
527 \begin{quote}
528 \textit{xreview} is \comment{the greatest \TeX~package ever written!}{Have you heard of \textit{amsmath}?}
529 \end{quote} \addtocounter{commentcounter}{-1}
530
531 \showchanges
532
533 \textbf{Every comment is numbered} for ease of reference, with a customizable prefix (a capital `C' by default, see Section~\ref{sec:custom}).
534
535 Sometimes, it is desirable to share only the changes and hide the comments. For this scenario, \textit{xreview} provides a separate toggle:
536 \begin{itemize}
537 \item \writecommand{showcomments} to show comments on the annotated document;
538 \item \writecommand{hidecomments} to hide comments \textbf{even if \writecommand{showchanges} is set}.
539 \end{itemize}
540
541 \writecommand{comment} takes as optional argument everything accepted by \writecommand{todo} in the \href{https://ctan.org/pkg/todonotes?lang=en}{todonotes package}. This can be used, for example, to override the default color.
542
543 \textbf{\LaTeX Code}
544
545 \begin{quote}
546 This is a \writecommand{comment}[backgroundcolor=red]\writearg{red comment!}\writearg{It looks angry.}
547 \end{quote}
548
549 \writecommand{showchanges}
550 \showchanges
551
552 \begin{quote}
553 This is a \comment[backgroundcolor=red]{red comment!}{It looks angry.}
554 \end{quote}
555
556
557 \subsubsection{\writecommand{resolvedcomment}: a useful pattern}
558
559 Sometimes comments tend to stick around for \textit{a while}. However, this has the downside of hiding which have been resolved and which are still outstanding.
560 To avoid this anti-pattern, \textit{xreview} offers the command \writecommand{resolvedcomment} to mark a comment as resolved!
561 Changing \writecommand{comment} to \writecommand{resolvedcomment} will make outstanding matters stand out atop a sea of calming satisfying green.
562
563 \textbf{\LaTeX Code}
564
565 \begin{quote}
566 This is \writecommand{resolvedcomment}\writearg{easy}\writearg{Understood!} while this is \writecommand{comment}\writearg{hard}\writearg{Still unclear...}.
567 \end{quote}
568
569 \writecommand{showchanges}
570 \showchanges
571
572 \begin{quote}
573 This is \resolvedcomment{easy}{Understood!} while this is \comment{hard}{Still unclear...}.
574 \end{quote}
575
576 \subsubsection{\writecommand{authoredcomments}: another useful pattern}
577
578 It is most times helpful to know who wrote a comment. This is made easy by the \writecommand{authoredcomments} command. This is used as such
579
580 \begin{quote}
581 \writecommand{authoredcomments}[Optional: mods to \writecommand{comment}][Optional: mods to \writecommand{resolvedcomment}]{Authorname}
582 \end{quote}
583 \noindent
584 and creates two commands \writecommand{Authornamecomment} and \writecommand{resolvedAuthornamecomment} which will mark the author and can easily be distinguished.
585 Here is an example:
586
587 \textbf{\LaTeX Code}
588
589 \begin{quote}
590 \writecommand{authoredcomments}[color=cyan]\writearg{Lorenzo}\newline
591 \writecommand{authoredcomments}[color=orange]\writearg{Alice}\newline
592
593 This is \writecommand{Alicecomment}\writearg{great}\writearg{Written by Alice.} while this \writecommand{Lorenzocomment}\writearg{less so}\writearg{Written by Lorenzo}.
594
595 This is an \writecommand{resolvedLorenzocomment}\writearg{old modification}\writearg{Found appropriate citation.} we discussed.
596 \end{quote}
597
598 \writecommand{showchanges}
599 \showchanges
600
601 \begin{quote}
602 \authoredcomments[color=cyan]{Lorenzo}
603 \authoredcomments[color=orange]{Alice}
604 This is \Alicecomment{great}{Written by Alice.} while this \Lorenzocomment{less so}{Written by Lorenzo}.
605
606 This is an \resolvedLorenzocomment{old modification}{Found appropriate citation.} we discussed.
607 \end{quote}
608
609 \section{Caveats, tips, and tricks}
610
611 \textit{xreview} tries to smooth away all the rough edges of trying to dynamically(-ish) change \LaTeX. However, here are some common pitfalls and caveats that are worth pointing out.
612
613 \subsection{Dealing with \writecommand{sout}}
614
615 Certain commands in \LaTeX are more feisty than others. Among those, \writecommand{sout} must take the crown for the most useful command that does not like to cooperate with others. In particular, it does not like commands like \writecommand{cite}.
616 \textit{xreview} tries to deal with this for you, so we can simply write \changed{\LaTeX \cite{latex2e} replaces \TeX \cite{texbook}}{\LaTeX \cite{latex2e} is a set of macros built atop \TeX \cite{texbook}}.
617
618 However, if you recently added a \writecommand{removed} or \writecommand{changed} section and all of a sudden the document does not compile, try wrapping any \textit{suspicious} command in an \writecommand{mbox} (i.e. \writecommand{command}\writearg{\dots} $\rightarrow$ \writecommand{mbox}\{\writecommand{command}\writearg{\dots}\}) and see if this fixes it!
619
620 \subsection{Being aware of whitespace}
621
622 \textit{xreview} tries its best to ensure both the annotated and clean documents look fantastic. However, is is easy to introduce too much (or too little) whitespace to make either one look sloppy. The biggest culprit is usually having wrapped whitespace at either end of \writecommand{removed} (i.e. \writecommand{removed}\writearg{ \textit{words} }) or having whitespace at the end of \writecommand{removed} or a line.
623
624 \textbf{\LaTeX Code}
625
626 \begin{quote}
627 This will merge\writecommand{removed}\writearg{ separate }words.
628 \writecommand{removed} \writearg{This is removed.}\textvisiblespace This sentence is far from the previous.
629 \end{quote}
630
631 \writecommand{showchanges}
632 \showchanges
633
634 \begin{quote}
635 This will merge\removed{ separate }words.
636 \removed{This is removed.} This sentence is far from the previous.
637 \end{quote}
638
639 \writecommand{showclean}
640 \showclean
641
642 \begin{quote}
643 This will merge\removed{ separate }words.
644 \removed{This is removed.} This sentence is far from the previous.
645 \end{quote}
646
647 \showchanges
648
649 This problem is exacerbated when dealing with equations or when a paragraph break is desired in one version but not the other.
650 To help with most situations, \textit{xreview} provides the \writecommand{remspace} command and its non--breaking sibling \writecommand{remnbsp}.
651 For more complex situations, \writecommand{hidefromclean} will be of great help.
652
653 \subsection{Comments are not wide enough}
654
655 Comment width is optimized to look nice in two-colum documents. If you are writing a single-column manuscript (or would just prefer them to go a little closer to the page margin), you can use
656 \begin{quote}
657 \writecommand{setlength}\writearg{\writecommand{marginparwidth}}\writearg{\textit{desired width}}
658 \end{quote}
659 in the preamble \underline{\textbf{after}} \writecommand{usepackage}\writearg{xcite}.
660
661 The default with is \texttt{2 cm}.
662
663 \section{Customization}
664 \label{sec:custom}
665
666 Most aesthetical aspects of \textit{xreview} are customizable. To do so, simply insert this line in the document preamble
667 \begin{quote}
668 \writecommand{renewcommand}\{\writecommand{thecommand}\}\writearg{new options}
669 \end{quote}
670
671 The commands available to be redefined are:
672 \begin{itemize}
673 \item \writecommand{addedcolor} [default: \textcolor{blue}{blue}]: the color of \writecommand{added} sections;
674 \item \writecommand{removedcolor} [default: \textcolor{red}{red}]: the color of \writecommand{removed} sections;
675 \item \writecommand{commentcolor} [default: \textcolor{yellow}{yellow}]: the background color of \writecommand{comment};
676 \item \writecommand{resolvedcommentcolor} [default: \textcolor{green}{green}]: the background color of \writecommand{resolvedcomment};
677 \item \writecommand{removedeqprefix} [default: R]: the prefix for the tag of removed equations;
678 \item \writecommand{commentprefix} [default: C]: the prefix comment captions.
679 \end{itemize}
680
681 \subsection{Customizing \writeenv{remalign} and \writeenv{remalign*}}
682 \label{sec:remalign-custom}
683
684 There are also a few commands that enable users to customize the look of \writeenv{remalign} and \writeenv{remalign*}:
685 \begin{itemize}
686 \item \writecommand{remalignxleftshift} [default: \texttt{0.15}\writecommand{linewidth}];
687 \item \writecommand{remalignxrightshift} [default: \texttt{0.34}\writecommand{linewidth}];
688 \item \writecommand{remalignstarxshift} [default: \texttt{0.34}\writecommand{linewidth}];
689 \item \writecommand{remalignyshift} [default: \texttt{2ex}];
690 \item \writecommand{remalignstrikecolor} [default: \writecommand{removedcolor}];
691 \end{itemize}
692
693 The strike-through line in \writeenv{remalign} is drawn as a \writeenv{tikzpicture} call
694
695 \begin{lstlisting}[language=TeX]
696 \draw[color=\remalignstrikecolor, remalignstyle]
697 ([xshift=\remalignxleftshift, yshift=-\remalignyshift]
698 eqblock.north west)
699 --
700 ([xshift=-\remalignxrightshift, yshift=\remalignyshift]
701 eqblock.south east);
702 \end{lstlisting}
703
704 while the \writeenv{remalign*} is drawn as
705
706 \begin{lstlisting}[language=TeX]
707 \draw[color=\remalignstrikecolor, remalignstyle]
708 ([xshift=\remalignxleftshift, yshift=-\remalignyshift]
709 eqblock.north west)
710 --
711 ([xshift=-\remalignxrightshift, yshift=\remalignyshift]
712 eqblock.south east);
713 \end{lstlisting}
714
715 \texttt{remalignstyle} gives users complete \writeenv{tikz} control over the style. They are very welcome to give exact dimensions (\texttt{\writecommand{tikzset}\{remalignstyle/.style={line width=2.5pt}}\}) or multiple options (\texttt{\writecommand{tikzset}\{remalignstyle/.style={very thick, dashed}}\}), to their heart's content!
716
717 \bibliographystyle{unsrt}
718 \bibliography{bibliography.bib}
719
720 \end{document}