pdfcomment
TODOs und Review-Kommentare als PDF-Anmerkungen und hervorgehobener Text (\textcomment, \sidecomment, \change).
- Example
- Preamble
\textmarker{Markierter Text.}
\textcomment{Markierter Text.}{Kommentar dazu.}
\modified{Manuelle Markierung für Text, der seit der letzten Version geändert wurde.}
Das ist ein Text.
\change{FL1: Text angepasst}{Geänderter Text}.
Hier nur ein Kommentar\sidecomment{Kommentar}.
\todo{Hier muss noch kräftig Text produziert werden}
\TODO{Evaluation ergänzen}
\FIXME{Die Zahlen sind veraltet}
Die meisten wissenschaftlichen Texte der Informatik werden mit \LaTeX{} geschrieben~\CITE{Umfrage zu den Werkzeugen beim Schreiben}.
Die Quantenmechanik entwickelte sich dank der Arbeiten von Schrödinger, Heisenberg und Dirac rasch,
die sich von früheren Ideen von Planck \FA{und Einstein} \FA[Einstein darf hier nicht fehlen.] inspirieren ließen.
\FA*{Dieser Satz soll entfernt werden.} \FA!{Das ist wichtig.}
% TODO (and comment) configuration
%
% - \todo (from zebra, todonotes, luatodonotes), or \TODO - for "normal" TODOs
% - \todofix, or \FIXME - "important" TODOs
% - \CITE - a claim that still needs a citation
%
% - \textcomment{text}{comment} - comments on a text passage (pdfcomment: highlights the text and shows the comment on hover; otherwise: the text followed by \todo{comment})
% - \sidecomment - just puts a comment to the side. Note: \comment is the comment environment of several packages (mathdesign, mindflow, verbatim, and others); only zebra adds \comment[name]{...} as command
%
% - \missingfigure
%
% - \textmarker
% - \modified
% - \change - addresses a review comment
% Enable nice comments
\usepackage{pdfcomment}
\ifdefined\directlua
% Highlighting that breaks across lines (\colorbox does not): lua-ul's \highLight; the color needs luacolor
\usepackage{luacolor,lua-ul}
\newcommand{\textcomment}[2]{\highLight[yellow!60]{#1}\pdfcomment[color={0.234 0.867 0.211},hoffset=-6pt,voffset=10pt,opacity=0.5]{#2}}
\else
\newcommand{\textcomment}[2]{\colorbox{yellow!60}{#1}\pdfcomment[color={0.234 0.867 0.211},hoffset=-6pt,voffset=10pt,opacity=0.5]{#2}}
\fi
% Small PDF comment
% 1st parameter: comment
\newcommand{\sidecomment}[1]{\pdfcomment[color={0.045 0.278 0.643},voffset=4pt,icon=Note]{#1}}
% Disabled variant - for the final PDF
%\newcommand{\sidecomment}[1]{}
\newcommand{\todo}[1]{TODO!\sidecomment{#1}}
% Changes
%
% 1st parameter: review comment
% 2nd parameter: new text
\newcommand{\change}[2]{{\color{red}#2}\pdfcomment[color={0.234 0.867 0.211},voffset=8pt,opacity=0.5]{#1}}
% Disabled variant - for the final PDF
%\newcommand{\change}[2]{#2}
% Define default commands
\makeatletter
\@ifundefined{missingfigure}{\newcommand{\missingfigure}{\ldots\ missing figure \ldots}}{}
\@ifundefined{textcomment}{\newcommand{\textcomment}[2]{#1 \todo{#2}}}{}
\@ifundefined{sidecomment}{\newcommand{\sidecomment}[1]{\marginpar{#1}}}{}
\@ifundefined{todo}{\newcommand{\todo}[1]{\sidecomment{#1}}}{}
\@ifundefined{TODO}{\newcommand{\TODO}[1]{\todo{#1}}}{}
\@ifundefined{todofix}{\newcommand{\todofix}[1]{\todo{#1}}}{}
\@ifundefined{FIXME}{\newcommand{\FIXME}[1]{\todofix{#1}}}{}
\@ifundefined{CITE}{\newcommand{\CITE}[1]{\todo{Citation needed: #1}}}{}
\@ifundefined{change}{\newcommand{\change}[2]{#1 $\rightarrow$ #2}}{}
\makeatother
% Textmarker (Textfarbe rot)
\newcommand{\textmarker}[1]{{\color{red} #1}\xspace}
% Modified (Text blau)
\newcommand{\modified}[1]{{\color{blue!60!black} #1}\xspace}
% Edits and comments by several authors, each with their own color and initials (phfcc)
% Doc: https://ctan.org/pkg/phfcc
\usepackage{phfcc}
\ifdefined\directlua
\phfSetDefaultCommentingStyle{style=rmstrikethrough} % strike through removed text across lines (LuaLaTeX only)
\fi
% Comments as footnotes keep the layout intact, e.g., to check page limits
%\phfSetDefaultCommentingStyle{style=footcomments}
% One command per author: \FA{added text}, \FA*{text to remove}, \FA[a comment], \FA!{important};
% the initials appear once per page in the margin; the forms do not combine (\FA*[...]{...} is only a comment), so
% write \FA*{removed}\FA[comment]. Add one line per further author with their initials.
\phfMakeCommentingCommand[initials={FA}]{FA} % first author
% Final version: hide all edits and comments (there is no class option for it: "final" is the default of every class)
%\phfDisableCommentingCommands