diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-13 00:09:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-13 00:09:30 +0000 |
commit | 1c15320ad7ed0abae3251a6a8fb7c5a03a23f083 (patch) | |
tree | bc9e6f506e76652fcb161e8e2c820e087169f7f2 /Master | |
parent | f5f3118836c067b1d3d09f6c75f5e9b24572caba (diff) |
tocvsec2
git-svn-id: svn://tug.org/texlive/trunk@1398 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/tex/latex/tocvsec2/tocvsec2.sty | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/tocvsec2/tocvsec2.sty b/Master/texmf-dist/tex/latex/tocvsec2/tocvsec2.sty new file mode 100644 index 00000000000..884a15514a3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tocvsec2/tocvsec2.sty @@ -0,0 +1,112 @@ +%% +%% This is file `tocvsec2.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tocvsec2.dtx (with options: `usc') +%% +%% Copyright 1998 Peter R. Wilson +%% +%% This program is provided under the terms of the +%% LaTeX Project Public License distributed from CTAN +%% archives in directory macros/latex/base/lppl.txt. +%% +%% Author: Peter Wilson (CUA and NIST) +%% now at: peter.r.wilson@boeing.com +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{tocvsec2}[1999/01/24 v1.1 variable ToC section entries] +\RequirePackage{stdclsdv} +\RequirePackage{ifthen} +\ifSCDknownclass + \ifSCDnodivs + \PackageWarning{tocvsec2}{There are no sectional divisions in this class} + \renewcommand{\SCDquit}{\endinput} + \fi +\else + \PackageWarning{tocvsec2}% + {I don't recognize the class but I'll do my best} +\fi +\SCDquit +\newif\if@knownsect@c +\newcommand{\@setseccntt@c}[2]{ + \@knownsect@cfalse + \ifthenelse{\equal{#1}{none}}{\setcounter{#2}{-10} + \@knownsect@ctrue}{} + \ifthenelse{\equal{#1}{part}}{\ifSCDchapter + \setcounter{#2}{-1} + \else + \setcounter{#2}{0} + \fi + \@knownsect@ctrue}{} + \ifthenelse{\equal{#1}{chapter}}{\setcounter{#2}{0} + \@knownsect@ctrue}{} + \ifthenelse{\equal{#1}{section}}{\setcounter{#2}{1} + \@knownsect@ctrue}{} + \ifthenelse{\equal{#1}{subsection}}{\setcounter{#2}{2} + \@knownsect@ctrue}{} + \ifthenelse{\equal{#1}{subsubsection}}{\setcounter{#2}{3} + \@knownsect@ctrue}{} + \ifthenelse{\equal{#1}{paragraph}}{\setcounter{#2}{4} + \@knownsect@ctrue}{} + \ifthenelse{\equal{#1}{subparagraph}}{\setcounter{#2}{5} + \@knownsect@ctrue}{} + \ifthenelse{\equal{#1}{all}}{\setcounter{#2}{100} + \@knownsect@ctrue}{} + \if@knownsect@c\else + \PackageError{tocvsec2}{% + Unknown sectioning command name (#1) + }{% + I'll ignore it. Type \space <return> and I'll continue.\MessageBreak + If you haven't mistyped the name then use \protect\setcounter\space instead.} + \fi +} +\newcommand{\settocdepth}[1]{% + \@knownsect@cfalse + \ifthenelse{\equal{#1}{none}}{% + \addtocontents{toc}{\protect\setcounter{tocdepth}{-10}} + \@knownsect@ctrue}{} + \ifthenelse{\equal{#1}{part}}{% + \ifSCDchapter + \addtocontents{toc}{\protect\setcounter{tocdepth}{-1}} + \else + \addtocontents{toc}{\protect\setcounter{tocdepth}{0}} + \fi + \@knownsect@ctrue}{} + \ifthenelse{\equal{#1}{chapter}}{% + \addtocontents{toc}{\protect\setcounter{tocdepth}{0}} + \@knownsect@ctrue}{} + \ifthenelse{\equal{#1}{section}}{% + \addtocontents{toc}{\protect\setcounter{tocdepth}{1}} + \@knownsect@ctrue}{} + \ifthenelse{\equal{#1}{subsection}}{ + \addtocontents{toc}{\protect\setcounter{tocdepth}{2}} + \@knownsect@ctrue}{} + \ifthenelse{\equal{#1}{subsubsection}}{% + \addtocontents{toc}{\protect\setcounter{tocdepth}{3}} + \@knownsect@ctrue}{} + \ifthenelse{\equal{#1}{paragraph}}{% + \addtocontents{toc}{\protect\setcounter{tocdepth}{4}} + \@knownsect@ctrue}{} + \ifthenelse{\equal{#1}{subparagraph}}{% + \addtocontents{toc}{\protect\setcounter{tocdepth}{5}} + \@knownsect@ctrue}{} + \ifthenelse{\equal{#1}{all}}{% + \addtocontents{toc}{\protect\setcounter{tocdepth}{100}} + \@knownsect@ctrue}{} + \if@knownsect@c\else + \PackageError{tocvsec2}{% + Unknown sectioning command name (#1)}% + {I'll ignore it. Type \space <return> and I'll continue.} + \fi +} +\newcommand{\maxtocdepth}[1]{ + \@setseccntt@c{#1}{tocdepth}} +\newcommand{\setsecnumdepth}[1]{\leavevmode% + \@setseccntt@c{#1}{secnumdepth}} +\newcommand{\maxsecnumdepth}[1]{% + \@setseccntt@c{#1}{secnumdepth}} +\endinput +%% +%% End of file `tocvsec2.sty'. |