summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/dashundergaps/dashundergaps.sty
blob: 62561b3bdf5b52d57b6a4c9533e7eb809cf4e6d7 (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
%% This is file `dashundergaps.sty' v1.1 by Merciadri Luca.

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{dashundergaps}[2009/11/12 Dashing and underlining (phantom) text]
\PackageInfo{dashundergaps}{This is DashUnderGaps by Merciadri Luca.}

\RequirePackage{ifthen}[1994/06/01]
\PassOptionsToPackage{normalem}{ulem}
\RequirePackage{ulem}
\newboolean{dot} % false at start
\newboolean{dash} % false at start


\DeclareOption{dash}{%
\typeout{Dashing mode activated!}
\setboolean{dash}{true}
\def\dashuline{\bgroup
\ifdim\ULdepth=\maxdimen
\settodepth\ULdepth{(j}\advance\ULdepth.4pt\fi
\markoverwith{\kern.15em
\vtop{\kern\ULdepth \hrule width .3em}%
\kern.15em}\ULon}
}


\DeclareOption{dot}{%
\typeout{Dotting mode activated!}
\setboolean{dot}{true}
\def\dotuline{\bgroup
\ifdim\ULdepth=\maxdimen
\settodepth\ULdepth{(j}\advance\ULdepth.4pt\fi
\markoverwith{\begingroup
\advance\ULdepth0.08ex
\lower\ULdepth\hbox{\kern.15em .\kern.1em}%
\endgroup}\ULon}
}


\DeclareOption{phantomtext}{%
\typeout{Phantom mode activated! All the gaps will be filled.}
\newboolean{teachernotes} % false at start
\newcounter{nb-gaps}
\setcounter{nb-gaps}{1}
\newcounter{nth-gaps}
\setcounter{nth-gaps}{1}

\newcommand{\gap}[1]{%
\ifthenelse{\boolean{teachernotes}}
{\textbf{#1} (\arabic{nth-gaps})}
{\ifthenelse{\boolean{dash} \AND \boolean{dot}}{\underline{\phantom{#1}} (\arabic{nth-gaps})}{\ifthenelse{\boolean{dash}}{\dashuline{\phantom{#1}} (\arabic{nth-gaps})}{\ifthenelse{\boolean{dot}}{\dotuline{\phantom{#1}} (\arabic{nth-gaps})}{\underline{\phantom{#1}} (\arabic{nth-gaps})}}}}
\addtocounter{nb-gaps}{1}
\addtocounter{nth-gaps}{1}
}}


\DeclareOption{teachernotes}{%
\typeout{Phantom mode deactivated! All the gaps will be filled with their content.}
\setboolean{teachernotes}{true}
}


\DeclareOption{displaynbgaps}{%
\typeout{Gaps counting mode activated!}
\addtocounter{nb-gaps}{-1}
\AtEndDocument{\vfill \centering \bfseries GAPS: \arabic{nb-gaps}.}
}

\ProcessOptions\relax