diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/fixmetodonotes/fixmetodonotes.dtx |
Initial commit
Diffstat (limited to 'macros/latex/contrib/fixmetodonotes/fixmetodonotes.dtx')
-rw-r--r-- | macros/latex/contrib/fixmetodonotes/fixmetodonotes.dtx | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/macros/latex/contrib/fixmetodonotes/fixmetodonotes.dtx b/macros/latex/contrib/fixmetodonotes/fixmetodonotes.dtx new file mode 100644 index 0000000000..b41a1b6e06 --- /dev/null +++ b/macros/latex/contrib/fixmetodonotes/fixmetodonotes.dtx @@ -0,0 +1,79 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{fixmetodonotes}[2013/04/28 v0.2.2] + + +\newif\if@NOTES@enabled \@NOTES@enabledtrue + +\DeclareOption{enabled}{} % default +\DeclareOption{disabled}{\@NOTES@enabledfalse} + +\newif\if@watermark \@watermarktrue + +\DeclareOption{watermark}{} % default +\DeclareOption{nowatermark}{\@watermarkfalse} + +\ProcessOptions\relax + + +\RequirePackage{graphicx} +\RequirePackage{color} +\RequirePackage{transparent} +\if@watermark\RequirePackage{watermark}\fi +\RequirePackage{fix-cm} +\RequirePackage[normalem]{ulem} +\RequirePackage[titles]{tocloft} + +\newcommand{\listnotesname}{List of notes} +\newlistof{NOTES@note}{notes}{\listnotesname} + +\newcommand{\listofnotes}{\if@NOTES@enabled\listofNOTES@note\fi} + +\newcommand{\@HUGE}{\fontsize{100}{120}\selectfont} +\newcommand{\@wmstyle}{\color{red}\transparent{0.1}\@HUGE} +\newcommand{\@wmtext}{\textsc{DRAFT}} + +\newcommand{\@DRAFTwatermark}{% + \thiswatermark{% + \raisebox{-0.5\textheight}{% + \parbox{\linewidth}{% + \centering{\rotatebox{30}{\@wmstyle\@wmtext}}% + }% + }% + }% +} + + +\newcommand{\NOTES@colorline}[1]{% + \bgroup% + \markoverwith{\textcolor{#1}{\rule[-0.2\baselineskip]{2pt}{\baselineskip}}}% + \ULon% +} + +\newcommand{\NOTES@marker}[2]{\fbox{\color{#2}\textbf{#1}}} +\newcommand{\NOTES@marginmarker}[2]{\marginpar{\NOTES@marker{#1}{#2}}} +\newcommand{\NOTES@inlinemarker}[2]{\NOTES@marker{#1}{#2}} + +\newcommand{\NOTES@usemarker}[2]{\csname NOTES@#1marker\endcsname{#2}{red}} + +\newcommand{\NOTES@addtolist}[2]{% + \refstepcounter{NOTES@note}% + \phantomsection% + \addcontentsline{notes}{NOTES@note}{\protect\numberline{\theNOTES@note}{{#1}: {#2}}}% +} + +\newcommand{\NOTES@defnoteimpl}[4]{% + \NOTES@usemarker{#3}{#2}% + #4{#1}% + \NOTES@addtolist{#2}{#1}% + \if@watermark\@DRAFTwatermark\fi% +} + +\newcommand{\defnote}[3]{% + \global\expandafter\newcommand\csname #1\endcsname[1]{% + \if@NOTES@enabled\NOTES@defnoteimpl{##1}{#1}{#2}{#3}\fi% + }% +} + +\defnote{FIXME}{margin}{\uwave} +\defnote{TODO}{inline}{\NOTES@colorline{yellow}} +\defnote{CITE}{inline}{\NOTES@colorline{cyan}} |