Debian Codegraph @

texmf-dist/source/latex/rebuttal/rebuttal.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright 2018-2021, 2024 Sergiu Deitsch
4 %
5 % This work may be distributed and/or modified under the
6 % conditions of the LaTeX Project Public License, either version 1.3
7 % of this license or (at your option) any later version.
8 % The latest version of this license is in
9 % http://www.latex-project.org/lppl.txt
10 % and version 1.3 or later is part of all distributions of LaTeX
11 % version 2005/12/01 or later.
12 %
13 % \fi
14 %
15 % \iffalse
16 %<package>\NeedsTeXFormat{LaTeX2e}
17 %<package>\ProvidesPackage{rebuttal}
18 %<package> [2024-11-14 v0.1.1 Markup for rebuttal letters]
19 %
20 %<*driver>
21 \ProvidesFile{rebuttal.dtx}
22
23 \documentclass[american,reportchangedates]{ltxdoc}
24 \usepackage[abbreviations]{foreign}
25 \usepackage[utf8]{inputenc}
26 \usepackage[T1]{fontenc}
27 \usepackage{babel}
28 \usepackage{microtype}
29 \usepackage[all]{nowidow}
30 \usepackage{rebuttal}
31 \usepackage{hyperref}
32
33 \EnableCrossrefs
34 \CodelineIndex
35 \RecordChanges
36
37 \hypersetup{%
38 pdfauthor = {Sergiu Deitsch},
39 pdftitle = {The rebuttal package},
40 urlcolor = NavyBlue,
41 linkcolor = Firebrick3,
42 }
43
44 \begin{document}
45 \DocInput{rebuttal.dtx}
46 \end{document}
47 %</driver>
48 % \fi
49 %
50 % \CheckSum{0}
51 %
52 % \CharacterTable
53 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
54 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
55 % Digits \0\1\2\3\4\5\6\7\8\9
56 % Exclamation \! Double quote \" Hash (number) \#
57 % Dollar \$ Percent \% Ampersand \&
58 % Acute accent \' Left paren \( Right paren \)
59 % Asterisk \* Plus \+ Comma \,
60 % Minus \- Point \. Solidus \/
61 % Colon \: Semicolon \; Less than \<
62 % Equals \= Greater than \> Question mark \?
63 % Commercial at \@ Left bracket \[ Backslash \\
64 % Right bracket \] Circumflex \^ Underscore \_
65 % Grave accent \` Left brace \{ Vertical bar \|
66 % Right brace \} Tilde \~}
67 %
68 %
69 % \changes{v0.1.0}{2024-11-01}{Initial release}
70 % \changes{v0.1.1}{2024-11-14}{Improved documentation}
71 %
72 % \GetFileInfo{rebuttal.sty}
73 %
74 % \DoNotIndex{\newcommand,\newenvironment,\def,\the,\let,\if,\fi,\else,\\}
75 % \DoNotIndex{\newif,\ifx,\ifcase,\or}
76 % \DoNotIndex{\begingroup,\endgroup}
77 %
78 % \title{The \href{https://github.com/sergiud/rebuttal}{\textsf{rebuttal}} package%
79 % \thanks{This document corresponds to \textsf{rebuttal}~\fileversion, dated \filedate.}}
80 % \author{Sergiu % Deitsch\\%
81 % \href{mailto:[email protected]}{\texttt{[email protected]}}%
82 % }
83 % \date{November 14, 2024}
84 %
85 % \maketitle
86 %
87 % \begin{abstract}
88 % The rebuttal \LaTeX\ package provides means for writing structured journal and
89 % conference paper rebuttals.
90 % \end{abstract}
91 %
92 % \section{Introduction}
93 %
94 % A well-structured rebuttal typically consists of the following parts:
95 %
96 % \begin{enumerate}
97 % \item a master list of referee comments and author's replies, and
98 % \item clearly highlighted changes to the manuscript that stem from
99 % reviewers' comments.
100 % \end{enumerate}
101 %
102 % The \textsf{rebuttal} provides markup to support authors in producing the
103 % above content in a consistent manner.
104 %
105 % \section{Usage}
106 %
107 % The following sections provide an overview of the package's functionality for
108 % structuring rebuttals and annotating manuscripts.
109 %
110 % \subsection{Structuring the Rebuttal}
111 %
112 % \DescribeEnv{rebuttal}
113 % \DescribeEnv{comment}
114 % \DescribeEnv{answer}
115 % The packages defines the |rebuttal| environment that can contain several
116 % blocks that refer to editor's or specific reviewers' comments and your replies
117 % to referees' comments. Specifically, the environment accepts an optional
118 % \oarg{title} and is expected to contain a |comment| and an |answer|
119 % environment. The general layout looks as follows:
120 %
121 % \begin{verbatim}
122 % \begin{rebuttal}[Editor's Comments]
123 % \begin{comment}
124 % % Reviewer's comment
125 % \end{comment}
126 % \begin{answer}
127 % % The reply
128 % \end{answer}
129 % \end{rebuttal}
130 % \end{verbatim}
131 %
132 % \subsection{Annotating Changes to the Manuscript}
133 %
134 % \DescribeMacro{\addition}
135 % \DescribeMacro{\deletion}
136 % \DescribeMacro{\change}
137 % Within the manuscript, three main commands can be used to denote additions,
138 % deletions, or changes. The corresponding commands are
139 % |\addition|\oarg{options}\marg{text}, |\deletion|\oarg{options}\marg{text},
140 % and |\change|\oarg{options}\marg{old text}\marg{new text}. While |\addition|
141 % and |\deletion| require a single argument. |\change| expects two arguments,
142 % where the first one denotes the changed text, and the second one the new text.
143 %
144 % All three commands require specifying their labels for referencing the
145 % modifications using the \meta{label} option. Additionally, the \meta{ref}
146 % option back references the original reviewer comment and may specify multiple
147 % labels, \eg
148 %
149 % \begin{verbatim}
150 % \addition[label=a:new,ref={c:c1,c:c2}]{new text}.
151 % \end{verbatim}
152 %
153 % \subsection{Annotating Multiple Paragraphs}
154 %
155 % \DescribeEnv{additionenv}
156 % \DescribeEnv{changeenv}
157 % \DescribeEnv{deletionenv}
158 % Additionally to the provided markup commands, the package also defines
159 % equivalent environments for annotating multiple paragraphs:
160 %
161 % \begin{verbatim}
162 % \begin{additionenv}[label=a:par,ref=c:missing-motivations]
163 % \section{New Experiment}
164 % % new text
165 % \end{additionenv}
166 %
167 % \begin{changeenv}[label=ch:par,ref=c:missing-motivations]{old text}
168 % \section{Improved Experiment}
169 % % new text
170 % \end{changeenv}
171 %
172 % \begin{deletionenv}[label=d:par,ref=c:missing-motivations]
173 % \section{Useless Discussion}
174 % % old text
175 % \end{deletionenv}
176 % \end{verbatim}
177 %
178 % \subsection{Disabling Annotations}
179 %
180 % \DescribeMacro{\rebuttalset}
181 % Once a manuscript has been accepted for publication, rebuttal annotations are
182 % no longer necessary and only the accepted changes should be typeset.
183 % \textsf{rebuttal} allows to disable annotations using the |\rebuttalset|
184 % command by disabling the \meta{marked} option, \ie,
185 % \begin{verbatim}
186 % \rebuttalset{marked=false}
187 % \end{verbatim}
188 % which will disable the annotiations in the current group.
189 %
190 % \section{Known Limitations}
191 %
192 % Rebuttal markup cannot be used within floating environments such as |figure|
193 % and |table|, and the |\caption| command.
194 %
195 % \MaybeStop{\PrintChanges\PrintIndex}
196 %
197 % \section{Implementation}
198 %
199 % \subsection{Package}
200 %
201 % \begin{macrocode}
202 %<*package>
203 % \end{macrocode}
204 % We need to load additional color sets.
205 % \begin{macrocode}
206 \PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}
207 % \end{macrocode}
208 % Package dependencies.
209 % \begin{macrocode}
210 \RequirePackage{calc}
211 \RequirePackage{environ}
212 \RequirePackage{etoolbox}
213 \RequirePackage{marginnote}
214 \RequirePackage{pgfkeys}
215 \RequirePackage{soul}
216 \RequirePackage{tikz}
217 \RequirePackage{todonotes}
218 \RequirePackage{ulem}
219 \RequirePackage{xcolor}
220 \RequirePackage{xstring}
221
222 \AtEndPreamble{
223 \RequirePackage{pdfcomment}
224 }
225
226 \ifx\counterwithin\@undefined
227 \RequirePackage{chngcntr}
228 \fi
229 % \end{macrocode}
230 % \begin{macro}{\rebuttal@triangle}
231 % The following command is used to generate a triangle in the left margin.
232 % \begin{macrocode}
233 \newcommand\rebuttal@triangle{%
234 \begingroup
235 \ifx\tikzexternaldisable\@undefined\else
236 \tikzexternaldisable
237 \fi
238 \begin{tikzpicture}[x=.5em,y=.5em]
239 \fill[/rebuttal/answer/label] (0,0) -- (0,1) -- (.75,.5) -- cycle;
240 \end{tikzpicture}%
241 \endgroup
242 }
243 % \end{macrocode}
244 % \end{macro}
245 % \begin{macro}{\rebuttal@decbookmarklevel}
246 % Unless \textsf{hyperref} was not loaded, the command decrements the current
247 % bookmark level.
248 % \begin{macrocode}
249 \newcommand\rebuttal@decbookmarklevel{%
250 \ifx\Hy@currentbookmarklevel\@undefined\else
251 \@tempcnta\Hy@currentbookmarklevel
252 \advance\@tempcnta by -1 %
253 \xdef\Hy@currentbookmarklevel{\the\@tempcnta}%
254 \fi
255 }
256 % \end{macrocode}
257 % \end{macro}
258
259 % \begin{macro}{\rebuttal@incbookmarklevel}
260 % Unless \textsf{hyperref} was not loaded, the command incements the current
261 % bookmark level.
262 % \begin{macrocode}
263 \newcommand\rebuttal@incbookmarklevel{%
264 \ifx\Hy@currentbookmarklevel\@undefined\else
265 \@tempcnta\Hy@currentbookmarklevel
266 \advance\@tempcnta by 1 %
267 \xdef\Hy@currentbookmarklevel{\the\@tempcnta}%
268 \fi
269 }
270 % \end{macrocode}
271 % \end{macro}
272
273 % \begin{macrocode}
274 \newif\ifrebuttal@marked
275 \newif\ifrebuttal@nohyperlinks
276 \newif\ifrebuttal@refbreak
277 \newif\ifrebuttal@twocolumn
278
279 \pgfkeys{
280 /rebuttal/.is family,
281 /rebuttal/execute on begin/.initial=,
282 /rebuttal/execute on end/.initial=,
283 /rebuttal/no hyperlinks/.is if=rebuttal@nohyperlinks,
284 /rebuttal/no hyperlinks=false,
285 /rebuttal/marked/.is if=rebuttal@marked,
286 /rebuttal/marked=true,
287 /rebuttal/title/font/.store in=\rebuttal@titlefont,
288 /rebuttal/title/font=\normalfont\bfseries,
289 /rebuttal/title/format/.code=#1:,
290 /rebuttal/change/from command/.store in=\rebuttal@changefrom,
291 /rebuttal/change/from command=\sout,
292 /rebuttal/change/from color/.code={\colorlet{rebuttal@change@from}{#1}},
293 /rebuttal/change/from color=DodgerBlue3!50,
294 /rebuttal/deletion/command/.store in=\rebuttal@delete,
295 /rebuttal/deletion/command=\xout,
296 /rebuttal/comment/font/.store in=\rebuttal@commentfont,
297 /rebuttal/comment/font=\normalfont\itshape,
298 /rebuttal/comment/label/font/.store in=\rebuttal@commentlabelfont,
299 /rebuttal/comment/label/font=\normalfont\rmfamily\bfseries,
300 /rebuttal/answer/font/.store in=\rebuttal@answerfont,
301 /rebuttal/answer/font=\normalfont,
302 /rebuttal/answer/label/.store in=\rebuttal@answerlabel,
303 /rebuttal/answer/label={\rebuttal@triangle},
304 /rebuttal/answer/label/font/.store in=\rebuttal@answerlabelfont,
305 /rebuttal/answer/label/font=\normalfont,
306 /rebuttal/answer/label/.style={black!65},
307 /rebuttal/reference/font/.store in=\rebuttal@referencefont,
308 /rebuttal/reference/font={%
309 \tiny\bfseries%
310 },
311 % TODO does not work within \todo
312 %/rebuttal/reference/.code={%
313 %},
314 }
315
316 \let\rebuttalanswerlabel\rebuttal@answerlabel
317
318 \newrobustcmd\rebuttal@reference[1]{%
319 \begingroup
320 \rebuttal@referencefont
321 \begin{tabular}{@{}c@{}}
322 \begingroup
323 \color{rebuttal@#1}%
324 \MakeUppercase{\rebuttal@id}%
325 \csname therebuttal#1\endcsname
326 \endgroup
327 \ifrebuttal@refbreak
328 \\%
329 \else
330 \enspace
331 \fi
332 \normalfont
333 % Reset color (TODO Maybe allow to modify the color)
334 \color{black}%
335 (\pgfkeys{/rebuttal/#1/ref/all})%
336 \end{tabular}%
337 \endgroup
338 }
339
340 \newcommand\rebuttal@define@keys[2]{
341 \pgfkeys{
342 /rebuttal/#1/label/.initial=,
343 /rebuttal/#1/label/.value required,
344 /rebuttal/#1/break/.is if=rebuttal@refbreak,
345 /rebuttal/#1/ref/.initial=,
346 /rebuttal/#1/ref/.value required,
347 /rebuttal/#1/ref/create/.code={
348 \ifrebuttal@nohyperlinks
349 \ref*{##1}%
350 \else
351 \ref{##1}%
352 \fi
353 },
354 /rebuttal/#1/ref/all/.code={%
355 \pgfkeysgetvalue{/rebuttal/#1/ref}\rebuttal@currefs
356 \edef\rebuttal@tmp{\rebuttal@currefs}%
357 \foreach
358 [
359 %expand list,
360 count=\ri from 0,
361 ]
362 \r in \rebuttal@tmp {%
363 \ifnum\ri > 0\relax
364 ,\,%
365 \fi
366 \pgfkeys{/rebuttal/#1/ref/create=\r}%
367 }%
368 },
369 /rebuttal/#1/color/.code={\colorlet{rebuttal@#1}{##1}},
370 /rebuttal/#1/color=#2,
371 /rebuttal/#1/font/.value required,
372 /rebuttal/#1/font/.code={
373 \expandafter\def\csname rebuttal@#1@font\endcsname{##1}%
374 },
375 /rebuttal/#1/font=\normalfont\mdseries,
376 }
377 }
378
379 \rebuttal@define@keys{addition}{RedViolet}
380 \rebuttal@define@keys{deletion}{Firebrick3}
381 \rebuttal@define@keys{change}{DodgerBlue3}
382
383 \newlength\rebuttal@textwidth
384 \newlength\rebuttal@hskip
385
386 \newcommand\rebuttal@command[3]{%
387 \newcounter{rebuttal#1}%
388 \AtEndPreamble{%
389 \@ifpackageloaded{cleveref}{%
390 \crefname{rebuttal#1}{#1}{#1s}%
391 }{}%
392 }%
393 % Marked version with full output
394 \expandafter\newcommand\csname #1\endcsname[#3][]{%
395 \ifrebuttal@marked
396 \stepcounter{rebuttalchanges}%
397 \refstepcounter{rebuttal#1}%
398 \begingroup
399 \tikzset{notestyleraw/.append style={
400 inner sep=\z@,
401 rounded corners=\z@,
402 }}%
403 \pgfqkeys{/rebuttal/#1}{##1}%
404 \label{\pgfkeysvalueof{/rebuttal/#1/label}}%
405 \colorlet{Changes@Color}{rebuttal@#1}%
406 \begingroup
407 % \end{macrocode}
408 % Main content.
409 % \begin{macrocode}
410 #2%
411 \endgroup
412 \StrLeft{#1}{1}[\rebuttal@id]%
413 \ifx\tikzexternaldisable\@undefined\else
414 \tikzexternaldisable
415 \fi
416 % \end{macrocode}
417 % Shrink to text.
418 % \begin{macrocode}
419 \settowidth\rebuttal@textwidth{\rebuttal@reference{#1}}%
420 \tikzset{notestyleraw/.append style={text width=\rebuttal@textwidth}}%
421 % \end{macrocode}
422 % Place labels in left margin at the same distance as on the right.
423 % \begin{macrocode}
424 \setlength\rebuttal@hskip{\marginparwidth}%
425 \addtolength\rebuttal@hskip{-\rebuttal@textwidth}%
426 \let\old@xmpar\@xmpar
427 % \end{macrocode}
428 % Hook into \LaTeX\ kernel command since |\if@firstcolumn| is not unreliable
429 % because margin notes are floats.
430 % \begin{macrocode}
431 \renewcommand\@xmpar[2][]{%
432 \old@xmpar[\hspace*{\rebuttal@hskip}####1]{####2}%
433 }%
434 \todo
435 [
436 backgroundcolor=none,
437 bordercolor=none,
438 linecolor=rebuttal@#1,
439 %size=\tiny,
440 ]{%
441 \rebuttal@reference{#1}%
442 %\pgfkeys{/rebuttal/reference=#1}
443 }%
444 \endgroup
445 \else
446 #2%
447 \fi
448 }%
449 }
450 % \end{macrocode}
451
452 % \begin{environment}{additionenv}
453 % Provide an equivalent environment for the |\addition| command.
454 % \begin{macrocode}
455 \NewEnviron{additionenv}[1][]{%
456 \addition[#1]{\BODY}%
457 }%
458 % \end{macrocode}
459 % \end{environment}
460
461 % \begin{environment}{changeenv}
462 % Provide an equivalent environment for the |\change| command.
463 % \begin{macrocode}
464 \NewEnviron{changeenv}[2][]{%
465 \change[#1]{#2}{\BODY}%
466 }%
467 % \end{macrocode}
468 % \end{environment}
469
470 % \begin{environment}{deletionenv}
471 % Provide an equivalent environment for the |\deletion| command.
472 % \begin{macrocode}
473 \NewEnviron{deletionenv}[1][]{%
474 \deletion[#1]{\BODY}%
475 }%
476 % \end{macrocode}
477 % \end{environment}
478
479 % \begin{macrocode}
480 \newcommand\rebuttal@added[1]{%
481 \ifrebuttal@marked
482 \rebuttal@addition@font%
483 \textcolor{rebuttal@addition}{#1}%
484 \else
485 #1%
486 \fi
487 }
488
489 \newcommand\rebuttal@deleted[1]{%
490 \ifrebuttal@marked
491 \rebuttal@deletion@font%
492 \textcolor{rebuttal@deletion}{\rebuttal@delete{#1}}%
493 \fi
494 }
495
496 \newcommand\rebuttal@replaced[2]{%
497 \ifrebuttal@marked
498 \rebuttal@change@font%
499 \textcolor{rebuttal@change@from}{\rebuttal@changefrom{#1}}%
500 \allowbreak
501 \textcolor{rebuttal@change}{#2}%
502 \else
503 #2%
504 \fi
505 }
506
507 \rebuttal@command{addition}{\rebuttal@added{#2}}{2}
508 \rebuttal@command{deletion}{\rebuttal@deleted{#2}}{2}
509 \rebuttal@command{change}{\rebuttal@replaced{#2}{#3}}{3}
510
511 \newcounter{rebuttalcomments}
512 \newcounter{rebuttalchanges}
513
514 \newcounter{rebuttal}
515 \newcounter{rebuttalcomment}
516 \newcounter{rebuttalanswer}
517
518 \renewcommand\therebuttalcomment{%
519 \arabic{rebuttal}.\arabic{rebuttalcomment}%
520 }
521
522 \let\theHrebuttalcomment\therebuttalcomment
523
524 \renewcommand\therebuttalanswer{%
525 \therebuttalcomment%
526 }
527
528 \counterwithin*{rebuttalcomment}{rebuttal}%
529 \counterwithin*{rebuttalanswer}{rebuttalcomment}%
530
531 \newdimen\rebuttal@labelsep
532 % \end{macrocode}
533
534 % \begin{macro}{\rebuttal@startlinkguard}
535 % Disable hyperlinks if |NoHyper| environment is available.
536 % \begin{macrocode}
537 \newcommand\rebuttal@startlinkguard{%
538 \ifx\NoHyper\@undefined\else
539 \ifrebuttal@nohyperlinks
540 \begin{NoHyper}%
541 \fi
542 \fi
543 }
544 % \end{macrocode}
545 % \end{macro}
546
547 % \begin{macro}{\rebuttal@startlinkguard}
548 % End of disable hyperlinks if |NoHyper| environment is available.
549 % \begin{macrocode}
550 \newcommand\rebuttal@endlinkguard{
551 \ifx\endNoHyper\@undefined\else
552 \ifrebuttal@nohyperlinks
553 \end{NoHyper}%
554 \fi
555 \fi
556 }
557 % \end{macrocode}
558 % \end{macro}
559
560 % TODO Comment labels tooltips
561 % \begin{environment}{rebuttal}
562 % The main environment that defines the remaining ones.
563 % \changes{v0.1.1}{2024-11-14}{Fixed incorrect bookmark structure}
564 % \begin{macrocode}
565 \newenvironment{rebuttal}[1][]{%
566 \rebuttal@startlinkguard
567 % \end{macrocode}
568 % Execute user code.
569 % \begin{macrocode}
570 \pgfkeysvalueof{/rebuttal/execute on begin}%
571 \begingroup
572 \refstepcounter{rebuttal}%
573 \if@twocolumn
574 \onecolumn
575 % \end{macrocode}
576 % Remember the layout.
577 % \begin{macrocode}
578 \rebuttal@twocolumntrue
579 \else
580 \rebuttal@twocolumnfalse
581 \fi
582 \begingroup
583 \par
584 \addvspace{\bigskipamount}%
585 \ifstrempty{#1}{}{%
586 % \end{macrocode}
587 % In case the current bookmark level is 0, we leave it as is. Otherwise, we
588 % increment the level to anchor the following bookmarks below the current
589 % bookmark. This ensures that the bookmark structure is correct even if the
590 % document either does not use or provides structuring commands (\eg,
591 % missing |\section| in a \textsf{scrlttr2} document).
592 % \begin{macrocode}
593 \ifx\Hy@currentbookmarklevel\@undefined\else
594 \ifnum\Hy@currentbookmarklevel>0
595 \@tempcnta\Hy@currentbookmarklevel
596 \advance\@tempcnta by 1 %
597 \xdef\Hy@currentbookmarklevel{\the\@tempcnta}%
598 \fi
599 \fi
600 \ifx\currentpdfbookmark\@undefined\else
601 \currentpdfbookmark{#1}{rebuttalcomment.\therebuttalcomment}%
602 \fi
603 \noindent\bgroup\rebuttal@titlefont\strut
604 \pgfkeys{/rebuttal/title/format=#1}\egroup%
605 }%
606 \par%
607 \@afterheading
608 \vspace*{\medskipamount}%
609 \begin{trivlist}%
610 \let\rebuttal@oldmakelabel\makelabel%
611 \renewcommand\makelabel[1]{\llap{\rebuttal@commentlabelfont ##1}}%
612 \labelwidth\z@
613 %\setlength{\parsep}{\smallskipamount}%
614 %\setlength{\labelsep}{1pt}%
615 %\setlength{\topsep}{\z@}%
616 %\setlength{\partopsep}{\bigskipamount}
617 \let\comment\@undefined
618 \let\endcomment\@undefined
619 \newenvironment{comment}{%
620 \rebuttal@incbookmarklevel
621 \apptocmd\@item{%
622 \ifx\currentpdfbookmark\@undefined\else
623 \currentpdfbookmark{Comment~\therebuttalcomment}{rebuttalcomment.\therebuttalcomment}%
624 \fi
625 }{%
626 \PackageInfo{rebuttal}{The \string\@item\space command was patched to
627 provide comment bookmarks.}%
628 }{%
629 \PackageWarning{rebuttal}{Failed to patch the \string\@item\space command.
630 Bookmarks may not be displayed correctly.}%
631 }%
632 % \end{macrocode}
633 % Do not allow to place answers within a comment by undefining the answer
634 % environment
635 % \begin{macrocode}
636 \let\answer\@undefined
637 \let\endanswer\@undefined
638 \stepcounter{rebuttalcomments}%
639 \refstepcounter{rebuttalcomment}
640 %\settowidth{\labelwidth}{\rebuttal@commentlabelfont #1}
641 %\addtolength{\labelwidth}{1em}
642 \item
643 [%
644 \therebuttalcomment%
645 ]%
646 \begingroup
647 \rebuttal@commentfont
648 \let\makelabel\rebuttal@oldmakelabel
649 }{%
650 \endgroup
651 \rebuttal@decbookmarklevel
652 }
653 \newenvironment{answer}{%
654 \par\medskip
655 \@afterheading
656 \rebuttal@incbookmarklevel
657 \begin{trivlist}
658 \ifx\belowpdfbookmark\@undefined\else
659 \belowpdfbookmark{Anwser to~\therebuttalcomment}{rebuttalanswer.\therebuttalanswer}%
660 \fi
661 \normalfont\rebuttal@answerfont%
662 \rebuttal@labelsep\labelsep%
663 \newcommand\rebuttal@makelabel[1]{\rebuttal@answerlabelfont ####1\enspace}
664 \renewcommand\makelabel[1]{\rebuttal@makelabel{####1}}%
665 \labelsep\z@
666 \labelwidth\z@
667 \let\makelabel\empty
668 %\settowidth\labelwidth{\rebuttal@makelabel{\rebuttal@answerlabel}}%
669 \item
670 [%
671 \ifx\pdftooltip\@undefined
672 \llap{\rebuttal@answerlabel\enspace}%
673 \else
674 \llap{\pdftooltip{\rebuttal@answerlabel}{Reply}\enspace}%
675 \fi
676 ]%
677 \begingroup
678 \labelsep\rebuttal@labelsep
679 \refstepcounter{rebuttalanswer}%
680 }{%
681 \endgroup
682 \end{trivlist}%
683 \rebuttal@decbookmarklevel
684 }
685 }{%
686 \end{trivlist}%
687 \rebuttal@decbookmarklevel
688 \endgroup
689 \par\addvspace{\bigskipamount}%
690 \ifrebuttal@twocolumn
691 % \end{macrocode}
692 % Restore the layout.
693 % \begin{macrocode}
694 \twocolumn
695 \fi
696 \endgroup
697 % \end{macrocode}
698 % Execute user code.
699 % \begin{macrocode}
700 \pgfkeysvalueof{/rebuttal/execute on end}%
701 \rebuttal@endlinkguard
702 }
703 % \end{macrocode}
704 % \end{environment}
705
706 % Support \textsf{cleveref}.
707 % \begin{macrocode}
708 \AtEndPreamble{%
709 \@ifpackageloaded{cleveref}{%
710 \crefname{rebuttalcomment}{comment}{comments}
711 \crefname{rebuttalanswer}{answer}{answers}
712 \Crefname{rebuttalcomment}{Comment}{Comments}
713 \Crefname{rebuttalanswer}{Answer}{Answers}
714 }{}
715 }
716
717 \newcommand\rebuttaltotalcomments{%
718 \textbf{??}%
719 \@latex@warning{Reference \string\rebuttaltotalcomments\space on page \thepage\space undefined}%
720 }
721
722 \newcommand\rebuttaltotalchanges{%
723 \textbf{??}%
724 \@latex@warning{Reference \string\rebuttaltotalchanges\space on page \thepage\space undefined}%
725 }
726
727 \AtEndDocument{%
728 \immediate\write\@auxout{%
729 \gdef\string\rebuttaltotalcomments{\arabic{rebuttalcomments}}%
730 \gdef\string\rebuttaltotalchanges{\arabic{rebuttalchanges}}%
731 }
732 }
733 % \end{macrocode}
734 % \begin{macro}{\rebuttalset}\marg{options}
735 % Allows to update package options.
736 % \begin{macrocode}
737 \newcommand\rebuttalset[1]{%
738 \pgfqkeys{/rebuttal}{#1}%
739 }
740 %</package>
741 % \end{macrocode}
742 % \end{macro}
743 %
744 % \subsection{Example}
745 %
746 % \begin{macrocode}
747 %<*example1>
748 \documentclass[american,version=last,fromphone,fromemail,svgnames,dvipsnames,x11names]{scrlttr2}
749 \usepackage[T1]{fontenc}
750 \usepackage[utf8]{inputenc}
751 \usepackage[babel]{csquotes}
752 \usepackage{babel}
753 \usepackage{graphicx}
754 \usepackage{microtype}
755 \usepackage{lipsum}
756 \usepackage{rebuttal}
757 \usepackage{varioref}
758 \usepackage{hyperref}
759 \usepackage{cleveref}
760
761 \hypersetup{colorlinks=true}
762
763 \setkomavar{fromname}{Jane Smith}
764 \setkomavar{fromaddress}{%
765 Pattern Recognition Lab\\
766 University of Erlangen-Nürnberg
767 }
768 \setkomavar{backaddress}{}
769 \setkomavar{fromphone}{$+49$\,(0)\,12345678}
770 \setkomavar{fromemail}{[email protected]}
771 \setkomavar{place}{Erlangen}
772
773 \begin{document}
774
775 \setkomavar{subject}{Manuscript: Extended Field of View in C-Arm Computed
776 Tomography for Weight-Bearing Imaging}
777
778 \begin{letter}{Medical Physics}
779
780 \opening{Dear Prof. Jones, Dear Prof. Taylor,}
781
782 We thank you for considering our submission as a research article for Medical
783 Physics. We also thank the reviewers for the thoughtful comments. We have
784 carefully revised the document and prepared a point-by-point response to the
785 reviewer’s comments.
786
787 The major changes to the paper are:
788 \begin{itemize}
789 \item Clarification of the medical impact
790 \item An extension of the evaluation and discussion to 3D Cone Beam CT and
791 off-center positioning of the object
792 \item Inclusion of more substantive figure captions
793 \end{itemize}
794
795 Below, you will find the reviewers’ comments in blue, our response in normal
796 face and additions to the manuscript in quotes and \enquote{italic face.} Note
797 that we omitted footnotes and references in the quotations.
798
799 We are looking forward to hearing from you.
800
801 \closing{With kind regards,}
802
803 \end{letter}
804 \include{rebuttal}
805 \end{document}
806 %</example1>
807 % \end{macrocode}
808 %
809 % \begin{macrocode}
810 %<*example2>
811 \documentclass{article}
812 \usepackage{rebuttal}
813 \usepackage[colorlinks]{hyperref}
814 \usepackage{lipsum}
815 \usepackage{cleveref}
816
817 \begin{document}
818 \section{Test}
819 \input{rebuttal}
820 \end{document}
821 %</example2>
822 % \end{macrocode}
823 %
824 % \begin{macrocode}
825 %<*rebuttal-comments>
826
827 The following pages contain a list of editor's and reviewers' comments followed
828 by our replies. The comments are sequentially numbered and associated either
829 with the editor or the corresponding reviewer. The replies may contain
830 references to changes in the original manuscript which are identified by a label
831 consisting of a running number and followed by the label of the original comment
832 in parentheses. The label back references the original reviewer comment within
833 the manuscript. For instance, the reference \textbf{C2~(1.3)}, which is typeset
834 in the manuscript margin, refers to the second change stemming from the third
835 comment of the first reviewer.
836
837 \begin{rebuttal}[Editor's Comments]
838 \begin{comment}
839 The topic of this manuscript is of interest. We concur with the summary review
840 of the associate editor and the reviews of the referees. The authors should
841 thoroughly address all of the comments, below, in a revised manuscript.
842 \end{comment}
843
844 \end{rebuttal}
845
846 \begin{rebuttal}[Specific Comments]
847 \begin{comment}
848 \label{c:specific}
849 You need to include figure captions that make your figures intelligible.
850 See~\cref{a:foo} and \cref{c:foo2}.
851 \end{comment}
852
853 \begin{answer}
854 The reviewer is right. We have reworked the figure captions to make the
855 figures more independent of the text. Furthermore, check if lists are
856 typeset correctly:
857 \begin{itemize}
858 \item One
859 \item Two
860 \begin{enumerate}
861 \item Three
862 \item Four
863 \end{enumerate}
864 \end{itemize}
865 \end{answer}
866
867 \begin{comment}
868 \label{c:c2}
869 Are you going to pay for color in the print article? If not, the lines are
870 not intelligible in Figures 2, 5, 11. In addition to color coding for the
871 digital version, you could make lines with distinct patterns (dots, dashes,
872 etc.) so they are distinct in monochrome presentations.
873 \end{comment}
874
875 \begin{answer}
876 We agree with this point and we are sorry that we missed this in the first
877 version of the article. The article will appear as an online only version
878 and is part of the special issue associated with this year’s CT Meeting
879 conference. Thus there will be no additional cost associated with color
880 figures. Nonetheless, we agree that all figures need to be correct in
881 grey-scale as some readers might print the article. According to the
882 reviewer’s comment, we have adjusted the figures by using different patterns
883 and gray levels.
884
885 (Refer also to \cref{c:specific} for more information.)
886 \end{answer}
887 \end{rebuttal}
888
889 \lipsum[1] \addition[label=a:foo,ref=c:specific]{\lipsum[2]} \lipsum[3]
890
891 \lipsum[4] \deletion[label=a:foo1,ref=c:c2]{An unintended addition.}
892 and a \change[label=c:foo2,ref=c:c2]{from}{to} change. And another addition
893 \addition[label=a:foo3,ref=c:c2]{here}.
894 Also \addition[label=a:foo4,ref=c:c2]{here}.
895 Maybe \addition[label=a:foo5,ref=c:c2]{here}.
896 Additionally \addition[label=a:foo6,ref=c:c2]{here}.
897 Additionally \addition[label=a:foo7,ref=c:c2]{here}.
898
899 \begin{additionenv}[label=d:par,ref=c:c2]
900 \begin{itemize}
901 \item \lipsum[1]
902 \end{itemize}
903 \lipsum[2]
904 \end{additionenv}
905
906 Additional notes:
907 \begin{itemize}
908 \item Multiple source references can be
909 \addition[label=a:foo8,ref={c:specific,c:c2}]{specified}.
910 \item If the references do not fit into a single line in the margin, you may
911 force a \addition[label=a:break,ref={c:specific,c:c2},break]{break}.
912 \end{itemize}
913 %</rebuttal-comments>
914 % \end{macrocode}
915 %
916 % \Finale
917
918 % \endinput
919
920 % vim: ft=tex