Revision 1
Dodan clanek gga
clanki/clanek_gga/performance_analysis_new.aux | ||
---|---|---|
1 |
\relax |
|
2 |
\citation{holland75} |
|
3 |
\@writefile{toc}{\contentsline {title}{Performance Analysis of Partial Use of Local Optimisation Operator on Genetic Algorithm for TSP}{1}} |
|
4 |
\@writefile{toc}{\authcount {3}} |
|
5 |
\@writefile{toc}{\contentsline {author}{Milan Djordjevic \and Andrej Brodnik \and Marko Grgurovic}{1}} |
|
6 |
\@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{1}} |
|
7 |
\newlabel{sec:1}{{1}{1}} |
|
8 |
\citation{garey79} |
|
9 |
\citation{garey79} |
|
10 |
\citation{engels09} |
|
11 |
\citation{hoos05} |
|
12 |
\citation{merz01} |
|
13 |
\citation{sels11} |
|
14 |
\citation{freisleben96} |
|
15 |
\citation{hoos05} |
|
16 |
\citation{djordjevic08,djordjevic09} |
|
17 |
\citation{freisleben96} |
|
18 |
\citation{helsgaun00} |
|
19 |
\@writefile{toc}{\contentsline {section}{\numberline {2}Grafted GA for the TSP}{2}} |
|
20 |
\newlabel{sec:2}{{2}{2}} |
|
21 |
\@writefile{loa}{\contentsline {algorithm}{\numberline {1}{\ignorespaces Pseudocode}}{3}} |
|
22 |
\newlabel{alg:gga}{{1}{3}} |
|
23 |
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Exchange step of 2-opt algorithm}}{3}} |
|
24 |
\newlabel{fig:example}{{1}{3}} |
|
25 |
\citation{applegate01} |
|
26 |
\@writefile{toc}{\contentsline {section}{\numberline {3}Experiment}{4}} |
|
27 |
\newlabel{sec:3}{{3}{4}} |
|
28 |
\@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces Five techniques for solving Euclidean TSP}}{4}} |
|
29 |
\newlabel{fig:Table 1}{{1}{4}} |
|
30 |
\citation{bosman99} |
|
31 |
\citation{applegate01} |
|
32 |
\@writefile{toc}{\contentsline {section}{\numberline {4}Results}{5}} |
|
33 |
\newlabel{sec:4}{{4}{5}} |
|
34 |
\@writefile{lot}{\contentsline {table}{\numberline {2}{\ignorespaces Partial Grafting of a Genetic Algorithm}}{7}} |
|
35 |
\newlabel{fig:Tablesve}{{2}{7}} |
|
36 |
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces Results for pr439}}{8}} |
|
37 |
\newlabel{fig:example2}{{2}{8}} |
|
38 |
\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces Running times}}{8}} |
|
39 |
\newlabel{fig:example3}{{3}{8}} |
|
40 |
\@writefile{toc}{\contentsline {section}{\numberline {5}Conclusions}{8}} |
|
41 |
\newlabel{sec:5}{{5}{8}} |
|
42 |
\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces Results for end sequence}}{9}} |
|
43 |
\newlabel{fig:example4}{{4}{9}} |
|
44 |
\bibcite{applegate01}{1} |
|
45 |
\bibcite{djordjevic08}{2} |
|
46 |
\bibcite{djordjevic09}{3} |
|
47 |
\bibcite{bosman99}{4} |
|
48 |
\bibcite{engels09}{5} |
|
49 |
\bibcite{freisleben96}{6} |
|
50 |
\bibcite{garey79}{7} |
|
51 |
\bibcite{helsgaun00}{8} |
|
52 |
\bibcite{holland75}{9} |
|
53 |
\bibcite{hoos05}{10} |
|
54 |
\bibcite{merz01}{11} |
|
55 |
\bibcite{sels11}{12} |
clanki/clanek_gga/performance_analysis_new.tex | ||
---|---|---|
1 |
%%%%%%%%%%%%%%%%%%%% author.tex %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
2 |
% |
|
3 |
% sample root file for your "contribution" to a contributed volume |
|
4 |
% |
|
5 |
% Use this file as a template for your own input. |
|
6 |
% |
|
7 |
%%%%%%%%%%%%%%%% Springer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
8 |
|
|
9 |
|
|
10 |
% RECOMMENDED %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
11 |
\documentclass{llncs} |
|
12 |
\usepackage{makeidx} |
|
13 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
14 |
|
|
15 |
\usepackage{epsfig} |
|
16 |
\usepackage{algorithm} |
|
17 |
\usepackage{algpseudocode} |
|
18 |
\begin{document} |
|
19 |
|
|
20 |
\frontmatter |
|
21 |
\pagestyle{headings} % switches on printing of running heads |
|
22 |
|
|
23 |
\mainmatter % start of the contributions |
|
24 |
|
|
25 |
\title{Performance Analysis of Partial Use of Local Optimisation Operator on Genetic Algorithm for TSP} |
|
26 |
|
|
27 |
\titlerunning{Performance Analysis of Partial Use of Local Search and Genetic Algorithm} |
|
28 |
% Use \titlerunning{Short Title} for an abbreviated version of |
|
29 |
% your contribution title if the original one is too long |
|
30 |
\author{Milan Djordjevic \and Andrej Brodnik \and Marko Grgurovic} |
|
31 |
% Use \authorrunning{Short Title} for an abbreviated version of |
|
32 |
% your contribution title if the original one is too long |
|
33 |
\institute{Department of Information Science and Technology\\University of Primorska, Koper, Slovenia\\ |
|
34 |
\email{milan.djordjevic@student.upr.si}, \email{andrej.brodnik@upr.si}, \email{marko.grgurovic@student.upr.si}} |
|
35 |
% |
|
36 |
% Use the package "url.sty" to avoid |
|
37 |
% problems with special characters |
|
38 |
% used in your e-mail or web address |
|
39 |
% |
|
40 |
\maketitle |
|
41 |
|
|
42 |
\abstract{The paper analyzes separate, combined and partial performance of local searcher and genetic algorithm. |
|
43 |
%We propose a strategy to graft a 2-opt local searcher into a genetic algorithm, after recombination, to optimize each offspring`s genomes. |
|
44 |
On the well studied Euclidean \textit{Travelling Salesman Problem} we examine the impact of grafting a \textit{2-opt} heuristic based local searcher into the genetic algorithm for solving the Euclidean Travelling Salesman Problem. |
|
45 |
%Standard genetic algorithms are known to be rather slow, while 2-opt search applied to the Travelling Salesman Problem quickly gives results that are far from optimal. |
|
46 |
Genetic algorithm provides a diversification, while 2-opt improves intensification. Results on examples from \textit{TSPLIB} show that this method combines good qualities from both methods applied and significantly outperforms each individual method. The experiment extension demonstrate a third generation testing on hybrid genetic algorithms where an influence of partial grafting a 2-opt local searcher into genetic algorithm was tested.} |
|
47 |
|
|
48 |
|
|
49 |
\section{Introduction} |
|
50 |
\label{sec:1} |
|
51 |
|
|
52 |
Genetic Algorithms (GA) use some mechanisms inspired by biological evolution \cite{holland75}. They are applied on a finite set of individuals called population. Each individual in a population represents one of the feasible solutions of the search space. Mapping between genetic codes and the search space is called encoding and can be binary or over some alphabet of higher cardinality. Good choice of encoding is a basic condition for successful application of a genetic algorithm. Each individual in the population is assigned a value called fitness. Fitness represents a relative indicator of quality of an individual compared to other individuals in the population. Selection operator chooses individuals from the current population and takes the ones that are transferred to the next generation. Thereby, individuals with better fitness are more likely to survive in the population`s next generation. The recombination operator combines parts of genetic code of the individuals (parents) into codes of new individuals (offsprings). |
|
53 |
%Such a mixing of genetic material enables that well-fitted individuals or their relatively good genes give even better offspring. By a successive application of selection and crossover, the diversity of genetic material can be decreased which leads to a premature convergence in a local optimum which may be far from a global one. |
|
54 |
The components of the genetic algorithm software system are: Genotype, Fitness function, Recombinator, Selector, Mater, Replacer, Terminator, and in our system a Local searcher which is new extended component. |
|
55 |
%The basic step of 2-opt is delete two edges from a tour and reconnect the remaining fragments of the tour by adding two new edges. |
|
56 |
%Once we choose the two edges to delete, we do not have a choice about which edges to add there is only one way to add new edges that results in a valid tour. |
|
57 |
%The 2-opt algorithm repeatedly looks for 2-opt moves that decrease the cost of the tour. A 2-opt move decreases the cost of a tour when the sum of the lengths of the two deleted edges is greater than the sum of the lengths of the two new replaced edges. A 2-opt move is the same as inverting a subsequence of cities in the tour. |
|
58 |
%\medskip |
|
59 |
%\noindent |
|
60 |
%{\it Here is a pseudo code for the 2-opt local search algorithm:} |
|
61 |
%\begin{verbatim} |
|
62 |
%current_tour := create_random_initial_tour() |
|
63 |
%repeat |
|
64 |
% modified_tour := apply_2opt_move(current_tour) |
|
65 |
% if length(modified_tour) < length(current_tour) |
|
66 |
%then current_tour := modified_tour |
|
67 |
%until no further improvement or a specified number of iterations |
|
68 |
%\end{verbatim} |
|
69 |
In this paper we study a well defined problem of a Traveling Salesman Problem (TSP). In the TSP a set $ \left\{C_{1}, C_{2}, ... C_{N}\right\}$ of cities is considered and for each pair $\left\{{C_{i},C_{j}}\right\}$ of distinct cities a distance $d(C_{i},C_{j})$ is given. The goal is to find an ordering $\pi$ of the cities that minimizes the quantity |
|
70 |
|
|
71 |
\begin{equation} |
|
72 |
\sum^{N-1}_{i=1}d(C_{\pi(i)} , C_{\pi(i+1)} ) + d(C_{\pi(N)} , C_{\pi(1)}). |
|
73 |
\end{equation} |
|
74 |
|
|
75 |
This quantity is referred to as the tour length since it is the length of the tour a salesman would make when visiting the cities in the order specified by the permutation, returning at the end to the initial city. We will concentrate in this paper on the symmetric TSP in which the distances satisfy $d(C_{i}, C_{j})=d(C_{j},C_{i} )$ for $1 \leq i,j \leq N$ and more specificaly to the Euclidean distance. While the TSP is known to be \textit{NP-hard} \cite{garey79} even under substantial restrictions, the case with Euclidean distance is well researched and there are many excellent algorithms which perform well even on very large cases \cite{garey79}. |
|
76 |
|
|
77 |
%Genetic algorithms have been successfully applied to the TSP, but for restricted versions of the TSP, such as one with the Euclidean distance, they are very slow in convergence and more efficient methods are known ~\cite{freisleben96}. |
|
78 |
The 2-opt is a simple local search algorithm for the TSP. The main idea behind it is to take a route that crosses itself and reorder it so that it does not cross itself any more. The 2-opt local search will be used to hybridize GA metaheuristic to solve TSP. Although the 2-opt algorithm \cite{engels09} performs well and can be applied to Traveling Salesman Problems with many cities, it finds only a local minimum. The nearest neighbour algorithm \cite{hoos05} is one of the most intuitive heuristic algorithms for the TSP. It's a greedy method for solving the TSP. |
|
79 |
The genetic algorithm considered in this paper are hybrid genetic algorithms, incorporating local search which have been referred to as Memetic Algorithms (MA) \cite{merz01}. One example of hybridisation of genetic algorithms is shown in \cite{sels11} |
|
80 |
%~\cite{krasnogor05}, |
|
81 |
|
|
82 |
\section{Grafted GA for the TSP} |
|
83 |
\label{sec:2} |
|
84 |
% Always give a unique label |
|
85 |
% and use \ref{<label>} for cross-references |
|
86 |
% and \cite{<label>} for bibliographic references |
|
87 |
% use \sectionmark{} |
|
88 |
% to alter or adjust the section heading in the running head |
|
89 |
|
|
90 |
%Grafted genetic algorithm. |
|
91 |
Grafting in botanic is when the tissues of one plant are affixed to the tissues of another. |
|
92 |
%To speed maturity of hybrids in fruit tree breeding programs, hybrid seedlings may take ten or more years to flower and fruit on their own roots. |
|
93 |
Grafting can reduce the time to flowering and shorten the breeding program. |
|
94 |
Local Searcher is an extension of the conventional genetic algorithm as it does not need to make use of genetic components. It facilitates the optimization of individual genomes outside the evolution process. There are many implementations of local searchers \cite{freisleben96}, some even in hardware \cite{hoos05}. |
|
95 |
|
|
96 |
In our algorithm, the pseudocode can be seen in Algorithm \ref{alg:gga}, after the recombination has been applied (line 7 in the pseudocode), a Local Searcher is used to optimize every single offspring genome (line 8 in the pseudocode). Because of the usage of such external optimizer the genetic algorithm is no longer $pure$ and therefore we speak of a grafted genetic algorithm \cite{djordjevic08,djordjevic09}. This form of optimization is of a local kind. It alters the genome by heuristically changing the solution. %When approximating a TSP instance, a 2-opt local optimization technique is applied to make modifications to a genome so as to create better genomes at a higher rate. These are much desired because the evolution process can be quite slow with respect to the desired results. Furthermore it has always been the case in optimization that incorporating problem specific knowledge (not only through local optimizations, but also in defining the evolutionary operators) is required to gain better results. |
|
97 |
%A genome represents a potential solution to a problem. How the solution information is coded within a genome is determined by the genotype. TSP Numbered List is a representation of a tour in the TSP by means of a list in which the locations are identified by numbers. |
|
98 |
Edge map crossover \cite{freisleben96} is an implementation of the recombination operator (line 7 in the Algorithm \ref{alg:gga}). It makes use of a so called edge map. |
|
99 |
%Edge map is a table in which each location is placed. For each location there is a list in which the neighbouring locations are listed with this location. Recombination is then established as follows: |
|
100 |
%\medskip |
|
101 |
%\noindent |
|
102 |
%{\it Here is a pseudcode for the 2-opt local search algorithm:} |
|
103 |
%\begin{verbatim} |
|
104 |
%1. Choose the first location of one of both parents |
|
105 |
% to be the current location. |
|
106 |
%2. Remove the current location from the edge map |
|
107 |
% lists. |
|
108 |
%3. If the current location still has remaining edges, |
|
109 |
% go to step 4, otherwise go to step 5. |
|
110 |
%4. Choose the new current location from the edge |
|
111 |
% map lists of the current location as the one with |
|
112 |
% the shortest edge map list. |
|
113 |
%5. If there are remaining locations, choose the one |
|
114 |
% with the shortest edge map list to be the current |
|
115 |
% location and return to step 2. |
|
116 |
%Example: |
|
117 |
%Parents: 1-2-3-4-5-6; 2-4-3-1-5-6 |
|
118 |
%Edge map: 1) 2 6 3 5; 2) 1 3 4 6; 3) 2 4 1; |
|
119 |
% 4) 3 5 2; 5) 4 6 1; 6) 1 5 2 6 |
|
120 |
%1. Random choice: 2. |
|
121 |
%2. Next candidates: 1 3 4 6, choose from 3 4 6 |
|
122 |
% (same #edges), choose 3. |
|
123 |
%3. Next candidates: 1 4 (edge list 4 < edge list 1), |
|
124 |
% choose 4. |
|
125 |
%4. Next candidate: 5, choose 5. |
|
126 |
%5. Next candidate: 1 6 (tie breaking) choose 1 |
|
127 |
%6. Next candidate; 6, choose 6. |
|
128 |
%Offspring: 2-3-4-5-1-6 |
|
129 |
%\end{verbatim} |
|
130 |
Distance preserving crossover \cite{helsgaun00} is another implementation of the recombination operator (line 7 in the Algorithm \ref{alg:gga}). It attempts to create a new tour with the same distance to both parents. |
|
131 |
%In order to establish this, the content of the first parent is copied to the offspring and all edges that do not occur in the second parent are removed. The resulting fragments are reconnected without making use of non-overlapping edges of the parents. If edge $(i, j)$ has been destroyed, the nearest available neighbor $k$ of $i$ from the remaining fragments, is selected and the edge $(i, k)$ is added to the tour |
|
132 |
%\medskip |
|
133 |
%\noindent |
|
134 |
%{\it Here is a pseudcode for the 2-opt local search algorithm:} |
|
135 |
%\begin{verbatim} |
|
136 |
%Example: Parents: 5-3-9-1-2-8-0-6-7-4; 1-2-5-3-9-4-8-6-0-7 |
|
137 |
%Fragments: 5-3-9|1-2|8|0-6|7|4 |
|
138 |
%Offspring: 6-0-5-3-9-8-7-2-1-4 |
|
139 |
%\end{verbatim} |
|
140 |
% |
|
141 |
%Tournament Selector places groups of genomes from the population together, creating the groups from top to bottom with respect to the enumerative ordering of the genomes in the population and selects the best of the genomes within this group. This is repeated until the required amount of genomes is selected. The selection size is 400, and tournament size is 2. The Random Mater is a simple way of mating parents. It mates the parents as enumerated in the population at random using the mating size to create groups until no more groups can be created. The grouping size is 2. The new offspring only replacer is the implementation of the classical replacement strategy that simply only allows the offspring to survive. Thus the genomes from the next generation replace the entire current population. The equality terminator for all equal genomes implements the termination condition specifying that the genetic algorithm should terminate when all genomes in the population are identical-all equal genomes. |
|
142 |
The local learcher is an extension to the conventional genetic algorithm as it needs not make use of genetic operators. It facilitates the optimization of individual genomes outside the evolution process. |
|
143 |
%After the Recombination has been applied, a Local Searcher is used to optimize every single offspring genome. |
|
144 |
The Local Searcher has no further knowledge on the execution of the genetic algorithm in the larger setting. The system will provide it with the genome it needs to locally optimize when needed. |
|
145 |
\medskip |
|
146 |
|
|
147 |
\begin{algorithm} |
|
148 |
\caption{Pseudocode} |
|
149 |
\label{alg:gga} |
|
150 |
\begin{algorithmic}[1] |
|
151 |
%\Procedure{Euclid}{$a,b$}\Comment{The g.c.d. of a and b} |
|
152 |
\State $t=0$ |
|
153 |
\State {{initialize} $(P(t))$} |
|
154 |
\State {{evaluate} $(P(t))$} |
|
155 |
\While{{not terminate} $(P(t))$} |
|
156 |
\State{$sel$ = {select} $(P(t))$} |
|
157 |
\State{$mat$ = {mate} $(sel)$} |
|
158 |
\State{$rec$ = for each mated collection $m \in mat$ |
|
159 |
do recombination$(r)$} |
|
160 |
\State{$loc$ = for each genome $g$ in each recombined |
|
161 |
collection $r \in rec$ do local search} |
|
162 |
|
|
163 |
\State{$rep$ = replace($loc$, $P(t)$)} |
|
164 |
\State{$P(t+1)$ = select$(rep)$} |
|
165 |
\State{evaluate {$(P(t+1))$}} |
|
166 |
\State{$t=t+1$} |
|
167 |
\EndWhile |
|
168 |
%\While{$r\not=0$}\Comment{We have the answer if r is 0} |
|
169 |
%\State $a\gets b$ |
|
170 |
%\State $b\gets r$ |
|
171 |
%\State $r\gets a\bmod b$ |
|
172 |
%\EndWhile\label{euclidendwhile} |
|
173 |
%\State \textbf{return} $b$\Comment{The gcd is b} |
|
174 |
%\EndProcedure |
|
175 |
\end{algorithmic} |
|
176 |
\end{algorithm} |
|
177 |
|
|
178 |
%\noindent |
|
179 |
%{\it Here is a pseudo code for the algorithm:} |
|
180 |
%\begin{verbatim} |
|
181 |
%t=0 |
|
182 |
%initialize(P(t)) |
|
183 |
%evaluate(P(t)) |
|
184 |
%while(not terminate(P(t))) do |
|
185 |
% sel = select(P(t)) |
|
186 |
% mat = mate(sel) |
|
187 |
%rec = for each mated collection m belongs to mat do |
|
188 |
% recombination(r) |
|
189 |
%loc = for each genome g in each recombined collection |
|
190 |
% r belongs to rec do local search(l) |
|
191 |
%rep = replace(loc, P(t)) |
|
192 |
%P(t+1) = select(rep) |
|
193 |
%evaluate(P(t+1)) |
|
194 |
%t=t+1 |
|
195 |
%\end{verbatim} |
|
196 |
The 2-opt local searcher is a local optimizer for the TSP that has been grafted into the standard genetic algorithm (line 8 in the Algorithm \ref{alg:gga}). This local optimizer performs the 2-opt heuristic that exchanges edges to reduce the length of a tour. An exchange step consists of removing two edges from the current tour and reconnecting the resulting two paths in the best possible way Fig. \ref{fig:example}. |
|
197 |
|
|
198 |
\begin{figure}[b] |
|
199 |
\centering |
|
200 |
\includegraphics[height=3.6cm]{2opt.eps} |
|
201 |
\caption{Exchange step of 2-opt algorithm} |
|
202 |
\label{fig:example} |
|
203 |
\end{figure} |
|
204 |
|
|
205 |
Following experiments demonstrate a third generation testing on hybrid genetic algorithms. |
|
206 |
In the extension of an experiment an influence of partial grafting a 2-opt local searcher into genetic algorithm was tested. In the conducted experiments we will present an influence of grafting GA with local search and we will perform a performance analysis of partial use of local optimisation operator on GA for TSP. Furthermore, we will answer the questions of how often to graft a GA and when. |
|
207 |
|
|
208 |
\section{Experiment} |
|
209 |
|
|
210 |
\label{sec:3} |
|
211 |
|
|
212 |
\begin{table} |
|
213 |
%\sidecaption[t] |
|
214 |
\centering |
|
215 |
\caption{Five techniques for solving Euclidean TSP} |
|
216 |
%\vspace{7.8cm} |
|
217 |
\includegraphics[height=6.8cm]{tabela} |
|
218 |
\label{fig:Table 1} |
|
219 |
\end{table} |
|
220 |
|
|
221 |
For testing our strategy and comparing it to other solutions we used the instances of symmetric traveling salesman problem which can be found on TSPLIB. We deliberately used well known problem (TSP) and relatively small instances for which best solutions are known since the goal of this research is not to find a better algorithm for the symmetric TSP, but rather to compare on a controlled environment the impact of grafting a genetic algorithm. Altogether 20 instances have been tried out, with different complexity and range from 14 to 150 cities per instance, look in Table \ref{fig:Table 1}. |
|
222 |
We compared our method (grafted genetic algorithm (GGA)), separately in one case with edge map crossover (GGAemc) and in another case with a distance preserving crossover (GGAdpc) with four other methods. As the upper bound for the quality of solution we used the above mentioned Greedy Heuristic. For the lower bound for the quality of solution we used exact solutions, global minima, obtained by Concorde \cite{applegate01}. Then we compared our grafted method with a pure 2-opt algorithm and pure genetic algorithm. |
|
223 |
For Greedy Heuristic and the pure 2-opt Heuristic the running time is in a range from 0.5 to 1.5 seconds. |
|
224 |
%U nastavku eksperimenta smo testirali parcijalni uticaj cepljenja 2 opt algoritma i genetskog algoritma. Odnosno, kada lokalni searcher povremeno implementiramo u 10, 20, 40, 50, 80 i 90 \% od ukupnog broja generacija rada algoritma. |
|
225 |
%GGAemc i GGAdpc su algoritmi sa 100 \% korišćenja lokalnog searchera u celokupnom radu algoritma. |
|
226 |
%Ovo testiranje je izvršeno na najvećoj instanci sa oznakom ch150. |
|
227 |
%Broj generacija rada algoritma sa parcijalnim korišćenjem 2 opt algoritma je ograničen na broj generacija adekvatnog cepljenog genetskog algoritma sa 100 \% učestalosti. |
|
228 |
%Što znači da za instancu ch150 termination condition iznosi tačno 88 i 82 generacija respectively for GGAemc and GGAdpc. |
|
229 |
%Sa ovim kriterijumom terminacije garantujemo da će vreme rada parcijalnog GGA biti manje nego rad adekvatnog GGA sa 100 \% korišćenja loaklnog searchera. |
|
230 |
%U varijantama sa 40, 50, 80 \% učestalosti, smo testirali različite preraspodele generacija rada sa lokalnim searcherom, i to uniformly, na početku i na kraju. |
|
231 |
%Sve instance problema su zatim testirane sa 90 \% učestalosti rada lokalnog searchera u adekvatnom Graftovanom genetskom algoritmu. |
|
232 |
|
|
233 |
In experiment extension a local searcher is periodically implemented with 10, 20, 30, 40, 50, 60, 70, 80 and 90\% frequency. |
|
234 |
In all cases three different independent distributions of generations with local searcher were used: random, beginning sequence and ending sequence. Random variations means that use of local searcher is with adequate probability distributed in iterations of the algorithm. Begin sequence means that a sequence of iterations with local searcher is used in the first generations of an algorithm. While in the ending it is used on the last generations of the algorithm. |
|
235 |
%The pseudocode of the Partial Grafted Genetic Algorithm is given in Algorithm 2. The $W$ stands for a set of iterations with local searcher involved. |
|
236 |
The total number of iterations are limited to the number of iterations reached in grafted genetic algorithm with edge map recombination (GGAemc). |
|
237 |
The extension of an experiment include testing on a 10 largest instances from the Table \ref{fig:Table 1} plus instance pr439. The results presents average values of 5 runs for each tested method. |
|
238 |
|
|
239 |
All experiments were conducted on a computer with Pentium(R) 2.8 GHz CPU, with Windows 7. Furthemore, a development environment the \textit{EA Visualizer} \cite{bosman99}, an application written in \textit{Java} programming language, was used. The Concorde's code is written in the \textit{AnsiC} programming language. Therefore, in this research absolute times were not of crucial importance, we were only interested in relative performance of tested algorithms. |
|
240 |
|
|
241 |
%\begin{table} |
|
242 |
%%\sidecaption[t] |
|
243 |
%\centering |
|
244 |
%\caption{Three different variations of the algorithm with 50\% frequency of Local Searcher} |
|
245 |
%%\vspace{5.8cm} |
|
246 |
%\includegraphics[height=5.0cm]{tabela50} |
|
247 |
%\label{fig:Table50} |
|
248 |
%\end{table} |
|
249 |
|
|
250 |
\section{Results} |
|
251 |
\label{sec:4} |
|
252 |
|
|
253 |
The results of an experiment are summarized in Table \ref{fig:Table 1}. Twenty cases from the well known TSPLIB were used for testing. The names of these cases are in the first column and the name always contains the size of the problem, i.e. the number of cities (which are between 14 and 150). |
|
254 |
The last two columns are exact solutions (global minima) obtained by Concorde \cite{applegate01}, together with execution times. A well known problem with moderate sized examples and tools to get optimal solutions were selected, recall that a goal of this research is not to improve solutions for difficult problems but to compare and quantitatively examine the effects of grafting local searches (in this case 2-opt based) to standard genetic algorithm. Such knowledge can be used to fine tune and calibrate a hybrid system which can then be used on large cases. These last two columns are used as a reference for all other tests. |
|
255 |
The second column in Table \ref{fig:Table 1} represents lower bound for the quality of solution. It is a simple nearest neighbour heuristic. It is fast, but very unsophisticated and any reasonable algorithm should do better than that. This greedy heuristic gives results that are about 15 \% (except for some very small cases) worse than the optimal solution. The column titled quality shows by how many percent is the solution produced by this algorithm worse than the optimal solution. 0 \% in this column means algorithm found the best solution. The running times of the algorithm are from 0.2 to 2.3 in seconds. |
|
256 |
The third column in the Table \ref{fig:Table 1} corresponds to the pure 2-opt algorithm. As expected, it also gives quick but far from optimal solutions. It quickly finds a local minimum, but it is unable to broaden the search to find another local minimum. However, 2-opt algorithm is superior to greedy algorithm, the quality of the solution, with the similar running times from 0.2 to 2.5 seconds, is on average about 8 \% worse than optimal. |
|
257 |
The fourth column in the Table \ref{fig:Table 1} corresponds to the pure Genetic Algorithm. The running time, as expected, is significantly increased. While our GGA algorithm reached optimal solution below one second or few seconds (0.6 to 15.3 seconds), the running time for pure genetic algorithm was from 3.4 seconds to 100 seconds which was time-limit. In 12 out of 20 cases no optimal solution was found within that time limit, but in 8 cases an optimal solution was found and the middle column indicates in which generation that happened. For 12 cases where optimal solution was not found, the quality of found solution is expressed as for previous cases in percents above the optimal solution. |
|
258 |
The sixth column in Table \ref{fig:Table 1} describes results obtained by our grafted algorithm, which is programmed with edge map crossover as recombination operator (GGAemc). In 17 out of 20 considered cases an optimal solution was found. Remaining three instances differ from optimal solution in 0.01, 0.10 and 0.22 percent. The solutions were found in relatively few generations and very fast. Execution times were 0.6 to 15.2 seconds. |
|
259 |
The seventh column in Table \ref{fig:Table 1} corresponds to our grafted genetic algorithm which contains a distance preserving crossover as recombination operator (GGAdpc). In 11 out of 20 considered cases an optimal solution was found. In remained 9 cases, delivered solutions differ from optimal in range from 0.13 to 0.32 percent. The running time and number of generations of GGAdpc, in comparison with GGAemc, are slightly lesser, particularly in the lowermost part of the table which represents more complex instances. Quantitative results on test cases from \textit{TSPLIB} show that grafted algorithms, GGAemc and GGAdpc, have advantages. Even when their's components have serious drawbacks, their grafted combinations exhibits a very good behaviour. Results on examples from \textit{TSPLIB} show that this grafted method combines good qualities from both methods applied and significantly outperforms each individual method. |
|
260 |
%The difference in the quality on the other side is in the hand of GGAemc for the same considered cases. |
|
261 |
%Poenta eksperimenta predstavljenog u tabeli 1 je fino izkalibrirati sistem na manjim instancama da bi uspešno rešili veće. U nastavku odnosno nadogradnji eksperimenta u testiranju parcijalnog korišćenja ekstenzije lokalnog serchera na genetski algoritam, sistem kalibriramo upravo na najvećoj instanci iz tabele 1, zbog toga jer je u instanci ch150 najduža evolucija odnosno broj generacija algoritma, zatim najveće je vreme rada algoritma i najveća je razlika u kvalitetu dobijenog rešenja. |
|
262 |
|
|
263 |
|
|
264 |
%\begin{algorithm} |
|
265 |
%\caption{Pseudocode}\label{} |
|
266 |
%\begin{algorithmic}[] |
|
267 |
%%\Procedure{Euclid}{$a,b$}\Comment{The g.c.d. of a and b} |
|
268 |
%\State $t=0$ |
|
269 |
%\State {{initialize} $(P(t))$} |
|
270 |
%\State {{evaluate} $(P(t))$} |
|
271 |
%\While{{not terminate} $(P(t))$} |
|
272 |
%\State{$sel$ = {select} $(P(t))$} |
|
273 |
%\State{$mat$ = {mate} $(sel)$} |
|
274 |
%\State{$rec$ = for each mated collection $m \in mat$ |
|
275 |
%do recombination$(r)$} |
|
276 |
%\If {{$t \in W$}} |
|
277 |
%%\State $loc$ = $\bigcup_{g \in rec} LocalSearch(g)$ |
|
278 |
% |
|
279 |
%\State{$loc$ = for each genome $g$ in each recombined |
|
280 |
%collection $r \in rec$ do local search} |
|
281 |
%\EndIf |
|
282 |
%\State{$rep$ = replace($loc$, $P(t)$)} |
|
283 |
%\State{$P(t+1)$ = select$(rep)$} |
|
284 |
%\State{evaluate {$(P(t+1))$}} |
|
285 |
%\State{$t=t+1$} |
|
286 |
%\EndWhile |
|
287 |
%%\EndProcedure |
|
288 |
%\end{algorithmic} |
|
289 |
%\end{algorithm} |
|
290 |
\begin{table} |
|
291 |
%\sidecaption[t] |
|
292 |
\centering |
|
293 |
\caption{Partial Grafting of a Genetic Algorithm} |
|
294 |
%\vspace{4.8cm} |
|
295 |
\includegraphics[height=11.5cm,angle=90]{tabela_partial_gga5} |
|
296 |
\label{fig:Tablesve} |
|
297 |
\end{table} |
|
298 |
|
|
299 |
The results of experiment extension are summarized in Table \ref{fig:Tablesve} and in Figures \ref{fig:example2}, \ref{fig:example3} and \ref{fig:example4}. |
|
300 |
%The Table \ref{fig:Table50} describes results of 50\% frequancy use of local searcher. The results achieved by \textit{uniform} use of an algorithm show us results which vary from 0.0\% to 1.04\% from optimal, while running times vary from 6.1 to 14.6 seconds. In the second setting of an algorithm, named \textit{begin}, a little better results was achieved. The quality of solutions vary from 0.0 to 0.89\% from optimal, while the running times are the same. The best performance, of all three settings with 50\% use of local searcher, was achieved in the \textit{end} configuration. In two cases an optimal solutions was found, remaining instances differ from optimal solution in a range from 0.03 to 0.77\%. The running time vary from 6.1 to 14.6 seconds, which is the same as in \textit{begin} and \textit{uniform} configuration. |
|
301 |
%The Table \ref{fig:Tablesve} describe results of pure genetic algorithm (GAemc), variations of algorithms with 10, 20, 30, 40, 50, 60, 70, 80 and 90 percent frequency, and grafted genetic algorithm (GGAemc). The variations with 20, 30, and 40 precent frequency has an uniform distribution of iterations with local search. Furthermore, the variations with 60, 70, 80 and 90 percent frequency has and ending sequence distrubition. |
|
302 |
%For the lower bound for the quality of solution we used solutions obtained by GGA with edge map crossover as a recombination operator. |
|
303 |
The first column in Table \ref{fig:Tablesve} corresponds to the names of instances and the size of the problem (which are between 76 and 439) which are duplicated for better visualization of the table. |
|
304 |
The second column in the Table \ref{fig:Tablesve} presents the result of the pure Genetic Algorithm and grafted Genetic Algorithm, both with edge map crossover as recombination operator (GAemc and GGAemc). This algorithms contain 0\% and 100\% frequency of local search, respectively. The \textit{q} in Table \ref{fig:Tablesve} stands for \textit{quality} differ from optimal solution. The \textit{t} stands for running time. |
|
305 |
The third column in Table \ref{fig:Tablesve} represents results for 10\% and 90\% frequency. The subcolumn titles \textit{rnd, begin, end} stands for three variations of partial hybridization, random, begin sequence and end sequence, respectively. The result for 10\% frequency shows that this kind of algorithm settings is fast (the time vary from 0.9 seconds to 11.0 seconds), but the quality of solution (which vary from 0.34\% to 4.92\%), are weak. |
|
306 |
The best performance of all tested cases was achieved in the configuration with 90\% frequency, especially in variation with end sequence, with results coloured in red. In 9 out of 11 tested instances the results was the same as for GGAemc. For instance (kroB100) result was better in 0.01\%, and for instance pr439 a result is worse in 0.04\%. Furthermore, the solutions provided by, 90\% end sequnce variations, were found faster then by GGAemc. The running time vary from 3.3 to 78.9 seconds, compared to the time achieved by GGAemc, which vary from 3.6 to 91.8 seconds. This mean, that the {\em same quality} of result was achieved in {\em shorter time}. |
|
307 |
|
|
308 |
The results for instance pr439 can be seen in Figure \ref{fig:example2}. |
|
309 |
In 95\% of all tested cases, (look in columns from 3 to 7 in Table \ref{fig:Tablesve}) the best performance was achieved in variation with end sequence. |
|
310 |
Additionally, the results of end sequence for all instances can be seen in Figure \ref{fig:example4}. |
|
311 |
In all three variations of hybridization (random, begin and end) the running time is the same for particular frequency. For all tested instances the running time grows almost linerly with regard to percent of hybridization, see Figure \ref{fig:example3}. |
|
312 |
|
|
313 |
|
|
314 |
%The fourth column in Table \ref{fig:Tablesve} presents result for grafted algorithm with 20\% frequency use of local searcher. This kind of settings also gives quick but far from optimal solutions. A running times vary from 5.4 to 12.7 seconds, and a quality of solutions is in the range from 0.46 to 1.98\% diference from optimal solutions. |
|
315 |
%Fifth, sixth, seventh, eight and ninth column in Table \ref{fig:Tablesve} represents result of configurations with 30, 40, 60, 70 and 80 percent frequency use of local search, respectively. |
|
316 |
|
|
317 |
|
|
318 |
\begin{figure}%[b] |
|
319 |
\centering |
|
320 |
\includegraphics[height=5.8cm]{pr439.eps} |
|
321 |
\caption{Results for pr439} |
|
322 |
\label{fig:example2} |
|
323 |
\end{figure} |
|
324 |
|
|
325 |
\begin{figure}%[b] |
|
326 |
\centering |
|
327 |
\includegraphics[height=5.6cm]{time.eps} |
|
328 |
\caption{Running times} |
|
329 |
\label{fig:example3} |
|
330 |
\end{figure} |
|
331 |
|
|
332 |
\begin{figure}%[b] |
|
333 |
\centering |
|
334 |
\includegraphics[height=7.6cm]{end.eps} |
|
335 |
\caption{Results for end sequence} |
|
336 |
\label{fig:example4} |
|
337 |
\end{figure} |
|
338 |
|
|
339 |
\section{Conclusions} |
|
340 |
\label{sec:5} |
|
341 |
|
|
342 |
The goal of this paper was to investigate influence of grafting a 2-opt based local searcher into the standard genetic algorithm, for solving the Travelling Salesman Problem with Euclidean distance. It is known that genetic algorithms are very successful when implemented for many NP-hard problems. However, they are much more effective if some specific knowledge about particular problem is utilized. |
|
343 |
%The TSP is well researched problem with many such improvements, especially when the restricted version of the problem with Euclidean distance is considered. |
|
344 |
In our first experiment we compared two direct techniques, with our grafted genetic algorithms. Solutions from Concorde and greedy algorithm were added for better comparison. Quantitative results on test cases from \textit{TSPLIB} show that grafted algorithms have advantages. Even when both components have serious drawbacks, their grafted combinations exhibits a very good behaviour. Results on examples from \textit{TSPLIB} show that this method combines good qualities from both methods applied and significantly outperforms each individual method. |
|
345 |
%The future research will focus on a new heuristic algorithm for making an initial tour of Lin-Kernighan heuristic, which is known to be one of the most successful heuristics for the TSP. |
|
346 |
|
|
347 |
In the second part of an experiment an influence of partial grafting a 2-opt local searcher into genetic algorithm was studied. |
|
348 |
The {\em best performance} was achieved in a configuration with 90\% frequency with end sequence. In a comparison with a performance of GGAemc the {\em same quality} of results was achieved in a {\em shorter time}, on average a 7\% of running time was spared. |
|
349 |
The cases with 10\% frequency use of local search provides fast and far from optimal solutions but still better then the GAemc, with small increase in time. The configurations with 50\% frequency use of local searcher present a good examples of trade-off between a running time and quality, especcialy in setting with ending sequence of local searcher. |
|
350 |
From the results obtained in Table \ref{fig:Tablesve}, we can conclude that the best gain |
|
351 |
%results of tested hybrid genetic algorithms for solving an Euclidean Travelling Salesman Problem |
|
352 |
is attained when a local searcher is used in an ending sequence of the algorithm and in frequency not less then 50\% and not more than 90\%. |
|
353 |
%Further calibration of this system will include measuring the optimal blend of all components for larger test cases. |
|
354 |
There are several issues for future research, such as investigating the effects of a different use of the local optimisation and other metaheuristic algorithms, analyzing the individual performance gains provided by the local search, and to look at how to scale up the algorithm for solving large instances of TSP. |
|
355 |
|
|
356 |
%%%%%%%%%%%%%%%%%%%%%%%% reference %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
357 |
% sample references |
|
358 |
% % |
|
359 |
% Use this as a template for your own input. |
|
360 |
% |
|
361 |
%%%%%%%%%%%%%%%%%%%%%%%% Springer-Verlag %%%%%%%%%%%%%%%%%%%%%%%%%% |
|
362 |
% |
|
363 |
|
|
364 |
|
|
365 |
\begin{thebibliography}{99.}% |
|
366 |
% and use \bibitem to create references. |
|
367 |
% |
|
368 |
% Use the following syntax and markup for your references if |
|
369 |
% the subject of your book is from the field |
|
370 |
% "Mathematics, Physics, Statistics, Computer Science" |
|
371 |
% |
|
372 |
% Contribution |
|
373 |
\bibitem{applegate01} |
|
374 |
Applegate, D., Bixby, R., Chv\'{a}tal, V., Cook, W.: {TSP} cuts which do not |
|
375 |
conform to the template paradigm. In: Computational Combinatorial |
|
376 |
Optimization (2001) 261--304 |
|
377 |
|
|
378 |
\bibitem{djordjevic08} |
|
379 |
Djordjevic, M.: {Influence of Grafting a Hybrid Searcher Into the Evolutionary |
|
380 |
Algorithm}. In: Proceedings of the Seventeenth International Electrotechnical |
|
381 |
and Computer Science Conference. Slovenian Section IEEE (2008) 115--118 |
|
382 |
|
|
383 |
\bibitem{djordjevic09} |
|
384 |
Djordjevic, M., Tuba, M., Djordjevic, B.: {Impact of Grafting a 2-opt Algorithm |
|
385 |
Based Local Searcher Into the Genetic Algorithm}. In: Proceedings of the 9th |
|
386 |
WSEAS international conference on Applied informatics and communications. World Scientific and Engineering Academy and Society (WSEAS) (2009) 485--490 |
|
387 |
|
|
388 |
\bibitem{bosman99} |
|
389 |
Bosman, P., Thierens, D.: {On the modelling of evolutionary algorithms}. In: Proceedings of the Eleventh Belgium-Netherlands Conference on Artificial Intelligence BNAIC (1999) 67--74 |
|
390 |
|
|
391 |
\bibitem{engels09} |
|
392 |
Engels, C., Manthey, B.: Average-case approximation ratio of the 2-opt |
|
393 |
algorithm for the TSP. Operations Research Letters {\bfseries 37} (2009) 83--84 |
|
394 |
|
|
395 |
\bibitem{freisleben96} |
|
396 |
Freisleben, B., Merz, P.: New genetic local search operators for the traveling |
|
397 |
salesman problem. In: Proceedings of the 4th International Conference on |
|
398 |
Parallel Problem Solving from Nature (1996) 890--899 |
|
399 |
|
|
400 |
\bibitem{garey79} |
|
401 |
Garey, M., Johnson, D.: Computers and Intractability: A Guide to the Theory of |
|
402 |
NP-completeness. WH Freeman \& Co, New York (1979) |
|
403 |
|
|
404 |
\bibitem{helsgaun00} |
|
405 |
Helsgaun, K.: An effective implementation of the Lin-Kernighan traveling |
|
406 |
salesman heuristic. European Journal of Operational Research {\bfseries 126} |
|
407 |
(2000) 106--130 |
|
408 |
|
|
409 |
\bibitem{holland75} |
|
410 |
Holland, J.: Adaptation in natural and artificial systems. The University of |
|
411 |
Michigan Press, Ann Arbor (1975) |
|
412 |
|
|
413 |
\bibitem{hoos05} |
|
414 |
Hoos, H., Stutzle, T.: Stochastic local search: Foundations and applications. |
|
415 |
Morgan Kaufmann (2005) |
|
416 |
|
|
417 |
\bibitem{merz01} |
|
418 |
Merz, P., Freisleben, B.: Memetic algorithms for the traveling salesman |
|
419 |
problem. Complex Systems {\bfseries 13} (2001) 297--346 |
|
420 |
|
|
421 |
\bibitem{sels11} |
|
422 |
Sels, V., Vanhoucke, M.: A hybrid dual-population genetic algorithm for the single machine maximum lateness problem. In: Proceedings of the 11th European conference on Evolutionary computation in combinatorial optimization (2011) 14--25 |
|
423 |
\end{thebibliography} |
|
424 |
\end{document} |
clanki/clanek_gga/svmultor11.cls | ||
---|---|---|
1 |
% SVMULT DOCUMENT CLASS -- version 5.4 (25-Jun-07) |
|
2 |
% modded Version OR 2011 V1 (26-May-2011), 2 changes see OR2011 |
|
3 |
% Springer Verlag global LaTeX2e support for multi authored books |
|
4 |
%% |
|
5 |
%% |
|
6 |
%% \CharacterTable |
|
7 |
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z |
|
8 |
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z |
|
9 |
%% Digits \0\1\2\3\4\5\6\7\8\9 |
|
10 |
%% Exclamation \! Double quote \" Hash (number) \# |
|
11 |
%% Dollar \$ Percent \% Ampersand \& |
|
12 |
%% Acute accent \' Left paren \( Right paren \) |
|
13 |
%% Asterisk \* Plus \+ Comma \, |
|
14 |
%% Minus \- Point \. Solidus \/ |
|
15 |
%% Colon \: Semicolon \; Less than \< |
|
16 |
%% Equals \= Greater than \> Question mark \? |
|
17 |
%% Commercial at \@ Left bracket \[ Backslash \\ |
|
18 |
%% Right bracket \] Circumflex \^ Underscore \_ |
|
19 |
%% Grave accent \` Left brace \{ Vertical bar \| |
|
20 |
%% Right brace \} Tilde \~} |
|
21 |
%% |
|
22 |
\NeedsTeXFormat{LaTeX2e}[1995/12/01] |
|
23 |
\ProvidesClass{svmult}[2007/06/25 v5.4 |
|
24 |
^^JSpringer Verlag global LaTeX document class for multi authored books] |
|
25 |
%% |
|
26 |
%Additional Packages OR2011 |
|
27 |
\RequirePackage{algorithm} |
|
28 |
\RequirePackage{algpseudocode} |
|
29 |
\RequirePackage{amsfonts} |
|
30 |
\RequirePackage{amsmath} |
|
31 |
\RequirePackage{amssymb} |
|
32 |
\RequirePackage{graphicx} |
|
33 |
\RequirePackage{cite} |
|
34 |
%% |
|
35 |
\RequirePackage{mathptmx} % selects Times Roman as basic font |
|
36 |
\RequirePackage{helvet} % selects Helvetica as sans-serif font |
|
37 |
\RequirePackage{courier} % selects Courier as typewriter font |
|
38 |
\RequirePackage{type1cm} % activate if the above 3 fonts are |
|
39 |
% not available on your system |
|
40 |
%% |
|
41 |
% Options |
|
42 |
% citations |
|
43 |
\DeclareOption{natbib}{\ExecuteOptions{oribibl}% |
|
44 |
\AtEndOfClass{% Loading package 'NATBIB' |
|
45 |
\RequirePackage{natbib} |
|
46 |
% Changing some parameters of NATBIB |
|
47 |
\setlength{\bibhang}{\parindent} |
|
48 |
%\setlength{\bibsep}{0mm} |
|
49 |
\let\bibfont=\small |
|
50 |
\def\@biblabel#1{#1.} |
|
51 |
\newcommand{\etal}{\textit{et al}.} |
|
52 |
%\bibpunct[,]{(}{)}{;}{a}{}{,}}} |
|
53 |
}} |
|
54 |
% Springer environment |
|
55 |
\let\if@spthms\iftrue |
|
56 |
\DeclareOption{nospthms}{\let\if@spthms\iffalse} |
|
57 |
% |
|
58 |
\let\envankh\@empty % no anchor for "theorems" |
|
59 |
% |
|
60 |
\let\if@envcntreset\iffalse % environment counter is not reset |
|
61 |
\let\if@envcntresetsect=\iffalse % reset each section |
|
62 |
\DeclareOption{envcountresetchap}{\let\if@envcntreset\iftrue} |
|
63 |
\DeclareOption{envcountresetsect}{\let\if@envcntreset\iftrue |
|
64 |
\let\if@envcntresetsect=\iftrue} |
|
65 |
% |
|
66 |
\let\if@envcntsame\iffalse % NOT all environments work like "Theorem", |
|
67 |
% each using its own counter |
|
68 |
\DeclareOption{envcountsame}{\let\if@envcntsame\iftrue} |
|
69 |
% |
|
70 |
\let\if@envcntshowhiercnt=\iffalse % do not show hierarchy counter at all |
|
71 |
% |
|
72 |
% enhance theorem counter |
|
73 |
\DeclareOption{envcountchap}{\def\envankh{chapter}% show \thechapter along with theorem number |
|
74 |
\let\if@envcntshowhiercnt=\iftrue} |
|
75 |
% |
|
76 |
\DeclareOption{envcountsect}{\def\envankh{section}% show \thesection along with theorem number |
|
77 |
\let\if@envcntshowhiercnt=\iftrue |
|
78 |
\ExecuteOptions{envcountresetsect}} |
|
79 |
% reset environment counters every new contribution by default |
|
80 |
\ExecuteOptions{envcountresetchap} |
|
81 |
% |
|
82 |
% languages |
|
83 |
\let\switcht@@therlang\relax |
|
84 |
\let\svlanginfo\relax |
|
85 |
\def\ds@deutsch{\def\switcht@@therlang{\switcht@deutsch}% |
|
86 |
\gdef\svlanginfo{\typeout{Man spricht deutsch.}\global\let\svlanginfo\relax}} |
|
87 |
\def\ds@francais{\def\switcht@@therlang{\switcht@francais}% |
|
88 |
\gdef\svlanginfo{\typeout{On parle francais.}\global\let\svlanginfo\relax}} |
|
89 |
% |
|
90 |
\AtBeginDocument{\@ifundefined{url}{\def\url#1{#1}}{}% |
|
91 |
\@ifpackageloaded{babel}{% |
|
92 |
\@ifundefined{extrasamerican}{}{\addto\extrasamerican{\switcht@albion}}% |
|
93 |
\@ifundefined{extrasaustralian}{}{\addto\extrasaustralian{\switcht@albion}}% |
|
94 |
\@ifundefined{extrasbritish}{}{\addto\extrasbritish{\switcht@albion}}% |
|
95 |
\@ifundefined{extrascanadian}{}{\addto\extrascanadian{\switcht@albion}}% |
|
96 |
\@ifundefined{extrasenglish}{}{\addto\extrasenglish{\switcht@albion}}% |
|
97 |
\@ifundefined{extrasnewzealand}{}{\addto\extrasnewzealand{\switcht@albion}}% |
|
98 |
\@ifundefined{extrasUKenglish}{}{\addto\extrasUKenglish{\switcht@albion}}% |
|
99 |
\@ifundefined{extrasUSenglish}{}{\addto\extrasUSenglish{\switcht@albion}}% |
|
100 |
\@ifundefined{captionsfrench}{}{\addto\captionsfrench{\switcht@francais}}% |
|
101 |
\@ifundefined{extrasgerman}{}{\addto\extrasgerman{\switcht@deutsch}}% |
|
102 |
\@ifundefined{extrasngerman}{}{\addto\extrasngerman{\switcht@deutsch}}% |
|
103 |
}{\switcht@@therlang}% |
|
104 |
} |
|
105 |
% numbering style of floats, equations |
|
106 |
% \newif\if@numart \@numartfalse |
|
107 |
% \DeclareOption{numart}{\@numarttrue} |
|
108 |
% numbering of headings |
|
109 |
\let\if@chapnum=\iftrue |
|
110 |
\def\nixchapnum{\let\if@chapnum\iffalse} |
|
111 |
\def\numstyle{0} |
|
112 |
\DeclareOption{nosecnum}{\def\numstyle{1}}% |
|
113 |
% \DeclareOption{nochapnum}{\def\numstyle{2}}% |
|
114 |
% \DeclareOption{nonum}{\def\numstyle{3}}% |
|
115 |
\def\set@numbering{\ifcase\numstyle %\if@numart\else\num@book\fi %default |
|
116 |
\or % 1-case - no \section-numbers |
|
117 |
\setcounter{secnumdepth}{0}% \if@numart\else\num@book\fi |
|
118 |
% \or % 2-case |
|
119 |
% % chapter not numbered, but \sections are |
|
120 |
% \def\thesection{\@arabic\c@section}% |
|
121 |
% \nixchapnum |
|
122 |
% \or % 3-case |
|
123 |
% % neither chapter nor sections numbered + "numart" |
|
124 |
% \nixchapnum |
|
125 |
% \setcounter{secnumdepth}{0}% |
|
126 |
\else\fi} |
|
127 |
\AtEndOfClass{\set@numbering} |
|
128 |
% style for vectors |
|
129 |
\DeclareOption{vecphys}{\def\vec@style{phys}} |
|
130 |
\DeclareOption{vecarrow}{\def\vec@style{arrow}} |
|
131 |
% running heads |
|
132 |
\let\if@runhead\iftrue |
|
133 |
\DeclareOption{norunningheads}{\let\if@runhead\iffalse} |
|
134 |
% referee option |
|
135 |
\let\if@referee\iffalse |
|
136 |
\def\makereferee{\def\baselinestretch{2}\selectfont |
|
137 |
\newbox\refereebox |
|
138 |
\setbox\refereebox=\vbox to\z@{\vskip0.5cm% |
|
139 |
\hbox to\textwidth{\normalsize\tt\hrulefill\lower0.5ex |
|
140 |
\hbox{\kern5\p@ referee's copy\kern5\p@}\hrulefill}\vss}% |
|
141 |
\def\@oddfoot{\copy\refereebox}\let\@evenfoot=\@oddfoot} |
|
142 |
\DeclareOption{referee}{\let\if@referee\iftrue |
|
143 |
\AtBeginDocument{\makereferee\small\normalsize}} |
|
144 |
% modification of thebibliography |
|
145 |
\let\if@openbib\iffalse |
|
146 |
\DeclareOption{openbib}{\let\if@openbib\iftrue} |
|
147 |
% LaTeX standard, sectionwise references |
|
148 |
\DeclareOption{oribibl}{\let\oribibl=Y} |
|
149 |
\DeclareOption{chaprefs}{\let\chpbibl=Y} |
|
150 |
% |
|
151 |
% footinfo option (provides an informatory line on every page) |
|
152 |
\def\SpringerMacroPackageNameA{svmult.cls} |
|
153 |
% \thetime, \thedate and \timstamp are macros to include |
|
154 |
% time, date (or both) of the TeX run in the document |
|
155 |
\def\maketimestamp{\count255=\time |
|
156 |
\divide\count255 by 60\relax |
|
157 |
\edef\thetime{\the\count255:}% |
|
158 |
\multiply\count255 by-60\relax |
|
159 |
\advance\count255 by\time |
|
160 |
\edef\thetime{\thetime\ifnum\count255<10 0\fi\the\count255} |
|
161 |
\edef\thedate{\number\day-\ifcase\month\or Jan\or Feb\or Mar\or |
|
162 |
Apr\or May\or Jun\or Jul\or Aug\or Sep\or Oct\or |
|
163 |
Nov\or Dec\fi-\number\year} |
|
164 |
\def\timstamp{\hbox to\hsize{\tt\hfil\thedate\hfil\thetime\hfil}}} |
|
165 |
\maketimestamp |
|
166 |
% |
|
167 |
% \footinfo generates a info footline on every page containing |
|
168 |
% pagenumber, jobname, macroname, and timestamp |
|
169 |
\DeclareOption{footinfo}{\AtBeginDocument{\maketimestamp |
|
170 |
\def\ps@empty{\let\@mkboth\@gobbletwo |
|
171 |
\let\@oddhead\@empty\let\@evenhead\@empty}% |
|
172 |
\def\@oddfoot{\scriptsize\tt Page:\,\thepage\space\hfil |
|
173 |
job:\,\jobname\space\hfil |
|
174 |
macro:\,\SpringerMacroPackageNameA\space\hfil |
|
175 |
date/time:\,\thedate/\thetime}% |
|
176 |
\let\@evenfoot=\@oddfoot}} |
|
177 |
% |
|
178 |
% start new chapter on any page |
|
179 |
\newif\if@openright \@openrighttrue |
|
180 |
\DeclareOption{openany}{\@openrightfalse} |
|
181 |
% |
|
182 |
% no size changing allowed |
|
183 |
\DeclareOption{11pt}{\OptionNotUsed} |
|
184 |
\DeclareOption{12pt}{\OptionNotUsed} |
|
185 |
% options for the article class |
|
186 |
\def\@rticle@options{10pt,twoside} |
|
187 |
% fleqn |
|
188 |
\DeclareOption{fleqn}{\def\@rticle@options{10pt,twoside,fleqn}% |
|
189 |
\AtEndOfClass{\let\leftlegendglue\relax}% |
|
190 |
\AtBeginDocument{\mathindent\parindent}} |
|
191 |
% hanging sectioning titles |
|
192 |
\let\if@sechang\iftrue |
|
193 |
\DeclareOption{nosechang}{\let\if@sechang\iffalse} |
|
194 |
% hanging sectioning titles |
|
195 |
\def\ClassInfoNoLine#1#2{% |
|
196 |
\ClassInfo{#1}{#2\@gobble}% |
|
197 |
} |
|
198 |
% |
|
199 |
\DeclareOption{graybox}{% |
|
200 |
\AtEndOfClass{% Loading color package |
|
201 |
\RequirePackage{color}% |
|
202 |
% defining values of gray |
|
203 |
\definecolor{shadecolor}{gray}{.85}% |
|
204 |
\definecolor{tintedcolor}{gray}{.80}% |
|
205 |
\RequirePackage{framed}% |
|
206 |
% |
|
207 |
\newenvironment{tinted}{% |
|
208 |
\def\FrameCommand{\colorbox{tintedcolor}}% |
|
209 |
\MakeFramed {\FrameRestore}}% |
|
210 |
{\endMakeFramed}% |
|
211 |
% |
|
212 |
\renewenvironment{svgraybox}% |
|
213 |
{\fboxsep=12pt\relax |
|
214 |
\begin{shaded}% |
|
215 |
\list{}{\leftmargin=12pt\rightmargin=2\leftmargin\leftmargin=\z@\topsep=\z@\relax}% |
|
216 |
\expandafter\item\parindent=\svparindent |
|
217 |
\hskip-\listparindent}% |
|
218 |
{\endlist\end{shaded}}% |
|
219 |
% |
|
220 |
\renewenvironment{svtintedbox}% |
|
221 |
{\fboxsep=12pt\relax |
|
222 |
\begin{tinted}% |
|
223 |
\list{}{\leftmargin=12pt\rightmargin=2\leftmargin\leftmargin=\z@\topsep=\z@\relax}% |
|
224 |
\expandafter\item\parindent=\svparindent |
|
225 |
\relax}% |
|
226 |
{\endlist\end{tinted}}% |
|
227 |
% |
|
228 |
}} |
|
229 |
% |
|
230 |
\let\SVMultOpt\@empty |
|
231 |
\DeclareOption*{\InputIfFileExists{sv\CurrentOption.clo}{% |
|
232 |
\global\let\SVMultOpt\CurrentOption}{% |
|
233 |
\ClassWarning{Springer-SVMult}{Specified option or subpackage |
|
234 |
"\CurrentOption" \MessageBreak not found - |
|
235 |
passing it to article class \MessageBreak |
|
236 |
-}\PassOptionsToClass{\CurrentOption}{article}% |
|
237 |
}} |
|
238 |
\ProcessOptions\relax |
|
239 |
\ifx\SVMultOpt\@empty\relax |
|
240 |
\ClassInfoNoLine{Springer-SVMult}{extra/valid Springer sub-package |
|
241 |
\MessageBreak not found in option list - using "global" style}{} |
|
242 |
\fi |
|
243 |
\LoadClass[\@rticle@options]{article} |
|
244 |
\raggedbottom |
|
245 |
|
|
246 |
% various sizes and settings for contributed works |
|
247 |
|
|
248 |
\setlength{\textwidth}{117mm} |
|
249 |
%\setlength{\textheight}{12pt}\multiply\textheight by 45\relax |
|
250 |
\setlength{\textheight}{191mm} |
|
251 |
\setlength{\topmargin}{0cm} |
|
252 |
\setlength\oddsidemargin {63\p@} |
|
253 |
\setlength\evensidemargin {63\p@} |
|
254 |
\setlength\marginparwidth{90\p@} |
|
255 |
\setlength\headsep {12\p@} |
|
256 |
|
|
257 |
\newdimen\svparindent |
|
258 |
\setlength{\svparindent}{12\p@} |
|
259 |
\parindent\svparindent |
|
260 |
|
|
261 |
\newdimen\bibindent |
|
262 |
\setlength\bibindent{\parindent} |
|
263 |
|
|
264 |
\setlength{\parskip}{\z@ \@plus \p@} |
|
265 |
\setlength{\hfuzz}{2\p@} |
|
266 |
\setlength{\arraycolsep}{1.5\p@} |
|
267 |
|
|
268 |
\frenchspacing |
|
269 |
|
|
270 |
\tolerance=500 |
|
271 |
|
|
272 |
\predisplaypenalty=0 |
|
273 |
\clubpenalty=10000 |
|
274 |
\widowpenalty=10000 |
|
275 |
|
|
276 |
\setlength\footnotesep{7.7\p@} |
|
277 |
|
|
278 |
\newdimen\betweenumberspace % dimension for space between |
|
279 |
\betweenumberspace=5\p@ % number and text of titles |
|
280 |
\newdimen\headlineindent % dimension for space of |
|
281 |
\headlineindent=2.5cc % number and gap of running heads |
|
282 |
|
|
283 |
% fonts, sizes, and the like |
|
284 |
\renewcommand\normalsize{% |
|
285 |
\@setfontsize\normalsize\@xpt\@xiipt |
|
286 |
\abovedisplayskip 10\p@ % \@plus2\p@ \@minus5\p@ |
|
287 |
\abovedisplayshortskip \z@ % \@plus3\p@ |
|
288 |
\belowdisplayshortskip 6\p@ %\@plus3\p@ \@minus3\p@ |
|
289 |
\belowdisplayskip \abovedisplayskip |
|
290 |
\let\@listi\@listI} |
|
291 |
\normalsize |
|
292 |
\renewcommand\small{% |
|
293 |
\@setfontsize\small{8.5}{10}% |
|
294 |
\abovedisplayskip 8.5\p@ % \@plus3\p@ \@minus4\p@ |
|
295 |
\abovedisplayshortskip \z@ %\@plus2\p@ |
|
296 |
\belowdisplayshortskip 4\p@ %\@plus2\p@ \@minus2\p@ |
|
297 |
\def\@listi{\leftmargin\leftmargini |
|
298 |
\parsep \z@ \@plus\p@ \@minus\p@ |
|
299 |
\topsep 6\p@ \@plus2\p@ \@minus4\p@ |
|
300 |
\itemsep\z@}% |
|
301 |
\belowdisplayskip \abovedisplayskip |
|
302 |
} |
|
303 |
% |
|
304 |
\let\footnotesize=\small |
|
305 |
% |
|
306 |
\renewcommand\Large{\@setfontsize\large{14}{16}} |
|
307 |
\newcommand\LArge{\@setfontsize\Large{16}{18}} |
|
308 |
\renewcommand\LARGE{\@setfontsize\LARGE{18}{20}} |
|
309 |
% |
|
310 |
\newenvironment{petit}{\par\addvspace{6\p@}\small}{\par\addvspace{6\p@}} |
|
311 |
% |
|
312 |
|
|
313 |
% modification of automatic positioning of floating objects |
|
314 |
\setlength\@fptop{\z@ } |
|
315 |
\setlength\@fpsep{12\p@ } |
|
316 |
\setlength\@fpbot{\z@ \@plus 1fil } |
|
317 |
\def\textfraction{.01} |
|
318 |
\def\floatpagefraction{.8} |
|
319 |
\setlength{\intextsep}{20\p@ \@plus 2\p@ \@minus 2\p@} |
|
320 |
\setlength\textfloatsep{24\p@ \@plus 2\p@ \@minus 4\p@} |
|
321 |
\setcounter{topnumber}{4} |
|
322 |
\def\topfraction{.9} |
|
323 |
\setcounter{bottomnumber}{2} |
|
324 |
\def\bottomfraction{.7} |
|
325 |
\setcounter{totalnumber}{6} |
|
326 |
% |
|
327 |
% size and style of headings |
|
328 |
\newcommand{\partnumsize}{\LArge} |
|
329 |
\newcommand{\partnumstyle}{\bfseries\boldmath} |
|
330 |
\newcommand{\partsize}{\LARGE} |
|
331 |
\newcommand{\partstyle}{\bfseries\boldmath} |
|
332 |
\newcommand{\chapnumsize}{\Large} |
|
333 |
\newcommand{\chapnumstyle}{\bfseries\boldmath} |
|
334 |
\newcommand{\chapsize}{\LArge} |
|
335 |
\newcommand{\chapstyle}{\bfseries\boldmath} |
|
336 |
\newcommand{\chapauthsize}{\normalsize} |
|
337 |
\newcommand{\chapauthstyle}{\bfseries\boldmath} |
|
338 |
\newcommand{\mottosize}{\small} |
|
339 |
\newcommand{\mottostyle}{\itshape\unboldmath\raggedright} |
|
340 |
\newcommand{\secsize}{\large} |
|
341 |
\newcommand{\secstyle}{\bfseries\boldmath} |
|
342 |
\newcommand{\subsecsize}{\large} |
|
343 |
\newcommand{\subsecstyle}{\bfseries\itshape\boldmath} |
|
344 |
\newcommand{\subsubsecstyle}{\bfseries\boldmath} |
|
345 |
% |
|
346 |
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else |
|
347 |
\hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi} |
|
348 |
|
|
349 |
\newcommand{\clearemptydoublepage}{% |
|
350 |
\clearpage{\pagestyle{empty}\cleardoublepage}} |
|
351 |
\newcommand{\startnewpage}{\if@openright\clearemptydoublepage\else\clearpage\fi} |
|
352 |
|
|
353 |
% MiniTOC |
|
354 |
% one outputstream for all minitocs |
|
355 |
\newwrite\minitoc |
|
356 |
\let\MiniTOC=N % switch for MT processing in .aux files |
|
357 |
\newcounter{minitocdepth} |
|
358 |
\setcounter{minitocdepth}{0} |
|
359 |
|
|
360 |
% stolen from LaTeX.ltx - read miniTOC and redirect output stream |
|
361 |
\long\def \protected@immwrite#1#2#3{% |
|
362 |
\begingroup |
|
363 |
\let\thepage\relax |
|
364 |
#2% |
|
365 |
\let\protect\@unexpandable@protect |
|
366 |
\edef\reserved@a{\immediate\write#1{#3}}% |
|
367 |
\reserved@a |
|
368 |
\endgroup |
|
369 |
\if@nobreak\ifvmode\nobreak\fi\fi} |
|
370 |
% |
|
371 |
\newcommand{\@mtstarttoc}[1] |
|
372 |
{\begingroup |
|
373 |
\makeatletter |
|
374 |
\immediate\write\@auxout{\string\immediate\string\closeout\string\minitoc}% |
|
375 |
\typeout{input jobname.#1}% |
|
376 |
\small |
|
377 |
\@input{\jobname.#1}% |
|
378 |
\protected@immwrite\@auxout |
|
379 |
{\let\label\@gobble \let\index\@gobble |
|
380 |
\let\glossary\@gobble}% |
|
381 |
{\immediate\openout\minitoc \jobname.#1\relax} |
|
382 |
\global\@nobreakfalse\endgroup} |
|
383 |
% |
|
384 |
\newcommand{\@mtstarttocquiet}[1] |
|
385 |
{\begingroup |
|
386 |
\makeatletter |
|
387 |
\protected@write\@auxout |
|
388 |
{\let\label\@gobble \let\index\@gobble |
|
389 |
\let\glossary\@gobble}% |
|
390 |
{\immediate\openout\minitoc \jobname.#1\relax} |
|
391 |
\global\@nobreakfalse\endgroup} |
|
392 |
% |
|
393 |
\newcommand{\mtaddtocont}[1] |
|
394 |
{\protected@write \@auxout |
|
395 |
{\let\label\@gobble \let\index\@gobble |
|
396 |
\let\glossary\@gobble}% |
|
397 |
{\string\@mtwritefile{#1}}} |
|
398 |
% |
|
399 |
\newcommand{\@mtwritefile}[1]{\if Y\MiniTOC |
|
400 |
\@temptokena{#1} \immediate\write\minitoc{\the\@temptokena}\fi} |
|
401 |
|
|
402 |
\AtEndDocument{\immediate\write\@auxout{\string\immediate\string\closeout\string\minitoc}} |
|
403 |
|
|
404 |
\newcommand{\dominitoc}{% switch \let\MiniTOC=Y |
|
405 |
\protected@immwrite\@auxout{}{\let\MiniTOC=Y}% |
|
406 |
\ifnum \c@minitocdepth<1 |
|
407 |
\@mtstarttocquiet{t\thecontribution}\relax |
|
408 |
\else |
|
409 |
\@mtstarttoc{t\thecontribution}\par\addvspace\bigskipamount |
|
410 |
\fi} |
|
411 |
|
|
412 |
% redefinition of \part |
|
413 |
\renewcommand\part{\clearemptydoublepage |
|
414 |
\thispagestyle{empty} |
|
415 |
\if@twocolumn |
|
416 |
\onecolumn |
|
417 |
\@tempswatrue |
|
418 |
\else |
|
419 |
\@tempswafalse |
|
420 |
\fi |
|
421 |
\@ifundefined{thispagecropped}{}{\thispagecropped} |
|
422 |
\secdef\@part\@spart} |
|
423 |
|
|
424 |
\def\@part[#1]#2{\ifnum \c@secnumdepth >-2\relax |
|
425 |
\refstepcounter{part} |
|
426 |
\addcontentsline{toc}{part}{\partname\ |
|
427 |
\thepart\thechapterend\hspace{\betweenumberspace}% |
|
428 |
#1}\else |
|
429 |
\addcontentsline{toc}{part}{#1}\fi |
|
430 |
\markboth{}{} |
|
431 |
{\raggedleft |
|
432 |
\hyphenpenalty \@M |
|
433 |
\interlinepenalty\@M |
|
434 |
\ifnum \c@secnumdepth >-2\relax |
|
435 |
\normalfont\partnumsize\partnumstyle %\vrule height 34pt width 0pt depth 0pt% |
|
436 |
\partname\ \thepart %\llap{\smash{\lower 5pt\hbox to\textwidth{\hrulefill}}} |
|
437 |
\par |
|
438 |
\vskip 2\p@ \fi |
|
439 |
\partsize\partstyle #2\par}\@endpart} |
|
440 |
% |
|
441 |
% \@endpart finishes the part page |
|
442 |
% |
|
443 |
\def\@endpart{\vfil\newpage |
|
444 |
\if@twoside |
|
445 |
\hbox{} |
|
446 |
\thispagestyle{empty} |
|
447 |
\newpage |
|
448 |
\fi |
|
449 |
\if@tempswa |
|
450 |
\twocolumn |
|
451 |
\fi} |
|
452 |
% |
|
453 |
\def\@spart#1{{\raggedleft |
|
454 |
\normalfont\partsize\partstyle |
|
455 |
#1\par}\@endpart} |
|
456 |
% |
|
457 |
\newenvironment{partbacktext}{\def\@endpart{\vfil\newpage}} |
|
458 |
{\thispagestyle{empty} \newpage} |
|
459 |
% |
|
460 |
% (re)define sectioning |
|
461 |
\setcounter{secnumdepth}{3} |
|
462 |
|
|
463 |
\def\seccounterend{} |
|
464 |
\def\seccountergap{\hskip\betweenumberspace} |
|
465 |
\def\@seccntformat#1{\csname the#1\endcsname\seccounterend\seccountergap\ignorespaces} |
|
466 |
% |
|
467 |
\let\firstmark=\botmark |
|
468 |
% |
|
469 |
\@ifundefined{thechapterend}{\def\thechapterend{}}{} |
|
470 |
% |
|
471 |
\if@sechang |
|
472 |
\def\sec@hangfrom#1{\setbox\@tempboxa\hbox{#1}% |
|
473 |
\hangindent\wd\@tempboxa\noindent\box\@tempboxa} |
|
474 |
\else |
|
475 |
\def\sec@hangfrom#1{\setbox\@tempboxa\hbox{#1}% |
|
476 |
\hangindent\z@\noindent\box\@tempboxa} |
|
477 |
\fi |
|
478 |
|
|
479 |
\def\chap@hangfrom#1{\if!#1!\else |
|
480 |
\@chapapp\ #1\vskip2pt\fi} |
|
481 |
\def\schap@hangfrom{\chap@hangfrom{}} |
|
482 |
|
|
483 |
\newcounter{chapter} |
|
484 |
|
|
485 |
\newif\if@mainmatter \@mainmattertrue |
|
486 |
\newcommand\frontmatter{\startnewpage |
|
487 |
\@mainmatterfalse\pagenumbering{roman} |
|
488 |
\setcounter{page}{5}} |
|
489 |
% |
|
490 |
\newcommand\mainmatter{\clearemptydoublepage |
|
491 |
\@mainmattertrue |
|
492 |
\markboth{}{} |
|
493 |
\pagenumbering{arabic}} |
|
494 |
% |
|
495 |
\newcommand\backmatter{% |
|
496 |
\setcounter{minitocdepth}{0}% |
|
497 |
\pagestyle{headings}% |
|
498 |
\clearemptydoublepage %\@mainmatterfalse |
|
499 |
\let\appendix=\bppendix |
|
500 |
\def\bibsection{\chapter*{\refname}\@mkboth{\refname}{\refname}% |
|
501 |
\addcontentsline{toc}{chapter}{\refname}% |
|
502 |
\csname biblst@rthook\endcsname\par}% |
|
503 |
} |
|
504 |
|
|
505 |
\renewenvironment{titlepage} |
|
506 |
{% |
|
507 |
\cleardoublepage |
|
508 |
\if@twocolumn |
|
509 |
\@restonecoltrue\onecolumn |
|
510 |
\else |
|
511 |
\@restonecolfalse\newpage |
|
512 |
\fi |
|
513 |
\thispagestyle{empty}% |
|
514 |
\addtocounter{page}\m@ne |
|
515 |
\def\and{\unskip, } |
|
516 |
\parindent=\z@ |
|
517 |
\pretolerance=10000 |
|
518 |
\rightskip=0pt plus 1fil |
|
519 |
\large % default size for titlepage |
|
520 |
\vspace*{2em} % Vertical space above title. |
|
521 |
}{{\LARGE % each author set in \LARGE |
|
522 |
\lineskip .5em |
|
523 |
\@author |
|
524 |
\par}% |
|
525 |
\vskip 2cm % Vertical space after author. |
|
526 |
{\Huge\bfseries\@title \par}% Title set in \Huge size and bold face |
|
527 |
\vskip 1cm % Vertical space after title. |
|
528 |
\if!\@subtitle!\else |
|
529 |
{\LARGE\ignorespaces\@subtitle \par} |
|
530 |
\vskip 1cm % Vertical space after subtitle. |
|
531 |
\fi |
|
532 |
\if!\@date!\else |
|
533 |
\@date |
|
534 |
\par |
|
535 |
\vskip 1.5em % Vertical space after date. |
|
536 |
\fi |
|
537 |
\vfill |
|
538 |
{\Large\bfseries Springer\par} |
|
539 |
%\vskip 3pt |
|
540 |
%\itshape |
|
541 |
% Berlin\enspace Heidelberg\enspace New\kern0.1em York\\ |
|
542 |
% Hong\kern0.2em Kong\enspace London\\ |
|
543 |
% Milan\enspace Paris\enspace Tokyo\par |
|
544 |
\if@restonecol\twocolumn \else \newpage \fi |
|
545 |
\if@twoside\else |
|
546 |
\setcounter{page}\@ne |
|
547 |
\fi |
|
548 |
\clearheadinfo |
|
549 |
} |
|
550 |
|
|
551 |
\def\@chapapp{\chaptername} |
|
552 |
|
|
553 |
\newdimen\mottowidth |
|
554 |
\newcommand\motto[2][77mm]{% |
|
555 |
\setlength{\mottowidth}{#1}% |
|
556 |
\gdef\m@ttotext{#2}} |
|
557 |
% |
|
558 |
\newcommand{\processmotto}{\@ifundefined{m@ttotext}{}{% |
|
559 |
\setbox0=\hbox{\vbox{\hyphenpenalty=50 |
|
560 |
\begin{flushright} |
|
561 |
\begin{minipage}{\mottowidth} |
|
562 |
\vrule\@width\z@\@height21\p@\@depth\z@ |
|
563 |
\normalfont\mottosize\mottostyle\m@ttotext |
|
564 |
\end{minipage} |
|
565 |
\end{flushright}}}% |
|
566 |
\@tempdima=\pagetotal |
|
567 |
\advance\@tempdima by\ht0 |
|
568 |
\ifdim\@tempdima<157\p@ |
|
569 |
\multiply\@tempdima by-1 |
|
570 |
\advance\@tempdima by157\p@ |
|
571 |
\vskip\@tempdima |
|
572 |
\fi |
|
573 |
\box0\par |
|
574 |
\global\let\m@ttotext=\undefined}} |
|
575 |
|
|
576 |
\newcommand{\chapsubtitle}[1]{% |
|
577 |
\gdef\ch@psubtitle{#1}} |
|
578 |
% |
|
579 |
\newcommand{\processchapsubtit}{\@ifundefined{ch@psubtitle}{}{% |
|
580 |
{\normalfont\chapnumsize\chapnumstyle |
|
581 |
\vskip 14\p@ |
|
582 |
\ch@psubtitle |
|
583 |
\par} |
|
584 |
\global\let\ch@psubtitle=\undefined}} |
|
585 |
|
|
586 |
\newcommand{\chapauthor}[1]{% |
|
587 |
\gdef\ch@pauthor{#1}} |
|
588 |
% |
|
589 |
\newcommand{\processchapauthor}{\@ifundefined{ch@pauthor}{}{% |
|
590 |
{\normalfont\chapauthsize\chapauthstyle |
|
591 |
\vskip 20\p@ |
|
592 |
\ch@pauthor |
|
593 |
\par} |
|
594 |
\global\let\ch@pauthor=\undefined}} |
|
595 |
|
|
596 |
\newcommand\chapter{\startnewpage |
|
597 |
\@ifundefined{thispagecropped}{}{\thispagecropped} |
|
598 |
\thispagestyle{bchap}% |
|
599 |
\if@chapnum\else |
|
600 |
\begingroup |
|
601 |
\let\@elt\@stpelt |
|
602 |
\csname cl@chapter\endcsname |
|
603 |
\endgroup |
|
604 |
\fi |
|
605 |
\global\@topnum\z@ |
|
606 |
\@afterindentfalse |
|
607 |
\secdef\@chapter\@schapter} |
|
608 |
|
|
609 |
\def\@chapter[#1]#2{\if@chapnum % war mal \ifnum \c@secnumdepth >\m@ne |
|
610 |
\refstepcounter{chapter}% |
|
611 |
\if@mainmatter |
|
612 |
\typeout{\@chapapp\space\thechapter.}% |
|
613 |
\addcontentsline{toc}{chapter}{\protect |
|
614 |
\numberline{\thechapter\thechapterend}#1}% |
|
615 |
\else |
|
616 |
\addcontentsline{toc}{chapter}{#1}% |
|
617 |
\fi |
|
618 |
\else |
|
619 |
\addcontentsline{toc}{chapter}{#1}% |
|
620 |
\fi |
|
621 |
\chaptermark{#1}% |
|
622 |
\addtocontents{lof}{\protect\addvspace{10\p@}}% |
|
623 |
\addtocontents{lot}{\protect\addvspace{10\p@}}% |
|
624 |
\if@twocolumn |
|
625 |
\@topnewpage[\@makechapterhead{#2}]% |
|
626 |
\else |
|
627 |
\@makechapterhead{#2}% |
|
628 |
\@afterheading |
|
629 |
\fi} |
|
630 |
|
|
631 |
\def\@schapter#1{\if@twocolumn |
|
632 |
\@topnewpage[\@makeschapterhead{#1}]% |
|
633 |
\else |
|
634 |
\@makeschapterhead{#1}% |
|
635 |
\@afterheading |
|
636 |
\fi} |
|
637 |
|
|
638 |
%%changes position and layout of numbered chapter headings |
|
639 |
\def\@makechapterhead#1{{\parindent\z@\raggedright\normalfont |
|
640 |
\hyphenpenalty \@M |
|
641 |
\interlinepenalty\@M |
|
642 |
\if@chapnum |
|
643 |
\chapnumsize\chapnumstyle |
|
644 |
\@chapapp\ \thechapter\thechapterend\par |
|
645 |
\vskip 2\p@ |
|
646 |
\fi |
|
647 |
\chapsize\chapstyle |
|
648 |
\ignorespaces#1\par\nobreak |
|
649 |
\processchapsubtit |
|
650 |
\processchapauthor |
|
651 |
\processmotto |
|
652 |
\ifdim\pagetotal>167\p@ |
|
653 |
\vskip 11\p@ |
|
654 |
\else |
|
655 |
\@tempdima=167\p@\advance\@tempdima by-\pagetotal |
|
656 |
\vskip\@tempdima |
|
657 |
\fi}} |
|
658 |
|
|
659 |
%%changes position and layout of unnumbered chapter headings |
|
660 |
\def\@makeschapterhead#1{{\parindent \z@ \raggedright\normalfont |
|
661 |
\hyphenpenalty \@M |
|
662 |
\interlinepenalty\@M |
|
663 |
\chapsize\chapstyle |
|
664 |
\ignorespaces#1\par\nobreak |
|
665 |
\processmotto |
|
666 |
\ifdim\pagetotal>167\p@ |
|
667 |
\vskip 11\p@ |
|
668 |
\else |
|
669 |
\@tempdima=168\p@\advance\@tempdima by-\pagetotal |
|
670 |
\vskip\@tempdima |
|
671 |
\fi}} |
|
672 |
% |
|
673 |
% dedication environment |
|
674 |
\newenvironment{dedication} |
|
675 |
{\clearemptydoublepage |
|
676 |
\thispagestyle{empty} |
|
677 |
\vspace*{13\baselineskip} |
|
678 |
\large\itshape |
|
679 |
\let\\\@centercr\@rightskip\@flushglue \rightskip\@rightskip |
|
680 |
\leftskip4cm\parindent\z@\relax |
|
681 |
\everypar{\parindent=\svparindent\let\everypar\empty}}{\clearpage} |
|
682 |
% |
|
683 |
% predefined unnumbered headings |
|
684 |
\newcommand{\preface}[1][\prefacename]{\chapter*{#1}\markboth{#1}{#1}} |
|
685 |
\newcommand{\foreword}[1][\forewordname]{\chapter*{#1}\markboth{#1}{#1}} |
|
686 |
\newcommand{\contributors}[1][\contriblistname]{\chapter*{#1}\markboth{#1}{#1}} |
|
687 |
\newcommand{\extrachap}[1]{\chapter*{#1}\markboth{#1}{#1}} |
|
688 |
% same with TOC entry |
|
689 |
\newcommand{\Extrachap}[1]{\chapter*{#1}\markboth{#1}{#1}% |
|
690 |
\addcontentsline{toc}{chapter}{#1}} |
|
691 |
|
|
692 |
% measures and setting of sections |
|
693 |
\renewcommand\section{\@startsection{section}{1}{\z@}% |
|
694 |
{-30\p@}% \p@lus -4\p@ \@minus -4\p@}% |
|
695 |
{16\p@}% \p@lus 4\p@ \@minus 4\p@}% |
|
696 |
{\normalfont\secsize\secstyle |
|
697 |
\rightskip=\z@ \@plus 8em\pretolerance=10000 }} |
|
698 |
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}% |
|
699 |
{-30\p@}% \p@lus -4\p@ \@minus -4\p@}% |
|
700 |
{16\p@}% \p@lus 4\p@ \@minus 4\p@}% |
|
701 |
{\normalfont\subsecsize\subsecstyle |
|
702 |
\rightskip=\z@ \@plus 8em\pretolerance=10000 }} |
|
703 |
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% |
|
704 |
{-24\p@}% \p@lus -4\p@ \@minus -4\p@}% |
|
705 |
{12\p@}% \p@lus 4\p@ \@minus 4\p@}% |
|
706 |
{\normalfont\normalsize\subsubsecstyle |
|
707 |
\rightskip=\z@ \@plus 8em\pretolerance=10000 }} |
|
708 |
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% |
|
709 |
{-24\p@}% \p@lus -4\p@ \@minus -4\p@}% |
|
710 |
{12\p@}% \p@lus 4\p@ \@minus 4\p@}% |
|
711 |
{\normalfont\normalsize\upshape |
|
712 |
\rightskip=\z@ \@plus 8em\pretolerance=10000 }} |
|
713 |
\renewcommand\subparagraph{\@startsection{paragraph}{4}{\z@}% |
|
714 |
{-18\p@}% \p@lus -4\p@ \@minus -4\p@}% |
|
715 |
{6\p@}% \p@lus 4\p@ \@minus 4\p@}% |
|
716 |
{\normalfont\normalsize\itshape |
|
717 |
\rightskip=\z@ \@plus 8em\pretolerance=10000 }} |
|
718 |
\newcommand\runinhead{\@startsection{paragraph}{4}{\z@}% |
|
719 |
{-6\p@}% \p@lus -4\p@ \@minus -4\p@}% |
|
720 |
{-6\p@}% |
|
721 |
{\normalfont\normalsize\bfseries\boldmath |
|
722 |
\rightskip=\z@ \@plus 8em\pretolerance=10000 }} |
|
723 |
\newcommand\subruninhead{\@startsection{paragraph}{4}{\z@}% |
|
724 |
{-6\p@}% \p@lus -4\p@ \@minus -4\p@}% |
|
725 |
{-6\p@}% |
|
726 |
{\normalfont\normalsize\itshape |
|
727 |
\rightskip=\z@ \@plus 8em\pretolerance=10000 }} |
|
728 |
|
|
729 |
% Appendix |
|
730 |
\renewcommand\appendix{\par} %article appendix |
|
731 |
|
|
732 |
\newcommand\bppendix{\startnewpage %book appendix |
|
733 |
\pagestyle{headings} |
|
734 |
\stepcounter{chapter} |
|
735 |
\setcounter{chapter}{0} |
|
736 |
\stepcounter{section} |
|
737 |
\setcounter{section}{0} |
|
738 |
\setcounter{equation}{0} |
|
739 |
\setcounter{figure}{0} |
|
740 |
\setcounter{table}{0} |
|
741 |
\setcounter{footnote}{0} |
|
742 |
\let\if@chapnum=\iftrue |
|
743 |
\def\@chapapp{\appendixname} |
|
744 |
\renewcommand\thechapter{\@Alph\c@chapter} |
|
745 |
\renewcommand\thesection{\thechapter.\@arabic\c@section} |
|
746 |
\renewcommand\thesubsection{\thesection.\@arabic\c@subsection} |
|
747 |
\renewcommand\theequation{\thechapter.\@arabic\c@equation} |
|
748 |
\renewcommand\thefigure{\thechapter.\@arabic\c@figure} |
|
749 |
\renewcommand\thetable{\thechapter.\@arabic\c@table}} |
|
750 |
|
|
751 |
\def\hyperhrefextend{\ifx\hyper@anchor\@undefined\else |
|
752 |
{\@currentHref}\fi} |
|
753 |
|
|
754 |
\def\runinsep{} |
|
755 |
\def\aftertext{\unskip\runinsep} |
|
756 |
% |
|
757 |
% |
|
758 |
\def\@ssect#1#2#3#4#5{% |
|
759 |
\@tempskipa #3\relax |
|
760 |
\ifdim \@tempskipa>\z@ |
|
761 |
\begingroup |
|
762 |
#4{% |
|
763 |
\@hangfrom{\hskip #1}% |
|
764 |
\raggedright |
|
765 |
\hyphenpenalty \@M |
|
766 |
\interlinepenalty \@M #5\@@par}% |
|
767 |
\endgroup |
|
768 |
\else |
|
769 |
\def\@svsechd{#4{\hskip #1\relax #5}}% |
|
770 |
\fi |
|
771 |
\@xsect{#3}} |
|
772 |
% |
|
773 |
\def\@sect#1#2#3#4#5#6[#7]#8{% |
|
774 |
\ifnum #2>\c@secnumdepth |
|
775 |
\let\@svsec\@empty |
|
776 |
\else |
|
777 |
\refstepcounter{#1}% |
|
778 |
\protected@edef\@svsec{\@seccntformat{#1}\relax}% |
|
779 |
\fi |
|
780 |
\@tempskipa #5\relax |
|
781 |
\ifdim \@tempskipa>\z@ |
|
782 |
\begingroup #6\relax |
|
783 |
\sec@hangfrom{\hskip #3\relax\@svsec}% |
|
784 |
{\raggedright |
|
785 |
\hyphenpenalty \@M |
|
786 |
\interlinepenalty \@M #8\@@par}% |
|
787 |
\endgroup |
|
788 |
\csname #1mark\endcsname{#7}% |
|
789 |
\addcontentsline{toc}{#1}{% |
|
790 |
\ifnum #2>\c@secnumdepth \else |
|
791 |
\protect\numberline{\csname the#1\endcsname}% |
|
792 |
\fi |
|
793 |
#7}% |
|
794 |
\ifnum #2>\c@minitocdepth \else |
|
795 |
\mtaddtocont{\protect\contentsline |
|
796 |
\ifnum #2>\@ne{mtsec}\else{mtchap}\fi |
|
797 |
\ifnum #2>\c@secnumdepth |
|
798 |
{#7}% |
|
799 |
\else |
|
800 |
{\protect\numberline{\csname the#1\endcsname}#7}% |
|
801 |
\fi |
|
802 |
{\thepage}\hyperhrefextend}% |
|
803 |
\fi |
|
804 |
\else |
|
805 |
\def\@svsechd{% |
|
806 |
#6\hskip #3\relax |
|
807 |
\@svsec #8\aftertext\ignorespaces |
|
808 |
\csname #1mark\endcsname{#7}% |
|
809 |
\addcontentsline{toc}{#1}{% |
|
810 |
\ifnum #2>\c@secnumdepth \else |
|
811 |
\protect\numberline{\csname the#1\endcsname}% |
|
812 |
\fi |
|
813 |
#7}}% |
|
814 |
\fi |
|
815 |
\@xsect{#5}} |
|
816 |
|
|
817 |
% figures and tables are processed in small print |
|
818 |
\def \@floatboxreset {% |
|
819 |
\reset@font |
|
820 |
\small |
|
821 |
\@setnobreak |
|
822 |
\@setminipage |
|
823 |
} |
|
824 |
\def\fps@figure{htbp} |
|
825 |
\def\fps@table{htbp} |
|
826 |
% |
|
827 |
% Frame for paste-in figures or tables |
|
828 |
\def\mpicplace#1#2{% #1 =width #2 =height |
|
829 |
\vbox{\hbox to #1{\vrule\@width \fboxrule \@height #2\hfill}}} |
|
830 |
% |
|
831 |
\newenvironment{svgraybox}% |
|
832 |
{\ClassWarning{Springer-SVMono}{Environment "svgraybox" not available,\MessageBreak |
|
833 |
switching over to "quotation" environment;\MessageBreak |
|
834 |
specify documentclass option "graybox",\MessageBreak |
|
835 |
see SVMono documentation -}% |
|
836 |
\par\addvspace{6pt} |
|
837 |
\list{}{\listparindent12\p@% |
|
838 |
\leftmargin=12\p@% |
|
839 |
\itemindent \listparindent |
|
840 |
\rightmargin \leftmargin |
|
841 |
\parsep \z@ \@plus\p@}% |
|
842 |
\expandafter\item\parindent=\svparindent |
|
843 |
\relax\hskip-\listparindent}% |
|
844 |
{\endlist}% |
|
845 |
% |
|
846 |
\newenvironment{svtintedbox}% |
|
847 |
{\ClassWarning{Springer-SVMono}{Environment "svtintedbox" not available,\MessageBreak |
|
848 |
switching over to "quotation" environment;\MessageBreak |
|
849 |
specify documentclass option "graybox",\MessageBreak |
|
850 |
see SVMono documentation -}% |
|
851 |
\par\addvspace{6pt} |
|
852 |
\list{}{\listparindent12\p@% |
|
853 |
\leftmargin=12\p@% |
|
854 |
\itemindent \listparindent |
|
855 |
\rightmargin \leftmargin |
|
856 |
\parsep \z@ \@plus\p@}% |
|
857 |
\expandafter\item\parindent=\svparindent |
|
858 |
\relax\hskip-\listparindent}% |
|
859 |
{\endlist}% |
|
860 |
% |
|
861 |
\renewenvironment{quotation} |
|
862 |
{\par\addvspace{6pt} |
|
863 |
\list{}{\listparindent12\p@% |
|
864 |
\leftmargin=12\p@% |
|
865 |
\itemindent \listparindent |
|
866 |
\rightmargin \leftmargin |
|
867 |
\parsep \z@ \@plus\p@% |
|
868 |
\small}% |
|
869 |
\item\relax\hskip-\listparindent} |
|
870 |
{\endlist} |
|
871 |
% |
|
872 |
\renewenvironment{quote} |
|
873 |
{\par\addvspace{6pt} |
|
874 |
\list{}{\leftmargin=12\p@% |
|
875 |
\rightmargin\leftmargin |
|
876 |
\parsep=3\p@ |
|
877 |
\small}% |
|
878 |
\item\relax} |
|
879 |
{\endlist} |
|
880 |
|
|
881 |
% labels of enumerate |
|
882 |
\renewcommand\labelenumii{\theenumii.} |
|
883 |
\renewcommand\theenumii{\@alph\c@enumii} |
|
884 |
|
|
885 |
% labels of itemize |
|
886 |
\renewcommand\labelitemi{\textbullet} |
|
887 |
\renewcommand\labelitemii{\textendash} |
|
888 |
\let\labelitemiii=\labelitemiv |
|
889 |
|
|
890 |
% labels of description |
|
891 |
\renewcommand*\descriptionlabel[1]{\hspace\labelsep #1\hfil} |
|
892 |
|
|
893 |
% fixed indentation for standard itemize-environment |
|
894 |
\newdimen\svitemindent \setlength{\svitemindent}{\parindent} |
|
895 |
|
|
896 |
|
|
897 |
% make indentations changeable |
|
898 |
|
|
899 |
\def\setitemindent#1{\settowidth{\labelwidth}{#1}% |
|
900 |
\let\setit@m=Y% |
|
901 |
\leftmargini\labelwidth |
|
902 |
\advance\leftmargini\labelsep |
|
903 |
\def\@listi{\leftmargin\leftmargini |
|
904 |
\labelwidth\leftmargini\advance\labelwidth by -\labelsep |
|
905 |
\parsep=\parskip |
|
906 |
\topsep=\medskipamount |
|
907 |
\itemsep=\parskip \advance\itemsep by -\parsep}} |
|
908 |
\def\setitemitemindent#1{\settowidth{\labelwidth}{#1}% |
|
909 |
\let\setit@m=Y% |
|
910 |
\leftmarginii\labelwidth |
|
911 |
\advance\leftmarginii\labelsep |
|
912 |
\def\@listii{\leftmargin\leftmarginii |
|
913 |
\labelwidth\leftmarginii\advance\labelwidth by -\labelsep |
|
914 |
\parsep=\parskip |
|
915 |
\topsep=6\p@ |
|
916 |
\itemsep=\parskip \advance\itemsep by -\parsep}} |
|
917 |
% |
|
918 |
% adjusted environment "description" |
|
919 |
% if an optional parameter (at the first two levels of lists) |
|
920 |
% is present, its width is considered to be the widest mark |
|
921 |
% throughout the current list. |
|
922 |
\def\description{\@ifnextchar[{\@describe}{\list{}{\labelwidth\z@ |
|
923 |
\labelsep=12pt\relax %!!!!!!!!! |
|
924 |
\leftmargini=12pt\relax %!!!!!!!!! |
|
925 |
\leftmargin=12pt\relax %!!!!!!!!! |
|
926 |
\itemindent-\leftmargin \let\makelabel\descriptionlabel}}} |
|
927 |
% |
|
928 |
\def\describelabel#1{#1\hfil} |
|
929 |
\def\@describe[#1]{\labelsep=12pt\relax |
|
930 |
\relax\ifnum\@listdepth=0 |
|
931 |
\setitemindent{#1}\else\ifnum\@listdepth=1 |
|
932 |
\setitemitemindent{#1}\fi\fi |
|
933 |
\list{--}{\let\makelabel\describelabel}} |
|
934 |
% |
|
935 |
\def\itemize{% |
|
936 |
\ifnum \@itemdepth >\thr@@\@toodeep\else |
|
937 |
\advance\@itemdepth\@ne |
|
938 |
\ifx\setit@m\undefined |
|
939 |
\ifnum \@itemdepth=1 \leftmargini=\svitemindent |
|
940 |
\labelwidth\leftmargini\advance\labelwidth-\labelsep |
|
941 |
\leftmarginii=\leftmargini \leftmarginiii=\leftmargini |
|
942 |
\fi |
|
943 |
\fi |
|
944 |
\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% |
|
945 |
\expandafter\list |
|
946 |
\csname\@itemitem\endcsname |
|
947 |
{\def\makelabel##1{\rlap{##1}\hss}}% |
|
948 |
\fi} |
|
949 |
% |
|
950 |
\def\enumerate{% |
|
951 |
\ifnum \@enumdepth >\thr@@\@toodeep\else |
|
952 |
\advance\@enumdepth\@ne |
|
953 |
\ifx\setit@m\undefined |
|
954 |
\ifnum \@enumdepth=1 \leftmargini=\svitemindent |
|
955 |
\labelwidth\leftmargini\advance\labelwidth-\labelsep |
|
956 |
\leftmarginii=\leftmargini \leftmarginiii=\leftmargini |
|
957 |
\fi |
|
958 |
\fi |
|
959 |
\edef\@enumctr{enum\romannumeral\the\@enumdepth}% |
|
960 |
\expandafter |
|
961 |
\list |
|
962 |
\csname label\@enumctr\endcsname |
|
963 |
{\usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}}% |
|
964 |
\fi} |
|
965 |
% |
|
966 |
\newdimen\verbatimindent \verbatimindent\parindent |
|
967 |
\def\verbatim{\advance\@totalleftmargin by\verbatimindent |
|
968 |
\@verbatim \frenchspacing\@vobeyspaces \@xverbatim} |
|
969 |
|
|
970 |
% |
|
971 |
% special signs and characters |
|
972 |
\newcommand{\D}{\mathrm{d}} |
|
973 |
\newcommand{\E}{\mathrm{e}} |
|
974 |
\let\eul=\E |
|
975 |
\newcommand{\I}{{\rm i}} |
Also available in: Unified diff