summaryrefslogtreecommitdiff
path: root/macros/generic/misc/epigram.tex
blob: 1542c87661d98e312ea085e3ee4c671c84194aff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
% From TeXMaG Volume 2, Number 6
% Don Hosek.  Public domain.
%
\long\def\epigram#1{% We use \long\def to allow the argument
                    % to span several paragraphs.
    \bigskip       % extra space above.
    \setbox0=\hbox{#1} % put the text into a box
    \ifdim\wd0>\critwidth %check the length
         \centerline{\vtop{\hsize=\episize\noindent#1}}
              % If the length is greater than
              % the critical length, make a
              % displayed paragraph
    \else          % otherwise, we just center the text.
         \centerline{\box0}
    \fi
    \smallskip     % extra space for the end.
}
     
\newdimen\critwidth          \critwidth=.75\hsize
\newdimen\episize            \episize=.6\hsize