% Style file for making "Löckentext"
\typeout{Style GAP by Helmut Heller, 29.6.1996}

\newlength{\gaplena}
\newlength{\gaplenb}
% We define a macro \gap for the gap. It has three parameters:
% 1: the text to show up in the gap initially
% 2: the solution text
% 3: a remark

\def\gap#1#2#3{%
\ifgap%
#1%
\settowidth{\gaplena}{#1}%
\settowidth{\gaplenb}{#2}%
\addtolength{\gaplenb}{-\the\gaplena}%
%\addtolength{\gaplenb}{\the\gaplenb}%
\addtolength{\gaplenb}{2pt}%
\rule[-2pt]{\gaplenb}{.5pt}%
\else%
#2%
\fi\ifannote\ (#3)\fi\ }

% We also define a switch \gaptrue and \gapfalse 
% to show either the gap or the solution:
\newif\ifgap


% we set the default to \gaptrue
\gaptrue

% And a switch to print out solutions with annotations:
\newif\ifannote

% to make the output look better (since hyphenation is hindered):
\sloppy
