summaryrefslogtreecommitdiff
path: root/macros/plain/formats/lollipop/tex/lollipop-heading.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/plain/formats/lollipop/tex/lollipop-heading.tex')
-rw-r--r--macros/plain/formats/lollipop/tex/lollipop-heading.tex49
1 files changed, 49 insertions, 0 deletions
diff --git a/macros/plain/formats/lollipop/tex/lollipop-heading.tex b/macros/plain/formats/lollipop/tex/lollipop-heading.tex
new file mode 100644
index 0000000000..02f0a23596
--- /dev/null
+++ b/macros/plain/formats/lollipop/tex/lollipop-heading.tex
@@ -0,0 +1,49 @@
+% lollipop-heading.tex copyright 1992 Victor Eijkhout
+% copyright 2014--2016 Vafa Khalighi
+%
+%
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <http://www.gnu.org/licenses/>.
+%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%% H E A D I N G S %%%%%%%%%%%%
+\@GenericConstruct{Heading}
+
+\newif\if@headed
+\add@generic@default{\add@after@command{\@headedno}}
+\add@Heading@default{\add@after@command{\@headedyes}}
+
+\add@Heading@default{\def\@afterpenalty{\penalty\@M}
+ \default@break@afterno}
+\add@Heading@default{\has@marksyes}
+
+\def\@DefineHeading{
+ \@DefineStopCommand{\relax}
+ \csarg\edef{\@name}%
+ {\@gen@open % this contains: \let\CSname{\@name Title}\nxp\tmp@title
+ \the\@main@options@list
+ \@gen@close}
+ }
+
+\@HeadingOption{TwoLines}{\switch {\if\EqualString{#1}}
+ {yes} {\add@after@command{\next@paragraph{\clubpenalty\M@
+ \next@paragraph{\global\clubpenalty\default@clubpenalty}}}}
+ {no} {\add@after@command{\clubpenalty\default@clubpenalty}}
+ {default} {\edef\cs@e{\nxp\add@after@command{\nxp\next@paragraph
+ {\clubpenalty\@w@w{#1}\relax\nxp\next@paragraph
+ {\global\clubpenalty\default@clubpenalty}}}}
+ \cs@e}
+ \endswitch}
+
+\endinput \ No newline at end of file