summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/chapterfolder
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-06-25 15:27:09 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-06-25 15:27:09 +0000
commite32e07b01461f41c50788084c887b8136549a7d5 (patch)
tree02d4a928863688a3f2cf9ed30cf8f99aa6f11660 /Master/texmf-dist/tex/latex/chapterfolder
parent79267a695344f6daef038478ee552fa6cbeb62c3 (diff)
chapterfolder v2.0 2005-11-24, new in tlpkg-ctan-check
git-svn-id: svn://tug.org/texlive/trunk@9044 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/chapterfolder')
-rw-r--r--Master/texmf-dist/tex/latex/chapterfolder/chapterfolder.sty195
1 files changed, 110 insertions, 85 deletions
diff --git a/Master/texmf-dist/tex/latex/chapterfolder/chapterfolder.sty b/Master/texmf-dist/tex/latex/chapterfolder/chapterfolder.sty
index 4e4f7fc4c3f..c701a02cabd 100644
--- a/Master/texmf-dist/tex/latex/chapterfolder/chapterfolder.sty
+++ b/Master/texmf-dist/tex/latex/chapterfolder/chapterfolder.sty
@@ -1,110 +1,135 @@
%%
-% 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
-%
+%% This is file `chapterfolder.sty',
+%% generated with the docstrip utility.
%%
+%% The original source files were:
+%%
+%% chapterfolder.dtx (with options: `package')
+%% This is a generated file.
+%%
+%% Copyright (C) 2003-2005 by Mathieu Boretti
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3 of this license or (at your option) any later
+%% version. The latest version of this license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2003/12/01 or later.
+%%
+%% The current Maintainer of this work is Mathieu Boretti
+%%
+%% This work consists of the file chapterfolder.ins and
+%% chapterfolder.dtx and the derived file chapterfolder.sty
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{chapterfolder}
+\ProvidesPackage{chapterfolder}[2005/11/24 v2.0 Package for dealing with folder]
\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}
+\newcounter{@cf@currentpos}
+\setcounter{@cf@currentpos}{0}
+\expandafter\def\csname stackFolder0\endcsname{}
+\expandafter\def\csname stackFolder1\endcsname{}
+\expandafter\def\csname stackFolder2\endcsname{}
+\expandafter\def\csname stackFolder3\endcsname{}
+\expandafter\def\csname stackFolder4\endcsname{}
+\expandafter\def\csname stackFolder5\endcsname{}
+\expandafter\def\csname stackFolder6\endcsname{}
+\expandafter\def\csname stackFolder7\endcsname{}
+\expandafter\def\csname stackFolder8\endcsname{}
+\expandafter\def\csname stackFolder9\endcsname{}
+\def\@cfpush#1{%
+ \expandafter%
+ \def\csname stackFolder\arabic{@cf@currentpos}\endcsname{#1/}%
+ \addtocounter{@cf@currentpos}{1}%
+}
+\def\@cfpop{%
+ \addtocounter{@cf@currentpos}{-1}
+ \expandafter%
+ \def\csname stackFolder\arabic{@cf@currentpos}\endcsname{}%
+}
+\newcommand{\cfcurrentfolder}{%
+\csname stackFolder0\endcsname%
+\csname stackFolder1\endcsname%
+\csname stackFolder2\endcsname%
+\csname stackFolder3\endcsname%
+\csname stackFolder4\endcsname%
+\csname stackFolder5\endcsname%
+\csname stackFolder6\endcsname%
+\csname stackFolder7\endcsname%
+\csname stackFolder8\endcsname%
+\csname stackFolder9\endcsname%
+}
\newcommand{\cfinput}[1]{\input{\cfcurrentfolder#1}}
-
-% \cfpart[name short]{name full}{folder}{file}
-\newcommand{\cfpart}[4][]{%
-\@cfuppart{#3}%
+\newcommand{\cffolderinput}[2]{%
+ \@cfpush{#1}%
+ \cfinput{#2}%
+ \@cfpop%
+}
+\newcommand{\cfaddFolder}[2]{%
+ \expandafter\def\csname cfcurrentfolder#1\endcsname{%
+ \cfcurrentfolder/#2/%
+ }%
+ \expandafter\def\csname cfinput#1\endcsname##1{%
+ \input{\csname cfcurrentfolder#1\endcsname##1}%
+ }%
+}
+\newcommand{\@chapterfolderfigure}{figure}
+\cfaddFolder{figure}{\@chapterfolderfigure}
+\newcommand{\cfincludegraphics}[2][]{%
+ \includegraphics[#1]{\cfcurrentfolderfigure/#2}%
+}
+\newcommand{\@chapterfolderlistings}{listings}
+\cfaddFolder{listings}{\@chapterfolderlistings}
+\newcommand{\@chapterfolderalgorithms}{algorithms}
+\cfaddFolder{algorithms}{\@chapterfolderalgorithms}
+\newcommand{\cfpart}{\@ifstar
+ \cfpartstar%
+ \cfpartstd%
+}
+\newcommand{\cfchapter}{\@ifstar
+ \cfchapterstar%
+ \cfchapterstd%
+}
+\newcommand{\cfsection}{\@ifstar
+ \cfsectionstar%
+ \cfsectionstd%
+}
+\newcommand{\cfsubsection}{\@ifstar
+ \cfsubsectionstar%
+ \cfsubsectionstd%
+}
+\newcommand{\cfpartstd}[4][]{%
\ifthenelse{\equal{#1}{}}{\part{#2}}{\part[#1]{#2}}%
-\cfinput{#4}%
-\@cfdownpart%
+\cffolderinput{#3}{#4}%
}
-
-% \cfpartstar[name short]{name full}{folder}{file}
\newcommand{\cfpartstar}[4][]{%
-\@cfuppart{#3}%
\ifthenelse{\equal{#1}{}}{\part*{#2}}{\part[#1]{#2}}%
-\cfinput{#4}%
-\@cfdownpart%
+\cffolderinput{#3}{#4}%
}
-
-% \cfchapter[name short]{name full}{folder}{file}
-\newcommand{\cfchapter}[4][]{%
-\@cfupchapter{#3}%
+\newcommand{\cfchapterstd}[4][]{%
\ifthenelse{\equal{#1}{}}{\chapter{#2}}{\chapter[#1]{#2}}%
-\cfinput{#4}%
-\@cfdownchapter%
+\cffolderinput{#3}{#4}%
}
-
-% \cfchapterstar[name short]{name full}{folder}{file}
\newcommand{\cfchapterstar}[4][]{%
-\@cfupchapter{#3}%
\ifthenelse{\equal{#1}{}}{\chapter*{#2}}{\chapter*[#1]{#2}}%
-\cfinput{#4}%
-\@cfdownchapter%
+\cffolderinput{#3}{#4}%
}
-
-% \cfsection[name short]{name full}{folder}{file}
-\newcommand{\cfsection}[4][]{%
-\@cfupsection{#3}%
+\newcommand{\cfsectionstd}[4][]{%
\ifthenelse{\equal{#1}{}}{\section{#2}}{\section[#1]{#2}}%
-\cfinput{#4}%
-\@cfdownsection%
+\cffolderinput{#3}{#4}%
}
-
-% \cfsectionstar[name short]{name full}{folder}{file}
\newcommand{\cfsectionstar}[4][]{%
-\@cfupsection{#3}%
\ifthenelse{\equal{#1}{}}{\section*{#2}}{\section*[#1]{#2}}%
-\cfinput{#4}%
-\@cfdownsection%
+\cffolderinput{#3}{#4}%
}
-
-% \cfsubsection[name short]{name full}{folder}{file}
-\newcommand{\cfsubsection}[4][]{%
-\@cfupsubsection{#3}%
+\newcommand{\cfsubsectionstd}[4][]{%
\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%
+\cffolderinput{#3}{#4}%
}
+\endinput
+%%
+%% End of file `chapterfolder.sty'.