1 %% This is file `dashundergaps.sty' v1.2 by Merciadri Luca.
3 \NeedsTeXFormat{LaTeX2e}
4 \ProvidesPackage{dashundergaps}[2010/01/20 Dashing and underlining (phantom) text]
5 \PackageInfo{dashundergaps}{This is DashUnderGaps by Merciadri Luca.}
7 \RequirePackage{ifthen}[1994/06/01]
8 \PassOptionsToPackage{normalem}{ulem}
10 \newboolean{dot} % false at start
11 \newboolean{dash} % false at start
14 \DeclareOption{dash}{%
15 \typeout{Dashing mode activated!}
16 \setboolean{dash}{true}
17 \providecommand{\dashuline}{\bgroup
18 \ifdim\ULdepth=\maxdimen
19 \settodepth\ULdepth{(j}\advance\ULdepth.4pt\fi
20 \markoverwith{\kern.15em
21 \vtop{\kern\ULdepth \hrule width .3em}%
27 \typeout{Dotting mode activated!}
28 \setboolean{dot}{true}
29 \providecommand{\dotuline}{\bgroup
30 \ifdim\ULdepth=\maxdimen
31 \settodepth\ULdepth{(j}\advance\ULdepth.4pt\fi
32 \markoverwith{\begingroup
33 \advance\ULdepth0.08ex
34 \lower\ULdepth\hbox{\kern.15em .\kern.1em}%
39 \DeclareOption{phantomtext}{%
40 \typeout{Phantom mode activated! All the gaps will be filled.}
41 \newboolean{teachernotes} % false at start
43 \setcounter{nb-gaps}{1}
45 \setcounter{nth-gaps}{1}
47 \def\phantom@putbox{\ifx\UL@start\@empty \else % not inner
48 \vrule\@width\z@ \LA@penalty\@M
49 {\UL@skip\wd\UL@box \UL@leaders \kern-\UL@skip}%
50 \hbox to\wd\UL@box{}\fi}%
52 \providecommand{\gap}[1]{%
54 \let\UL@putbox=\phantom@putbox
55 \ifthenelse{\boolean{teachernotes}}
56 {\textbf{#1} (\arabic{nth-gaps})}
57 {\ifthenelse{\boolean{dash} \AND \boolean{dot}}{\uline{#1}(\arabic{nth-gaps})}{\ifthenelse{\boolean{dash}}{\dashuline{#1} (\arabic{nth-gaps})}{\ifthenelse{\boolean{dot}}{\dotuline{#1} (\arabic{nth-gaps})}{\uline{#1} (\arabic{nth-gaps})}}}
59 \addtocounter{nb-gaps}{1}
60 \addtocounter{nth-gaps}{1}
65 \DeclareOption{teachernotes}{%
66 \typeout{Phantom mode deactivated! All the gaps will be filled with their content.}
67 \setboolean{teachernotes}{true}
71 \DeclareOption{displaynbgaps}{%
72 \typeout{Gaps counting mode activated!}
73 \addtocounter{nb-gaps}{-1}
74 \AtEndDocument{\vfill \centering \bfseries GAPS: \arabic{nb-gaps}.}