summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-12 23:52:53 +0000
committerKarl Berry <karl@freefriends.org>2006-01-12 23:52:53 +0000
commit151486e3f01277e7808171a9c3acbc77474d040d (patch)
tree5e55d43eb79b2d1c40d34417f34b6e73f2c2a518 /Master/texmf-dist/tex
parentd5324560625b74561fa815739644f766f8af6176 (diff)
chapterfolder
git-svn-id: svn://tug.org/texlive/trunk@748 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/chapterfolder/chapterfolder.sty110
1 files changed, 110 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/chapterfolder/chapterfolder.sty b/Master/texmf-dist/tex/latex/chapterfolder/chapterfolder.sty
new file mode 100644
index 00000000000..4e4f7fc4c3f
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/chapterfolder/chapterfolder.sty
@@ -0,0 +1,110 @@
+%%
+% Fichier : chapterfolder.sty
+%
+% Auteur : Boretti Mathieu
+%
+% Licence : lppl
+% This material is subject to the LaTeX Project Public License. See http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html for the details of that license.
+%
+% revision, version 1.1
+%
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{chapterfolder}
+\RequirePackage{ifthen}
+%
+\newcommand{\@chapterfoldercurrentfolder}{}
+%
+\newcommand{\@partfoldercurrentfolder}{}
+%
+\newcommand{\@sectionfoldercurrentfolder}{}
+%
+\newcommand{\@subsectionfoldercurrentfolder}{}
+%
+\newcommand{\@chapterfolderfigure}{figure/}
+%
+\newcommand{\@chapterfolderlistings}{listings/}
+%
+%
+% \cfcurrentfolder
+\newcommand{\cfcurrentfolder}{\@partfoldercurrentfolder\@chapterfoldercurrentfolder\@sectionfoldercurrentfolder\@subsectionfoldercurrentfolder}
+% \cfcurrentfolderfigure
+\newcommand{\cfcurrentfolderfigure}{\cfcurrentfolder\@chapterfolderfigure}
+% \cfcurrentfolderlistings
+\newcommand{\cfcurrentfolderlistings}{\cfcurrentfolder\@chapterfolderlistings}
+%
+\newcommand{\@cfuppart}[1]{\renewcommand{\@partfoldercurrentfolder}{#1/}}
+\newcommand{\@cfupchapter}[1]{\renewcommand{\@chapterfoldercurrentfolder}{#1/}}
+\newcommand{\@cfupsection}[1]{\renewcommand{\@sectionfoldercurrentfolder}{#1/}}
+\newcommand{\@cfupsubsection}[1]{\renewcommand{\@subsectionfoldercurrentfolder}{#1/}}
+\newcommand{\@cfdownpart}{\renewcommand{\@partfoldercurrentfolder}{}}
+\newcommand{\@cfdownchapter}{\renewcommand{\@chapterfoldercurrentfolder}{}}
+\newcommand{\@cfdownsection}{\renewcommand{\@sectionfoldercurrentfolder}{}}
+\newcommand{\@cfdownsubsection}{\renewcommand{\@subsectionfoldercurrentfolder}{}}
+%
+% \cfinput{nom}
+\newcommand{\cfinput}[1]{\input{\cfcurrentfolder#1}}
+
+% \cfpart[name short]{name full}{folder}{file}
+\newcommand{\cfpart}[4][]{%
+\@cfuppart{#3}%
+\ifthenelse{\equal{#1}{}}{\part{#2}}{\part[#1]{#2}}%
+\cfinput{#4}%
+\@cfdownpart%
+}
+
+% \cfpartstar[name short]{name full}{folder}{file}
+\newcommand{\cfpartstar}[4][]{%
+\@cfuppart{#3}%
+\ifthenelse{\equal{#1}{}}{\part*{#2}}{\part[#1]{#2}}%
+\cfinput{#4}%
+\@cfdownpart%
+}
+
+% \cfchapter[name short]{name full}{folder}{file}
+\newcommand{\cfchapter}[4][]{%
+\@cfupchapter{#3}%
+\ifthenelse{\equal{#1}{}}{\chapter{#2}}{\chapter[#1]{#2}}%
+\cfinput{#4}%
+\@cfdownchapter%
+}
+
+% \cfchapterstar[name short]{name full}{folder}{file}
+\newcommand{\cfchapterstar}[4][]{%
+\@cfupchapter{#3}%
+\ifthenelse{\equal{#1}{}}{\chapter*{#2}}{\chapter*[#1]{#2}}%
+\cfinput{#4}%
+\@cfdownchapter%
+}
+
+% \cfsection[name short]{name full}{folder}{file}
+\newcommand{\cfsection}[4][]{%
+\@cfupsection{#3}%
+\ifthenelse{\equal{#1}{}}{\section{#2}}{\section[#1]{#2}}%
+\cfinput{#4}%
+\@cfdownsection%
+}
+
+% \cfsectionstar[name short]{name full}{folder}{file}
+\newcommand{\cfsectionstar}[4][]{%
+\@cfupsection{#3}%
+\ifthenelse{\equal{#1}{}}{\section*{#2}}{\section*[#1]{#2}}%
+\cfinput{#4}%
+\@cfdownsection%
+}
+
+% \cfsubsection[name short]{name full}{folder}{file}
+\newcommand{\cfsubsection}[4][]{%
+\@cfupsubsection{#3}%
+\ifthenelse{\equal{#1}{}}{\subsection{#2}}{\subsection[#1]{#2}}%
+\cfinput{#4}%
+\@cfdownsubsection%
+}
+
+% \cfsubsectionstar[name short]{name full}{folder}{file}
+\newcommand{\cfsubsectionstart}[4][]{%
+\@cfupsubsection{#3}%
+\ifthenelse{\equal{#1}{}}{\subsection*{#2}}{\subsection*[#1]{#2}}%
+\cfinput{#4}%
+\@cfdownsubsection%
+}