| 1 |
%% |
| 2 |
%% This is file `eolgrab-example-sec.tex', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% eolgrab.dtx (with options: `example-sec') |
| 8 |
%% |
| 9 |
%% This is a generated file. |
| 10 |
%% |
| 11 |
%% Project: eolgrab |
| 12 |
%% Version: 2016/05/16 v1.1 |
| 13 |
%% |
| 14 |
%% Copyright (C) |
| 15 |
%% 2011 Heiko Oberdiek |
| 16 |
%% 2016-2019 Oberdiek Package Support Group |
| 17 |
%% |
| 18 |
%% This work may be distributed and/or modified under the |
| 19 |
%% conditions of the LaTeX Project Public License, either |
| 20 |
%% version 1.3c of this license or (at your option) any later |
| 21 |
%% version. This version of this license is in |
| 22 |
%% https://www.latex-project.org/lppl/lppl-1-3c.txt |
| 23 |
%% and the latest version of this license is in |
| 24 |
%% https://www.latex-project.org/lppl.txt |
| 25 |
%% and version 1.3 or later is part of all distributions of |
| 26 |
%% LaTeX version 2005/12/01 or later. |
| 27 |
%% |
| 28 |
%% This work has the LPPL maintenance status "maintained". |
| 29 |
%% |
| 30 |
%% The Current Maintainers of this work are |
| 31 |
%% Heiko Oberdiek and the Oberdiek Package Support Group |
| 32 |
%% https://github.com/ho-tex/oberdiek/issues |
| 33 |
%% |
| 34 |
%% |
| 35 |
%% The Base Interpreter refers to any `TeX-Format', |
| 36 |
%% because some files are installed in TDS:tex/generic//. |
| 37 |
%% |
| 38 |
%% This work consists of the main source file eolgrab.dtx |
| 39 |
%% and the derived files |
| 40 |
%% eolgrab.sty, eolgrab.pdf, eolgrab.ins, eolgrab.drv, |
| 41 |
%% eolgrab-example-ltx.tex, eolgrab-example-env.tex, |
| 42 |
%% eolgrab-example-sec.tex, eolgrab-test1.tex, |
| 43 |
%% eolgrab-test2.tex. |
| 44 |
%% |
| 45 |
\documentclass{article} |
| 46 |
\usepackage{eolgrab} |
| 47 |
\makeatletter |
| 48 |
\newcommand*{\eolsection}{% |
| 49 |
\@ifstar{% |
| 50 |
\eolgrab{\section*}% |
| 51 |
}{% |
| 52 |
\@ifnextchar[{% |
| 53 |
\eoloptsection |
| 54 |
}{% |
| 55 |
\eolgrab\section |
| 56 |
}% |
| 57 |
}% |
| 58 |
} |
| 59 |
\newcommand*{\eoloptsection}[1][]{% |
| 60 |
\eolgrab{\section[{#1}]}% |
| 61 |
} |
| 62 |
\makeatother |
| 63 |
\begin{document} |
| 64 |
\tableofcontents |
| 65 |
\eolsection Section without star and optional argument |
| 66 |
\eolsection*Section with star |
| 67 |
\eolsection[Short section title]Long section title |
| 68 |
\end{document} |
| 69 |
%% \section{Installation} |
| 70 |
\endinput |
| 71 |
%% |
| 72 |
%% End of file `eolgrab-example-sec.tex'. |