|
| 1 | +%% |
| 2 | +%% This is file `comments.sty', |
| 3 | +%% |
| 4 | +%% Copyright (C) 1991 -- 2001 by Torsten Schaub, |
| 5 | +%% all rights reserved. |
| 6 | +%% Please report errors to: Torsten Schaub |
| 7 | + |
| 8 | +\ProvidesPackage{comments}[2001/03/09 v0.7 The comments package] |
| 9 | +\RequirePackage[normalem]{ulem} |
| 10 | +\RequirePackage{ifthen} |
| 11 | +\RequirePackage{changepage} |
| 12 | +\RequirePackage{framed} |
| 13 | + |
| 14 | +\newenvironment{oldstuff} { \definecolor{shadecolor}{named}{Gray} \begin{shaded} \label{comment:\thecommentctr} \stepcounter{commentctr} } { \end{shaded} } |
| 15 | +\newenvironment{newstuff} { \definecolor{shadecolor}{named}{Lavender} \begin{shaded} \label{comment:\thecommentctr} \stepcounter{commentctr} } { \end{shaded} } |
| 16 | + |
| 17 | +\newif\ifreversecommentsidepar |
| 18 | + \reversecommentsidepartrue |
| 19 | +\newif\ifcommentsideparswitch |
| 20 | + \commentsideparswitchfalse |
| 21 | +\if@twoside \commentsideparswitchtrue \fi |
| 22 | + |
| 23 | +\newlength{\commentsideparvshift} |
| 24 | +%%%% \setlength{\commentsideparvshift}{-2.08ex}% seems to work for all font sizes |
| 25 | + |
| 26 | +\newcommand{\commentsidepar}{\@dblarg{\@commentsidepar}} |
| 27 | +\long\def\@commentsidepar[#1]#2{\@bsphack\strut\vadjust{% |
| 28 | + \checkoddpage |
| 29 | + \ifcommentsideparswitch |
| 30 | + \ifreversecommentsidepar |
| 31 | + \ifoddpage |
| 32 | + \oddpagefalse |
| 33 | + \else |
| 34 | + \oddpagetrue |
| 35 | + \fi |
| 36 | + \fi |
| 37 | + \else |
| 38 | + \oddpagetrue |
| 39 | + \ifreversecommentsidepar |
| 40 | + \oddpagefalse |
| 41 | + \fi |
| 42 | + \fi |
| 43 | + \rlap{\kern-\parindent |
| 44 | + \if@twocolumn |
| 45 | + \if@firstcolumn% put at left |
| 46 | + \kern -\marginparsep \kern -\marginparwidth |
| 47 | + \else% put at right |
| 48 | + \kern \columnwidth \kern \marginparsep |
| 49 | + \fi |
| 50 | + \else |
| 51 | + %\ifoddpage% put at right |
| 52 | + \kern \textwidth \kern \marginparsep |
| 53 | + %\else% put at left |
| 54 | + %\kern -\marginparsep \kern -\marginparwidth |
| 55 | + %\fi |
| 56 | + \fi |
| 57 | + \setbox0=\vtop to 0pt{% |
| 58 | + \begin{minipage}[t]{\marginparwidth}% |
| 59 | + \normalfont\normalsize |
| 60 | + \ifoddpage #2\else #1\fi% |
| 61 | + \end{minipage}% |
| 62 | + \vss}% |
| 63 | + \vtop to 0pt{\kern\commentsideparvshift% default should be 0pt |
| 64 | + \kern-\dp\strutbox |
| 65 | + \kern-\ht0 |
| 66 | + \box0 \vss}}}% |
| 67 | + \@esphack} |
| 68 | +\setlength{\commentsideparvshift}{0pt} |
| 69 | + |
| 70 | +%% -- declarations -------------------------------------------------- |
| 71 | +\def\TODAY{\number\day/\ifcase\month\or 01\or 02\or 03\or 04\or 05\or |
| 72 | + 06\or 07\or 08\or 09\or 10\or 11\or 12\fi/\number\year} |
| 73 | +\def\timenow{% |
| 74 | + \@tempcnta=\time \divide\@tempcnta by 60 \number\@tempcnta:\multiply |
| 75 | + \@tempcnta by 60 \@tempcntb=\time \advance\@tempcntb by -\@tempcnta |
| 76 | + \ifnum\@tempcntb <10 0\number\@tempcntb\else\number\@tempcntb\fi} |
| 77 | +\def\MFONT{\scriptsize\rm} |
| 78 | +\def\BFONT{\scriptsize\it} |
| 79 | +\def\VERSION{\jobname.tex \ \ \TODAY~at~\timenow\ \ \ page \thepage} |
| 80 | +\def\DRAFTMSG{\small\it --- Preliminary Draft --- \today\ --- } |
| 81 | + |
| 82 | +%\addtolength{\oddsidemargin}{-14mm} % let's have a big right margin |
| 83 | +%\addtolength{\evensidemargin}{-14mm} % for \comments |
| 84 | + |
| 85 | +%\setlength{\marginparwidth}{29mm} % Breite |
| 86 | +%\setlength{\marginparsep}{1mm} % Abstand vom Rand |
| 87 | +%\setlength{\marginparpush}{0mm} % space between 2 marginpars |
| 88 | +%\setlength{\fboxsep}{.1mm} |
| 89 | + |
| 90 | +%% -- counters -------------------------------------------------- |
| 91 | +\newcounter{commentctr} |
| 92 | + |
| 93 | +%% -- ulem-based commands --------------------------------------- |
| 94 | +\newcommand{\CHD}[1]{\uwave{#1}\comment{CHANGED}} |
| 95 | + |
| 96 | +\newcommand{\DELETE}[2]{\sout{#1}\comment{DELETE{#2}}} |
| 97 | +\newcommand{\DEL}[1]{\DELETE{#1}{\ignorespaces}} |
| 98 | +\newcommand{\DELc}[2]{\DELETE{#1}{\par {#2}}} |
| 99 | + |
| 100 | +\newcommand{\INSERT}[2]{\uline{#1}\comment{INSERT{#2}}} |
| 101 | +\newcommand{\INS}[1]{\INSERT{#1}{\ignorespaces}} |
| 102 | +\newcommand{\INSc}[2]{\INSERT{#1}{\par {#2}}} |
| 103 | + |
| 104 | +\newcommand{\REPLACE}[3]{\sout{#1}\comment{REPLACE{#3}}\uline{#2}} |
| 105 | +\newcommand{\REP}[2]{\REPLACE{#1}{#2}{\ignorespaces}} |
| 106 | +\newcommand{\REPc}[3]{\REPLACE{#1}{#2}{\par {#3}}} |
| 107 | + |
| 108 | +\newcommand{\REPd}[2]{\REPLACE{}{#2}{D:\par {#1}}} |
| 109 | + |
| 110 | +%% -- commands -------------------------------------------------- |
| 111 | +\newcommand{\howmanycoms}{% |
| 112 | +\begin{center} |
| 113 | +\frame{\Large\bf There are \thecommentctr\ comments to be addressed !!!} |
| 114 | +\message{*** THERE ARE *\thecommentctr* COMMENTS ***} |
| 115 | +\end{center} |
| 116 | +} |
| 117 | + |
| 118 | +\newcommand{\com}[1]% |
| 119 | +{%\message{Attention ... #1 ...}% |
| 120 | + \mbox{}\\ |
| 121 | + \noindent |
| 122 | + \phantomsection |
| 123 | + \label{comment:\thecommentctr} |
| 124 | + \framebox[\linewidth][c]{\stepcounter{commentctr}{\parbox[t]{\textwidth}{\centering \BFONT\thecommentctr: #1}}} |
| 125 | + %\framebox[\linewidth][c]{\stepcounter{commentctr}{\BFONT\thecommentctr: \parbox[][][c]{\textwidth-4em}{#1}}} |
| 126 | + \ignorespaces |
| 127 | +} |
| 128 | +% -------------------------------------------------- |
| 129 | +\newcommand{\margincomment}[1]% |
| 130 | +{% |
| 131 | + {% |
| 132 | + \setlength{\fboxsep}{1pt}% |
| 133 | + % decide whether to use sidepar/marginpar depending on \ifinner??? |
| 134 | + \commentsidepar{\raggedright\hspace{0pt}\parbox[t]{1.76\marginparwidth}{\MFONT{#1}}}% |
| 135 | + }% |
| 136 | + \ignorespaces |
| 137 | +} |
| 138 | +% -------------------------------------------------- |
| 139 | +\newcommand{\comment}[1]% |
| 140 | +{% |
| 141 | + \phantomsection |
| 142 | + \label{comment:\thecommentctr}% |
| 143 | + \stepcounter{commentctr}% |
| 144 | + \margincomment{\raisebox{.1ex}{\framebox{\rm\thecommentctr}}\ #1}% |
| 145 | + {\setlength{\fboxsep}{1pt}% |
| 146 | + \raisebox{.3ex}{{\tiny\framebox{\rm\thecommentctr}}}% |
| 147 | + }% |
| 148 | +%\setlength{\fboxsep}{3pt}% |
| 149 | + \message{Attention ... COMMENT *\thecommentctr* ...}% |
| 150 | + \ignorespaces} |
| 151 | +% -------------------------------------------------- |
| 152 | +\newcommand{\new}[1]{#1\comment{NEW!}} |
| 153 | +% -------------------------------------------------- |
| 154 | +\newcommand{\tbf}{\com{TO BE FILLED}} |
| 155 | +\newcommand{\tbfc}[1]{\margincomment{#1}\tbf} |
| 156 | +% |
| 157 | +\newcommand{\tbr}{\com{TO BE REFINED}} |
| 158 | +\newcommand{\tbrc}[1]{\margincomment{#1}\tbr} |
| 159 | +% |
| 160 | +\newcommand{\tbc}{\com{TO BE COMPLETED}} |
| 161 | +\newcommand{\tbcc}[1]{\margincomment{#1}\tbc} |
| 162 | +% |
| 163 | +\newcommand{\tbrw}{\com{TO BE REWRITTEN}} |
| 164 | +\newcommand{\tbrwc}[1]{\margincomment{#1}\tbrw} |
| 165 | +% |
| 166 | +\newcommand{\comc}[2]{\margincomment{#2}\com{#1}} |
| 167 | +% |
| 168 | +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 169 | + |
| 170 | +% |
| 171 | +\renewcommand{\@oddfoot}{\hbox to \textwidth{% |
| 172 | +$\bullet\bullet\bullet\quad$% |
| 173 | +\DRAFTMSG\/% |
| 174 | +$\quad\bullet\bullet\bullet$% |
| 175 | +\hfil% |
| 176 | +{\thepage:\small\#\thecommentctr} --- $\bigcirc_R\ \bigcirc_M$}% |
| 177 | +} |
| 178 | +\renewcommand{\@evenfoot}{\@oddfoot} |
| 179 | +\renewcommand{\@oddhead}{\null\hfil\scriptsize\rm\VERSION\ {\#\thecommentctr}} |
| 180 | +\renewcommand{\@evenhead}{\@oddhead} |
| 181 | + |
| 182 | +\newcommand{\stamp}{\date{% |
| 183 | + \begin{tabular}{|ccc|} |
| 184 | + \multicolumn{3}{c}{\it --- Preliminary Draft ---} |
| 185 | + \\[2ex]\hline |
| 186 | + \texttt{\jobname.tex} &---& \texttt{\today} at \texttt{\timenow{h}} |
| 187 | + \\ |
| 188 | + \textit{Read} {\LARGE $\bigcirc$} && \textit{Modified} {\LARGE $\bigcirc$} |
| 189 | + \\[1pt]\hline |
| 190 | + \end{tabular}}} |
| 191 | + |
| 192 | +\newcommand{\forloop}[5][1]{% |
| 193 | + \setcounter{#2}{#3}% |
| 194 | + \ifthenelse{#4}{#5\addtocounter{#2}{#1}\forloop[#1]{#2}{\value{#2}}{#4}{#5}}{}% |
| 195 | +} |
| 196 | + |
| 197 | +\AtBeginDocument{% |
| 198 | +\stamp |
| 199 | +} |
| 200 | + |
| 201 | +\AtEndDocument{% |
| 202 | +\newpage |
| 203 | +{\vfill\noindent\large |
| 204 | +This article was processed using the comments style on \today.\\ |
| 205 | +There are \thecommentctr\ comments to be processed: |
| 206 | +\hfill$\bigcirc_\mathit{Read}\ \bigcirc_\mathit{Modified}$\\ |
| 207 | +\newcounter{ct}% |
| 208 | +\newcounter{lastct}% |
| 209 | +\setcounter{lastct}{\thecommentctr}% |
| 210 | +\addtocounter{lastct}{-1} |
| 211 | +\forloop{ct}{0}{\value{ct} < \thecommentctr}{% |
| 212 | +\pageref{comment:\thect}\ifthenelse{\value{ct} < \thelastct}{,}{ } |
| 213 | +}% |
| 214 | +}% |
| 215 | +\message{*** THERE ARE *\thecommentctr* COMMENTS ***}% |
| 216 | +\clearpage |
| 217 | +} |
| 218 | + |
| 219 | + |
0 commit comments