% SETSTRUT.TEX Automatic strut computation
% by Stephan v.\ Bechtolsheim 1987
% Save the current value of \baselineskip here for strut handling
\newdimen\strutskip
% \setstrut
% =========
% Compute \strut as a \vrule of
% width: 0
% height: 70% of the current value of \baselinekip
% depth: the remaining 30% of \baselineskip.
\def\setstrut {%
\strutskip = \baselineskip
\ifdim\baselineskip < 0pt
\errhelp = {You probably called \string\offinterlineskip
before \string\setstrut}
\errmessage{\string\setstrut: negative
\string\baselineskip (\the\baselineskip)}%
\fi
}
% \strut
% ======
% The strut
\def\strut {%
\vrule height 0.7\strutskip
depth 0.3\strutskip
width 0pt
}
% \higherstrut
% ============
% Generate a strut, which is higher by #1 than the usual strut.
% The depth is the depth of \strut.
% #1: dimension, by which the strut is made higher
\def\higherstrut #1{%
{%
\dimen0 = 0.7\strutskip
\advance\dimen0 by #1%
\vrule height \dimen0 depth 0.3\strutskip width 0pt
}%
}
% \deeperstrut
% ============
% Generate a strut, which is deeper by #1 than the usual strut.
% the height is the height of \strut.
% #1: dimension, by wghich the strut is made deeper.
\def\deeperstrut #1{%
{%
\dimen0 = 0.3\strutskip
\advance\dimen0 by #1%
\vrule height 0.7\strutskip depth \dimen0 width 0pt
}%
}
% Initialize in case the user forgets to set up a strut
\setstrut