| 1 |
\NeedsTeXFormat{LaTeX2e} |
| 2 |
\ProvidesPackage{fixmetodonotes}[2013/04/28 v0.2.2] |
| 3 |
|
| 4 |
|
| 5 |
\newif\if@NOTES@enabled \@NOTES@enabledtrue |
| 6 |
|
| 7 |
\DeclareOption{enabled}{} % default |
| 8 |
\DeclareOption{disabled}{\@NOTES@enabledfalse} |
| 9 |
|
| 10 |
\newif\if@watermark \@watermarktrue |
| 11 |
|
| 12 |
\DeclareOption{watermark}{} % default |
| 13 |
\DeclareOption{nowatermark}{\@watermarkfalse} |
| 14 |
|
| 15 |
\ProcessOptions\relax |
| 16 |
|
| 17 |
|
| 18 |
\RequirePackage{graphicx} |
| 19 |
\RequirePackage{color} |
| 20 |
\RequirePackage{transparent} |
| 21 |
\if@watermark\RequirePackage{watermark}\fi |
| 22 |
\RequirePackage{fix-cm} |
| 23 |
\RequirePackage[normalem]{ulem} |
| 24 |
\RequirePackage[titles]{tocloft} |
| 25 |
|
| 26 |
\newcommand{\listnotesname}{List of notes} |
| 27 |
\newlistof{NOTES@note}{notes}{\listnotesname} |
| 28 |
|
| 29 |
\newcommand{\listofnotes}{\if@NOTES@enabled\listofNOTES@note\fi} |
| 30 |
|
| 31 |
\newcommand{\@HUGE}{\fontsize{100}{120}\selectfont} |
| 32 |
\newcommand{\@wmstyle}{\color{red}\transparent{0.1}\@HUGE} |
| 33 |
\newcommand{\@wmtext}{\textsc{DRAFT}} |
| 34 |
|
| 35 |
\newcommand{\@DRAFTwatermark}{% |
| 36 |
\thiswatermark{% |
| 37 |
\raisebox{-0.5\textheight}{% |
| 38 |
\parbox{\linewidth}{% |
| 39 |
\centering{\rotatebox{30}{\@wmstyle\@wmtext}}% |
| 40 |
}% |
| 41 |
}% |
| 42 |
}% |
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
\newcommand{\NOTES@colorline}[1]{% |
| 47 |
\bgroup% |
| 48 |
\markoverwith{\textcolor{#1}{\rule[-0.2\baselineskip]{2pt}{\baselineskip}}}% |
| 49 |
\ULon% |
| 50 |
} |
| 51 |
|
| 52 |
\newcommand{\NOTES@marker}[2]{\fbox{\color{#2}\textbf{#1}}} |
| 53 |
\newcommand{\NOTES@marginmarker}[2]{\marginpar{\NOTES@marker{#1}{#2}}} |
| 54 |
\newcommand{\NOTES@inlinemarker}[2]{\NOTES@marker{#1}{#2}} |
| 55 |
|
| 56 |
\newcommand{\NOTES@usemarker}[2]{\csname NOTES@#1marker\endcsname{#2}{red}} |
| 57 |
|
| 58 |
\newcommand{\NOTES@addtolist}[2]{% |
| 59 |
\refstepcounter{NOTES@note}% |
| 60 |
\phantomsection% |
| 61 |
\addcontentsline{notes}{NOTES@note}{\protect\numberline{\theNOTES@note}{{#1}: {#2}}}% |
| 62 |
} |
| 63 |
|
| 64 |
\newcommand{\NOTES@defnoteimpl}[4]{% |
| 65 |
\NOTES@usemarker{#3}{#2}% |
| 66 |
#4{#1}% |
| 67 |
\NOTES@addtolist{#2}{#1}% |
| 68 |
\if@watermark\@DRAFTwatermark\fi% |
| 69 |
} |
| 70 |
|
| 71 |
\newcommand{\defnote}[3]{% |
| 72 |
\global\expandafter\newcommand\csname #1\endcsname[1]{% |
| 73 |
\if@NOTES@enabled\NOTES@defnoteimpl{##1}{#1}{#2}{#3}\fi% |
| 74 |
}% |
| 75 |
} |
| 76 |
|
| 77 |
\defnote{FIXME}{margin}{\uwave} |
| 78 |
\defnote{TODO}{inline}{\NOTES@colorline{yellow}} |
| 79 |
\defnote{CITE}{inline}{\NOTES@colorline{cyan}} |