summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/fixmetodonotes/fixmetodonotes.sty
blob: f8c832e8d9d28b5cc9c163d21ecb10be57e70cfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
%%
%% This is file `fixmetodonotes.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% fixmetodonotes.dtx  (with options: `package')
%% 
%% This is a generated file
%% 
%% 
%% fixmetodonotes: highlight and manage FIXME and TODO annotations.
%% 
%% Written in 2012 by Gioele Barabucci
%% 
%% 
%% This is free software released into the public domain (CC0 license).
%% 
%% See the LICENSE file or <http://creativecommons.org/publicdomain/zero/1.0/>
%% for more details.
%% 
\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}}
\endinput
%%
%% End of file `fixmetodonotes.sty'.