summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/akktex/akkparskip.sty
blob: 92f73b5b290d5d1360aa05e3241a03fbcfce93ff (plain)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
%=====================================================================================================================================
% Package akkparskip by Igor Akkerman (c) 2004, 2005
% Package providing a non empty paragraph skip with list and section environment corrections.
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License (latest version).
%
% The latest version of this license can be found at
%     http://www.latex-project.org/lppl.txt
%
% This file may only be distributed together with the full 'AkkTeX' bundle.
%=====================================================================================================================================
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{akkparskip}[2005/04/30 by Igor Akkerman (c) 2004, 2005 v1.3.2 Package providing a non empty paragraph skip with list and section environment corrections.]
%=====================================================================================================================================

\RequirePackage{akksection}

\makeatletter

\newcommand \akk@layoutlist {%
    % ------------------------------------------------------------------------------
    % set default labelsep
    % (as set for the article class) 
    %
    \setlength   \labelsep     \akk@default@labelsep%
    % ------------------------------------------------------------------------------
    % set default labelwidth
    % (as set in size10.clo for the article class)
    %
    \setlength   \labelwidth    \leftmargin%
    \addtolength \labelwidth    {-\labelsep}%
    % ------------------------------------------------------------------------------
    % set default rightmargin
    %
    \setlength   \rightmargin   \akk@default@rightmargin%
    % ------------------------------------------------------------------------------
    % set default listparindent
    %
    \setlength   \listparindent \akk@default@listparindent%
    % ------------------------------------------------------------------------------
    % set default itemindent
    %
    \setlength   \itemindent    \akk@default@itemindent%
    % ------------------------------------------------------------------------------
    % set default topsep
    % (set it to the default topsep value of the article class
    %  minus the parskip since we don't need it before and after the list)
    %
    \setlength   \topsep        \akk@default@topsep%
    \addtolength \topsep        {-\parskip}%
    % ------------------------------------------------------------------------------
    % set default partopsep
    % (set it to our parskip value)
    %
    \setlength   \partopsep   \akk@default@partopsep%
    % ------------------------------------------------------------------------------
    % set default parsep
    % (set it to our parskip value)
    %
    \setlength   \parsep      \akk@default@parsep%
    % ------------------------------------------------------------------------------
    % set default itemsep
    % (set it to the default itemsep value minus the parsep since we don't need it)
    %
    \setlength   \itemsep     \akk@default@itemsep%
    \addtolength \itemsep     {-\parsep}%
    % ------------------------------------------------------------------------------
}

\let \akk@orig@listI   \@listI
\let \akk@orig@listi   \@listi
\let \akk@orig@listii  \@listii
\let \akk@orig@listiii \@listiii
\let \akk@orig@listiv  \@listiv
\let \akk@orig@listv   \@listv
\let \akk@orig@listvi  \@listvi

\newcommand \akk@default@listI {%
    \setlength \leftmargin \leftmargini%
    \akk@layoutlist%
}
\let \akk@default@listi \akk@default@listI
     
\newcommand \akk@default@listii {%
    \setlength \leftmargin \leftmarginii%
    \akk@layoutlist%
}
     
\newcommand \akk@default@listiii {%
    \setlength \leftmargin \leftmarginiii%
    \akk@layoutlist%
}
 
\newcommand \akk@default@listiv {%
    \setlength \leftmargin \leftmarginiv%
    \akk@layoutlist%
}

\newcommand \akk@default@listv {%
    \setlength \leftmargin \leftmarginv%
    \akk@layoutlist%
}

\newcommand \akk@default@listvi {%
    \setlength \leftmargin \leftmarginvi%
    \akk@layoutlist%
}

% --------------------------------------------------------------------------------------------------------------------------------------------------------------------

% original values of the article class
\newlength \akk@orig@parskip
\newlength \akk@orig@parindent
\newlength \akk@orig@labelsep
\newlength \akk@orig@rightmargin
\newlength \akk@orig@listparindent
\newlength \akk@orig@itemindent
\newlength \akk@orig@topsep
\newlength \akk@orig@partopsep
\newlength \akk@orig@parsep
\newlength \akk@orig@itemsep

% actual default values of this style
\newlength \akk@default@parskip
\newlength \akk@default@parindent
\newlength \akk@default@labelsep
\newlength \akk@default@rightmargin
\newlength \akk@default@listparindent
\newlength \akk@default@itemindent
\newlength \akk@default@topsep
\newlength \akk@default@partopsep
\newlength \akk@default@parsep
\newlength \akk@default@itemsep

% skips before and after sections
\newlength \akk@@beforesectionskip
\newlength \akk@@beforesubsectionskip
\newlength \akk@@beforesubsubsectionskip
\newlength \akk@@beforeparagraphskip
\newlength \akk@@aftersectionskip
\newlength \akk@@aftersubsectionskip
\newlength \akk@@aftersubsubsectionskip
\newlength \akk@@afterparagraphskip

% get the original values of the article class
\setlength \akk@orig@parskip          \parskip
\setlength \akk@orig@parindent        \parindent
\setlength \akk@orig@labelsep         \labelsep
\setlength \akk@orig@rightmargin      \rightmargin
\setlength \akk@orig@listparindent    \listparindent
\setlength \akk@orig@itemindent       \itemindent
\setlength \akk@orig@topsep           \topsep
\setlength \akk@orig@partopsep        \partopsep
\setlength \akk@orig@parsep           \parsep
\setlength \akk@orig@itemsep          \itemsep

% set the actual default values of this style
\setlength \akk@default@parindent     \z@
\setlength \akk@default@parskip       {0.71125\baselineskip plus 2pt} % = 3mm bei 10pt
\setlength \akk@default@labelsep      \akk@orig@labelsep
\setlength \akk@default@rightmargin   \z@
\setlength \akk@default@listparindent \z@
\setlength \akk@default@itemindent    \z@
\setlength \akk@default@topsep        \akk@orig@topsep
\setlength \akk@default@partopsep     \akk@default@parskip
\setlength \akk@default@parsep        \akk@default@parskip
\setlength \akk@default@itemsep       \akk@orig@itemsep

\newcommand \akk@setoriginalvalues {%
    \let \@listI   \akk@orig@listI%
    \let \@listi   \akk@orig@listi%
    \let \@listii  \akk@orig@listii%
    \let \@listiii \akk@orig@listiii%
    \let \@listiv  \akk@orig@listiv%
    \let \@listv   \akk@orig@listv%
    \let \@listvi  \akk@orig@listvi%
    \setlength \parskip       \akk@orig@parskip%
    \setlength \parindent     \akk@orig@parindent%
    \setlength \labelsep      \akk@orig@labelsep%
    \setlength \rightmargin   \akk@orig@rightmargin%
    \setlength \listparindent \akk@orig@listparindent%
    \setlength \itemindent    \akk@orig@itemindent%
    \setlength \topsep        \akk@orig@topsep%
    \setlength \partopsep     \akk@orig@partopsep%
    \setlength \parsep        \akk@orig@parsep%
    \setlength \itemsep       \akk@orig@itemsep%
}

\newcommand \akk@setdefaultvalues {%
    \let \@listI   \akk@default@listI%
    \let \@listi   \akk@default@listi%
    \let \@listii  \akk@default@listii%
    \let \@listiii \akk@default@listiii%
    \let \@listiv  \akk@default@listiv%
    \let \@listv   \akk@default@listv%
    \let \@listvi  \akk@default@listvi%
    \setlength \parskip       \akk@default@parskip%
    \setlength \parindent     \akk@default@parindent%
    \setlength \labelsep      \akk@default@labelsep%
    \setlength \rightmargin   \akk@default@rightmargin%
    \setlength \listparindent \akk@default@listparindent%
    \setlength \itemindent    \akk@default@itemindent%
    \setlength \topsep        \akk@default@topsep%
    \setlength \partopsep     \akk@default@partopsep%
    \setlength \parsep        \akk@default@parsep%
    \setlength \itemsep       \akk@default@itemsep%
    \akk@layoutlist%
}

% \akk@beforesectionskip {<sectionname>} {<skip before section>}
\newcommand \akk@beforesectionskip[2] {%
    \expandafter \setlength \csname akk@@before#1skip\endcsname {-\akk@default@parskip}%
    \expandafter \addtolength \csname akk@@before#1skip\endcsname {#2}%
}

% \akk@aftersectionskip {<sectionname>} {<skip after section>}
\newcommand \akk@aftersectionskip[2] {%
    \expandafter \setlength \csname akk@@after#1skip\endcsname {-\akk@default@parskip}%
    \expandafter \addtolength \csname akk@@after#1skip\endcsname {#2}%
}

\akk@beforesectionskip {section}       {3.5ex \@plus 1ex \@minus .2ex}
\akk@aftersectionskip  {section}       {2.3ex \@plus.2ex}

\akk@beforesectionskip {subsection}    {3.25ex\@plus 1ex \@minus .2ex}
\akk@aftersectionskip  {subsection}    {1.5ex \@plus .2ex}

\akk@beforesectionskip {subsubsection} {3.25ex\@plus 1ex \@minus .2ex}
\akk@aftersectionskip  {subsubsection} {1.5ex \@plus .2ex}

\akk@beforesectionskip {paragraph}     {2ex   \@plus 1ex \@minus .2ex}
\akk@aftersectionskip  {paragraph}     {.3ex  \@plus .2ex}

% \akk@startsection{<name>}{<ebene>}{<einzug>}{<einziehen?>}{<vorabstand>}{<eingebettet?>}{<nachabstand>}{stil}
\renewcommand \section       {\akk@startsection {section}       {1} {0pt} {false} {\akk@@beforesectionskip}       {false} {\akk@@aftersectionskip}       {\normalfont\Large\bfseries}}
\renewcommand \subsection    {\akk@startsection {subsection}    {2} {0pt} {false} {\akk@@beforesubsectionskip}    {false} {\akk@@aftersubsectionskip}    {\normalfont\large\bfseries}}
\renewcommand \subsubsection {\akk@startsection {subsubsection} {3} {0pt} {false} {\akk@@beforesubsubsectionskip} {false} {\akk@@aftersubsubsectionskip} {\normalfont\normalsize\bfseries}}
\renewcommand \paragraph     {\akk@startsection {paragraph}     {4} {0pt} {false} {\akk@@beforeparagraphskip}     {false} {\akk@@afterparagraphskip} {\normalfont\bfseries}}

\akk@setdefaultvalues

\makeatother