From d048b0fd24845bf48f447a005cdc5acbc6811675 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 7 Sep 2011 23:31:45 +0000 Subject: coseoul (6sep11) git-svn-id: svn://tug.org/texlive/trunk@23862 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/coseoul/coseoul.sty | 39 +++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/coseoul/coseoul.sty (limited to 'Master/texmf-dist/tex/latex/coseoul') diff --git a/Master/texmf-dist/tex/latex/coseoul/coseoul.sty b/Master/texmf-dist/tex/latex/coseoul/coseoul.sty new file mode 100644 index 00000000000..0146d229d46 --- /dev/null +++ b/Master/texmf-dist/tex/latex/coseoul/coseoul.sty @@ -0,0 +1,39 @@ +\ProvidesPackage{coseoul} +\RequirePackage{ifthen} + +\newcommand{\chex}{} + +\newcounter{currentlevel} +% part = 7 chapter = 6 section = 5 +% subsection = 4 subsubsection = 3 paragraph = 2 +% subparagraph = 1 + +\ifthenelse{\isundefined{\chapter}}% + {\renewcommand{\chex}{N}\setcounter{currentlevel}{5}}% + {\renewcommand{\chex}{Y}\setcounter{currentlevel}{6}} + +\newcommand{\findnewlevel}[1]% uppity (-1 down, 0 stay, 1 up, 2-6 multiup +{ \addtocounter{currentlevel}{#1}% + \ifthenelse{\equal{\chex}{N}}% + { \ifthenelse{\value{currentlevel} = 6}% + { \ifthenelse{#1 > 1}{\addtocounter{currentlevel}{1}}% + {\addtocounter{currentlevel}{-1}}}{}}{}% + \ifthenelse{\value{currentlevel} < 1}{\setcounter{currentlevel}{1}}{}% + \ifthenelse{\value{currentlevel} > 7}{\setcounter{currentlevel}{7}}{}% +} + +\newcommand{\levelchange}[2]% title, uppity +{ \findnewlevel{#2}% + \ifthenelse{\value{currentlevel} = 1}{\subparagraph{#1}}{}% + \ifthenelse{\value{currentlevel} = 2}{\paragraph{#1}}{}% + \ifthenelse{\value{currentlevel} = 3}{\subsubsection{#1}}{}% + \ifthenelse{\value{currentlevel} = 4}{\subsection{#1}}{}% + \ifthenelse{\value{currentlevel} = 5}{\section{#1}}{}% + \ifthenelse{\value{currentlevel} = 6}{\chapter{#1}}{}% + \ifthenelse{\value{currentlevel} = 7}{\part{#1}}{}% +} + +\newcommand{\levelup}[1]{\levelchange{#1}{1}} +\newcommand{\leveldown}[1]{\levelchange{#1}{-1}} +\newcommand{\levelstay}[1]{\levelchange{#1}{0}} +\newcommand{\levelmultiup}[2]{\levelchange{#1}{#2}} %title, uppity \ No newline at end of file -- cgit v1.2.3