summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ieeepes/ieeepes.sty
blob: 75d731786494c10de8db198cf6b2d4a7a4e1ece9 (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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
%%----------------------------------------------------------------------
%% ieeepes.sty
%
% Sets up the document layout for IEEE PES (Power Engineering Society)
% publications.
% Usage: Load as a package together with the article document class.
% Example:
%	\documentclass{article}
%	\usepackage{ieeepes}
% Note: This package requires package vmargin by Volker Kuhlmann.
%
% Copyright (C) Volker Kuhlmann 1993, 1995, 1996, 1999
%
% Volker Kuhlmann
% c/o University of Canterbury
% ELEC Dept
% Creyke Road
% Christchurch, New Zealand
% E-Mail: v.kuhlmann@elec.canterbury.ac.nz
%
% This program can be redistributed and/or modified under the terms
% of the LaTeX Project Public License, distributed from CTAN
% archives as macros/latex/base/lppl.txt; either
% version 1 of the License, or (at your option) any later version.
%
%
% HISTORY:
% 4.0.1 01Jun99	Changed license to LPPL.
% 4.0  13Apr99	Fixed for use with LaTeX 1998/06/01.
% 3.25 19Jul96	\colbe removed. \authorcolumn, \linefield, \authors.
% 3.23 17Jul96	\colbe.
% 3.22 04Jul96	Environment Table.
% 3.2  30Jun96	Option draft prints "draft". Option puttoc.
%		Corrected section numbers, and section referencing.
% 3.1  03Apr96	Added some comments.
% 3.1  06Mar96	Added option noieeebox.
% 3.0  16Nov95	Changed summary.
% 2.9  16Nov95	Added summary.
% 2.8  14Nov95	Fixed caption justification.
% 2.7  12Nov95	\maketitle illegal, \Rhighlight, \Lhighlight.
%		Fixed abstract. Use graphicx instead of epsfig.
%		PStimes loads times and mathptm.
% 2.6  09Nov95	Option PStimes.
% 2.5  07Nov95	\discussion, \closure.
% 2.4  06Nov95	\figref, \tabref, equations, biography photos.
% 2.3  27Oct95	Added \author, \and.
% 2.2  10Oct95	Improved.
% 2.1  24Sep95	Improved.
% 2.0  15Sep95	Created out of IEEEpaper.sty, V2.22, 21 Feb 1993.
%
%%----------------------------------------------------------------------

\def\filename{ieeepes}
\def\fileversion{V4.0.1}
\def\filedate{1999/06/01}
\edef\ieeepesname{\filename}


\NeedsTeXFormat{LaTeX2e}[1998/06/01]
\ProvidesPackage{\filename}[\filedate]
\typeout{Package `\filename', \fileversion, <\filedate>}


%
%% LOAD REQUIRED PACKAGES
%
% Margin macros, by Volker Kuhlmann. Can be obtained from CTAN.
% A copy should be included with ieeepes for convenience.
\RequirePackage{vmargin}


%
%% DECLARE PACKAGE OPTIONS
%
\DeclareOption{draft}{%
	\PackageWarning{\ieeepesname}{DRAFT selected}%
	\AtEndOfPackage{%
		\pagestyle{plain}%
		\def\@Lhlmark{\LARGE$\rightarrow$}%
		\def\@Rhlmark{\LARGE$\leftarrow$}%
		\def\@oddfoot{\reset@font
			\hbox to\z@{\sffamily\bfseries DRAFT%
				\hskip 2em{\footnotesize\@date}\hss}%
			\hfil\thepage\hfil
			\hbox to\z@{\hss\sffamily\bfseries 
				{\footnotesize\@date}\hskip 2em DRAFT}}%
		\let\@evenfoot\@oddfoot
		}
	\newcommand\@puttoc{\old@tableofcontents\par\bigskip\bigskip}%
	%% with option puttoc
	}

\DeclareOption{psphotos}{%
	\psphototrue
	\AtEndOfPackage{\RequirePackage{graphicx}}
	}
\newif\ifpsphoto

\DeclareOption{photofit}{%
	\photofittrue
	}
\newif\ifphotofit

\DeclareOption{PStimes}{%
	\AtEndOfPackage{\RequirePackage{times,mathptm}}
	}

\DeclareOption{noieeebox}{%
	\AtBeginDocument{\let\@putbox\relax}
	}

\DeclareOption{puttoc}{%
	\newcommand\@@puttoc{\csname @puttoc\endcsname}%
	%% put toc, but only if option draft is active as well
	}


\ProcessOptions


%
%% PAGE AND PARAGRAPH LAYOUT
%
\setpapersize{USletter}
\setmarginsrb{18mm}{25mm}{18mm}{14mm}{0pt}{0mm}{}{11mm}
\parskip	0pt plus 1.5pt	% default by LaTeX: 0pt plus 1pt
\parindent	3.5mm		% default by LaTeX: 15pt
\columnsep	5mm		% default by LaTeX: 10pt = 3.5mm
\pagestyle	{empty}


%
%% WARNINGS, ERRORS
%
\newcommand\err@@text[1]%
	{Illegal command: \string#1}
\newcommand\hlp@@text
	{You can't use this command in IEEE PES documents.}
\newcommand\err@@illcmd[1]{%
	\PackageError{\ieeepesname}{\err@@text{#1}}{\hlp@@text}%
}


%
%% HEADER, EMPTY BOX
%
% \author, \and
% \authorcolumn
% \linefield
% \authors, &, \\
%
\renewcommand\author[1]{%
	\gdef\@author{%
		\author@beg #1\author@end
	}%
}
\renewcommand\and{%
	\author@end\author@beg
}
\newcommand\author@beg{%
	\mbox{}\hfill
	\hspace*{-.5\textwidth}%
	\begin{minipage}{\textwidth}%
	\centering
}
\newcommand\author@end{%
	\end{minipage}%
	\hspace*{-.5\textwidth}%
	\hfill\mbox{}%
}
%
\newcommand\authorcolumn[1]{\mbox{}\hfill\hspace{-.5\textwidth}%
	\parbox[t]{\textwidth}{\centering\strut #1\strut}\strut
		\hspace{-.5\textwidth}\hfill\mbox{}\ignorespaces}
	% works, but are the \strut s correct?
%
\newcommand\linefield[1]{\mbox{}\hfill\hbox to \z@{\hss #1\hss}\hfill\null
	\ignorespaces}% works!
%
\newbox\author@box
\newcommand\authors{%
	%\gdef\@author{\author@begii #1\author@endii}%
	\begingroup
	\catcode`\&\active
	\authorii@
}
\newcommand\authorii@{}
\begingroup
\catcode`\&\active
\gdef\authorii@#1{%
	\global\setbox\author@box=\hbox{\parbox{\textwidth}{%
		\large\rmfamily
		\centering% before redefining \\ !!!
		\def\\{\author@endii\linebreak\author@begii}%
		\def&{\author@endii\hfil\hfil\author@begii}%
		\leavevmode\author@begii #1\author@endii\par}}%
	\gdef\@author{\box\author@box}%
	\endgroup
}
\endgroup
\newcommand\author@begii{\hbox to \z@\bgroup\hss\ignorespaces}
\newcommand\author@endii{\hss\egroup}
%
\newcommand\@putheader{%
	\twocolumn[%
		\begin{center}
		{\Large\textbf{\@title}\par}% this needs to be 14pt bold
		\vspace{1cm}
		\tabcolsep	1cm
		{\large\textrm{\@author}\par}% needs to be 12pt
		\vspace{1cm}
		\end{center}
		]
	}
%
\newcommand\@putbox{%
	% put empty space on bottom of page
	% the figure-counter is not incremented because we don't
	% have a caption
	\begin{figure}[b]
	%\framebox(200,142.3){50mm of nothing}
	%\fbox{\makebox(200,142.3){}}
	\makebox(200,142.3){}
	\end{figure}
	}
%
\newcommand\ieeepes@maketitle{\@putheader\@putbox\csname @@puttoc\endcsname}
%\AtBeginDocument{\ieeepes@maketitle}
%This hook is now part of the preamble -> can no longer use it here.
%
%% make \maketitle illegal
%\renewcommand\maketitle{\PackageError{ieeepes}%
%	{\err@@section\maketitle}\hlp@@section}
% Adjust \maketitle, show error if not used
\renewcommand\maketitle{%
	\ieeepes@maketitle
	\capwidth=0.8\columnwidth
	\def\had@pesmt{y}%
}
\def\had@pesmt{}
\AtEndDocument{%
	\if y\had@pesmt\else
	  \PackageError{\ieeepesname}%
		{Must use \string\maketitle\space after
		 \string\begin{document}}%
		\hlp@@section
	\fi
}


%
%% TABLE OF CONTENTS
%
% save original definition and make illegal
\let\old@tableofcontents=\tableofcontents
\renewcommand\tableofcontents{\err@@illcmd\tableofcontents}


%
%% ABSTRACT
%
\renewenvironment{abstract}{%
	\footnotesize\bfseries
	\textit{Abstract---}\ignorespaces
}{%
	\par
}


%
%% SECTIONING
%
% Section numbering for \section, \subsection, \subsubsection.
\setcounter{secnumdepth}{3}
%
% Save original definition of \@xsect
\let\sv@xsect=\@xsect
%
%\renewcommand\@seccntformat[1]{\csname the#1\endcsname \hskip.4em\relax}
%% this is used for typesetting the sectioning number
%
%\renewcommand\thesection{\Roman{section}.}
\renewcommand\thesection{\Roman{section}}
% copied from classes.dtx, and modified:
\renewcommand\section{%
	\def\@seccntformat##1{\Roman{section}.\hskip.4em\relax}%
	\let\@xsect=\sv@xsect
	\@startsection {section}{1}{\z@}%
		{1\baselineskip \@plus1\baselineskip \@minus.1\baselineskip}%
		{.8\baselineskip \@plus.2\baselineskip}%
		{\reset@font\normalsize\scshape\noindent\hfil}%
	}
%
%\renewcommand\thesubsection{\Alph{subsection}.}
\renewcommand\thesubsection{\thesection.\Alph{subsection}}
% copied from classes.dtx, and modified:
\renewcommand{\subsection}{%
	\def\@seccntformat##1{\Alph{subsection}.\hskip.4em\relax}%
	\let\@xsect=\sv@xsect
	\@startsection{subsection}{2}{\z@}%
		{1\baselineskip \@plus1\baselineskip \@minus.1\baselineskip}%
		{.8\baselineskip \@plus.2\baselineskip \@minus.1\baselineskip}%
		{\reset@font\normalsize\itshape}%
	}
%
%\renewcommand\thesubsubsection{\arabic{subsubsection})}
\renewcommand\thesubsubsection{\thesubsection.\arabic{subsubsection})}
% copied from classes.dtx, subparagraph, and modified:
\renewcommand{\subsubsection}{%
	\def\@seccntformat##1{\arabic{subsubsection})\hskip.4em\relax}%
	% Intercept \@xsect call by \@sect, and add a colon
	\def\@xsect{%
		\let\old@svsechd=\@svsechd
		\def\@svsechd{\old@svsechd:}%
		\sv@xsect}%
	\@startsection{subsubsection}{3}{\parindent}%
		{-1\parskip}%
		{-.5em}%
		{\reset@font\normalsize\itshape}%
	}
%
% Disallow sectioning below \subsubsection.
\renewcommand\paragraph{\err@@illcmd\paragraph}
\renewcommand\subparagraph{\err@@illcmd\subparagraph}


%
%% FLOATS (FIGURES AND TABLES)
%

% Define numbering
%
\renewcommand\thefigure{\arabic{figure}}
\renewcommand\figurename{Fig.}
\renewcommand\thetable{\Roman{table}}
\renewcommand\tablename{Table}
\renewcommand\thempfootnote{\alph{mpfootnote}}

% References
%
\newcommand\figref{\figurename~\ref}
\newcommand\tabref{\tablename~\ref}
\newcommand\fref{\figref}
\newcommand\tref{\tabref}

% Caption spacing
%
% (the following skips are set here to avoid trouble with other
%  packages also working with captions.)
\abovecaptionskip	.9\baselineskip
\belowcaptionskip	0mm
%
\newdimen\capwidth
%\AtBeginDocument{\capwidth=.8\columnwidth}
% setting \capwidth is useless before \twocolumn is active
% now done by \maketitle

% Float placement parameters
%
\floatsep			1\baselineskip 
				  \@plus.1\baselineskip \@minus.1\baselineskip
\textfloatsep			1.1\baselineskip 
				  \@plus1\baselineskip \@minus\z@

% Make the contents of a figure/table environment centered by default.
% (Note: this makes use of internal LaTeX control sequences and might
% not work any more with future releases.)
%
\let\old@floatboxreset=\@floatboxreset
\def\@floatboxreset{\old@floatboxreset\centering}

% Handle caption formatting
%
% Intercept at beginning of figure, and setup
\let\old@figure=\figure
\def\figure{%
%\showthe\abovecaptionskip
	\let\@makecaption=\fig@caption
	\abovecaptionskip=.9\baselineskip
	\belowcaptionskip=0mm
	\old@figure
	}
\newcommand\fig@caption[2]{%
	\par
	\vskip\abovecaptionskip
	\centering\footnotesize
	\sbox\@tempboxa{#1. #2}\ifdim\wd\@tempboxa > \capwidth
	  \parbox\capwidth{#1. #2}%
	\else
	  \parbox\capwidth{\centering #1. #2}%
	\fi
	\vskip\belowcaptionskip
	}
%
% Intercept at beginning of table, and setup
\let\old@table=\table
\def\table{%
	\let\@makecaption=\tbl@caption
	\abovecaptionskip=0mm
	\belowcaptionskip=.9\baselineskip
	\old@table
	}
\newcommand\tbl@caption[2]{%
	\par
	\vskip\abovecaptionskip
	\centering\footnotesize\scshape
	%\sbox\@tempboxa{#1. #2}%
	\sbox\@tempboxa{#2}%
	\ifdim\wd\@tempboxa > \capwidth
	  \parbox\capwidth{\hfil #1\\#2}%
	\else
	  \parbox\capwidth{\centering #1\\#2}%
	\fi
	\vskip\belowcaptionskip
	}

% New environments for figure and table which take a label and the
% caption as argument and place the caption correctly.
% Arguments in square brackets are optional.
% The LABEL argument is required but may be empty.
%
% \begin{Figure}[FLOATPLACEMENT]{LABEL}[TOC CAPTION]{CAPTION}
% \begin{Table}[FLOATPLACEMENT]{LABEL}[TOC CAPTION]{CAPTION}
%
% Note: \figure does not take control sequences for LOC. Must be expanded
% recursively, hence the \edef\@FLPLACE and \expandafter before \figure.
%
\newenvironment{Figure}[2][\fps@figure]{%
	\edef\@FLPLACE{#1}\def\@TFLABEL{#2}\Figure@@
	}{%
	\caption[\@tocCAPTION]{\@CAPTION}%
	\ifx\@TFLABEL\empty\else\label\@TFLABEL\fi
	\endfigure
	}
\newcommand\Figure@@[2][]{%
	\def\@tocCAPTION{#1}\def\@CAPTION{#2}%
	\expandafter\figure\expandafter[\@FLPLACE]%
	}
%
\newenvironment{Table}[2][\fps@table]{%
	\edef\@FLPLACE{#1}\def\@TFLABEL{#2}\Table@@
	}{%
	\ifx\@TFLABEL\empty\else\label\@TFLABEL\fi
	\endtable
	}
\newcommand\Table@@[2][]{%
	\def\@tocCAPTION{#1}\def\@CAPTION{#2}%
	\expandafter\table\expandafter[\@FLPLACE]%
	\caption[\@tocCAPTION]{\@CAPTION}%
	}

% left and right highlighters
%
\newcommand\Lhighlight{\leavevmode\llap\@Lhlmark}
\newcommand\Rhighlight{\leavevmode\rlap\@Rhlmark}
\newcommand\@Lhlmark{}
\newcommand\@Rhlmark{}


%
%% EQUATIONS AND EQUATION REFERENCES
%

% Reference equations with (n), and remove the second set of
% parantheses from the equation number printed next to the equation,
% which would otherwise show up as ((n)).
%
\renewcommand\theequation{(\arabic{equation})}
\renewcommand\@eqnnum{\normalfont \normalcolor \theequation}

% Equation references
%
\newcommand\equref{\ref}		% within sentence
\newcommand\Equref{Equation~\ref}	% at beginning of sentence


%
%% CITATIONS AND BIBLIOGRAPHIES
%
\bibliographystyle{ieeepes}

% Turn the \section*{} which is called by \thebibliography into a
% \section{}, i.e. get the section numbered.
%
\let\old@thebibliography=\thebibliography
\def\thebibliography{%
	\let\old@section@=\section
	\def\section{\@ifstar\old@section@\old@section@}%
	\old@thebibliography
	}


%
%% BIOGRAPHY
%
% \begin{biography}{NAME}[RAISE EPS IMAGE]{FILENAME OF EPS FILE}
%
% The photograph to submit should be 30mm x 45mm, but this would not
% fit in the space provided in the example, which is about 28mm x 37mm
% (measured). The height has been decreased appropriately with this
% package.
%
\newdimen\@photoho
%
\newenvironment{biography}[1]{%
	\par
	\vspace{8mm \@plus2mm \@minus1mm}
	\footnotesize		% should be 8pt, roman
	\noindent
	\newcommand\@authorname{#1}%
	\@placephoto
}{%
	\par
}
\newcommand\@placephoto[2][\z@]{%
	\def\@photo{#2}\def\no@photo{nophoto}%
	\ifx\@photo\no@photo\else
	  \hangindent	30mm
	  \hangafter	-12
	  \ifpsphoto\ifx\@photo\@empty\else
	    \@photoho=-36.73mm
	    \advance\@photoho by #1
	    \llap{\raisebox{\@photoho}[\z@][\z@]{\parbox[t][38.5mm][t]{30mm}{%
	      \ifphotofit
	       \includegraphics[width=28mm,height=38.73mm]{#2}%
	      \else
	       \includegraphics[width=28mm]{#2}%
	      \fi
	      % area available with cm fonts: 28mm x 38.73mm
	      }}}%
	  \fi\fi
	\fi
	\textbf{\@authorname}\ \ignorespaces
	}


%
%% BALANCE COLUMNS ON LAST PAGE (MANUALLY)
%
\newcommand\columnbreak{%
	\ifvmode\newpage\else\vadjust{\newpage}\fi
	}


%
%% RE-DEFINE DATE FORMAT
%
\newcommand\@today{\number\year/\number\month/\number\day}
\let\today=\@today
\AtBeginDocument{\let\today=\@today}


%
%% SUMMARY, DISCUSSION AND CLOSURE
%
% \summary
% \discussion{PAPER NUMBER}{PAPER TITLE}{AUTHOR NAMES}%
%	{DISCUSSER NAME}{AFFILIATION INCL ADDRESS}{SHORT AFFILIATION}
% \closure{AUTHOR NAME}
%
\newcommand\reset@counters{%
	\setcounter{figure}{0}\setcounter{table}{0}%
	\setcounter{section}{0}%
	\setcounter{equation}{0}%
	\setcounter{footnote}{0}\setcounter{mpfootnote}{0}%
	}
%
\newcommand\summary{%
	\clearpage
	\reset@counters
	\setcounter{page}{1}%
	\thispagestyle{plain}\pagestyle{plain}%
	\onecolumn
	\columnwidth	88mm	% warning: brutal trick!
	\hsize\columnwidth	% "
}
\newcommand\discussion[6]{%
	\cleardoublepage
	\reset@counters
	\setcounter{page}{1}%
	\thispagestyle{plain}\pagestyle{plain}%
	\onecolumn
	\noindent Discussion of #1, ``#2'', by #3.\par
	\vspace{\baselineskip}%
	\noindent Discussion by #4, #5.\par
	\columnwidth	88mm	% warning: brutal trick!
	\hsize\columnwidth	% "
	\clearpage
	\begin{center}
	\Large
	\textbf{Discussion}
	\end{center}
	\textbf{#4}\ (#6)\ \ignorespaces
}
\newcommand\closure[1]{%
	\cleardoublepage
	\reset@counters
	\setcounter{page}{1}%
	\thispagestyle{plain}\pagestyle{plain}%
	\onecolumn
	\columnwidth	88mm	% warning: brutal trick!
	\hsize\columnwidth	% "
	\clearpage
	\begin{center}
	\Large
	\textbf{Closure}
	\end{center}
	\textbf{#1}\ \ignorespaces
}


%
%% TABLE STRUTS
%
% \setTBstruts, defining \T, \B
%
% to control vertical spacing in tabular and array
% (taken from "TeX and TUG NEWS", Vol. 2, No. 3, 1993, p. 10)
%
\providecommand\setTBstruts{\def\T{\rule{0pt}{2.6ex}}%
				\def\B{\rule[-1.2ex]{0pt}{0pt}}}


%% EOF ieeepes.sty
%%----------------------------------------------------------------------