File: deepcut.hva

package info (click to toggle)
hevea 2.38-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,824 kB
  • sloc: ml: 19,525; sh: 505; makefile: 311; ansic: 132
file content (65 lines) | stat: -rw-r--r-- 2,243 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Instruct hacha to cut everywhere from part to subsection %%
%% Some code contributed by Gilles Gregoire                 %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Inactivate cutting macros %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\let\dc@cutdef\cutdef
\let\dc@cutend\cutend
%%%%%%%%%%%%%%%%%%%
%% cut footnotes  %
%%%%%%%%%%%%%%%%%%%
\let\deepcut@thefootnotes\thefootnotes
\let\enddeepcut@thefootnotes\endthefootnotes
\renewenvironment{thefootnotes}[2][]
{\begin{cutflow}{Notes}\begin{deepcut@thefootnotes}{#2}}
{\end{deepcut@thefootnotes}\end{cutflow}}
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% sectionning commands
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newif\ifcutchapter\cutchapterfalse
\let\dc@part\part\let\dc@part*\part*
\renewcommand{\part}[2][]
{\ifcutsubsection\dc@cutend\fi\cutsubsectionfalse
\ifcutsection\dc@cutend\fi\cutsectionfalse
\ifcutchapter\dc@cutend\fi
\ife#1\dc@part{#2}\else\dc@part[#1]{#2}\fi
\dc@cutdef{chapter}\cutchaptertrue}
\renewcommand{\part*}[1]
{\ifcutsubsection\dc@cutend\fi\cutsubsectionfalse
\ifcutsection\dc@cutend\fi\cutsectionfalse
\ifcutchapter\dc@cutend\fi
\dc@part*{#1}%
\dc@cutdef{chapter}\cutchaptertrue}
%%%%%%%%%%%%%%%%%%
\newif\ifcutsection\cutsectionfalse
\@ifundefined{chapter}{}
{\let\dc@chapter\chapter\let\dc@chapter*\chapter*
\renewcommand{\chapter}[2][]
{\ifcutsubsection\dc@cutend\fi\cutsubsectionfalse
\ifcutsection\dc@cutend\fi
\ife#1\dc@chapter{#2}\else\dc@chapter[#1]{#2}\fi
\dc@cutdef{section}\cutsectiontrue}
\renewcommand{\chapter*}[1]
{\ifcutsubsection\dc@cutend\fi\cutsubsectionfalse
\ifcutsection\dc@cutend\fi
\dc@chapter*{#1}%
\dc@cutdef{section}\cutsectiontrue}}
%%%%%%%%%%%%%%%%%%
\newif\ifcutsubsection\cutsubsectionfalse
\let\dc@section\section
\let\dc@section*\section*
\renewcommand{\section}[2][]
{\ifcutsubsection\dc@cutend\fi
\ife#1\dc@section{#2}\else\dc@section[#1]{#2}\fi
\dc@cutdef{subsection}\cutsubsectiontrue}
\renewcommand{\section*}[1]
{\ifcutsubsection\dc@cutend\fi
\dc@section*{#1}%
\dc@cutdef{subsection}\cutsubsectiontrue}
%%%%%Check that!
\AtEndDocument
{\ifcutsubsection\dc@cutend\fi\ifcutsection\dc@cutend\fi\ifcutchapter\dc@cutend\fi}