summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/coseoul
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-09-07 23:31:45 +0000
committerKarl Berry <karl@freefriends.org>2011-09-07 23:31:45 +0000
commitd048b0fd24845bf48f447a005cdc5acbc6811675 (patch)
treee2721a3312340c0ad4fc98dba7f23fcff6aaa9ce /Master/texmf-dist/tex/latex/coseoul
parent3490f8c542eb9c5d699480a03c06ce90f772379a (diff)
coseoul (6sep11)
git-svn-id: svn://tug.org/texlive/trunk@23862 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/coseoul')
-rw-r--r--Master/texmf-dist/tex/latex/coseoul/coseoul.sty39
1 files changed, 39 insertions, 0 deletions
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