Debian Codegraph @

texmf-dist/source/latex/elbioimp/elbioimp.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 2011 by Dag Langmyhr
4 %
5 % This file may be distributed and/or modified under the
6 % conditions of the LaTeX Project Public License, see
7 % http://www.latex-project.org/lppl.txt
8 %
9 % \fi
10 %
11 % \iffalse
12 %<*driver>
13 \ProvidesFile{elbioimp.dtx}
14 %</driver>
15 %<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
16 %<class>\ProvidesClass{elbioimp}
17 %<*class>
18 [2011/03/02 v1.2 Document class for Journal of Electrical Bioimpedance]
19 %</class>
20 %
21 %<*driver>
22 \documentclass{elbioimp}
23 \usepackage[T1]{fontenc}
24 \usepackage{doc,textcomp,varioref}
25 \EnableCrossrefs
26 \CodelineIndex
27 \RecordChanges
28 \keywords{\LaTeX{} document class, journal document style}
29
30 \begin{document}
31 \DocInput{elbioimp.dtx}
32 \end{document}
33 %</driver>
34 % \fi
35 %
36 % \CharacterTable
37 % {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
38 % 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
39 % Digits \0\1\2\3\4\5\6\7\8\9
40 % Exclamation \! Double quote \" Hash (number) \#
41 % Dollar \$ Percent \% Ampersand \&
42 % Acute accent \' Left paren \( Right paren \)
43 % Asterisk \* Plus \+ Comma \,
44 % Minus \- Point \. Solidus \/
45 % Colon \: Semicolon \; Less than \<
46 % Equals \= Greater than \> Question mark \?
47 % Commercial at \@ Left bracket \[ Backslash \\
48 % Right bracket \] Circumflex \^ Underscore \_
49 % Grave accent \` Left brace \{ Vertical bar \|
50 % Right brace \} Tilde \~}
51 %
52 % % \CheckSum{224}
53 %
54 % \newcommand{\cmd}[1]{\texttt{\textbackslash #1}}
55 % \newcommand{\Cname}{\textsf{elbioimp}}
56 % \newcommand{\Jname}{\emph{Journal of Electrical Bioimpedance}}
57 %
58 % \changes{v1.0}{2010/01/20}{Initial version}
59 % \changes{v1.1}{2010/11/02}{Line spacing modified}
60 % \changes{v1.2}{2011/03/01}{Added \cmd{subsection},
61 % \cmd{affiliation}, and \cmd{sameaffiliation}}
62 %
63 % \GetFileInfo{elbioimp.dtx}
64 %
65 % \DoNotIndex{\,}
66 % \DoNotIndex{\abstractname,\addtocounter,\arabic,\AtBeginDocument,\@author}
67 % \DoNotIndex{\baselineskip,\begin,\bf,\bibliographystyle}
68 % \DoNotIndex{\captionsetup,\ClassWarningNoLine,\columnwidth,\CurrentOption}
69 % \DoNotIndex{\DeclareCaptionLabelFormat,\DeclareMathSizes,\DeclareOption,\def}
70 % \DoNotIndex{\end,\equal}
71 % \DoNotIndex{\footnote,\footnoterule}
72 % \DoNotIndex{\ifthenelse,\@ifundefined,\ignorespaces,\it,\itemsep}
73 % \DoNotIndex{\leftmargin,\leftmargini,\let,\@listi,\@listI,\LoadClass}
74 % \DoNotIndex{\@makefnmark,\@makefntext}
75 % \DoNotIndex{\newcommand,\newenvironment,\noindent,\normalfont}
76 % \DoNotIndex{\pagestyle,\par,\parindent,\parsep,\ProcessOptions}
77 % \DoNotIndex{\relax,\renewcommand,\renewenvironment,\RequirePackage,\rule}
78 % \DoNotIndex{\setcounter,\@setfontsize,\setlength,\space,\@startsection}
79 % \DoNotIndex{\textbf,\@textsuperscript,\textwidth,\@thefnmark,%
80 % \thempfootnote,\@title,\topsep,\twocolumn}
81 % \DoNotIndex{\urlstyle}
82 % \DoNotIndex{\vspace}
83 %
84 % \title{The \Cname{} class}
85 % \author{Dag Langmyhr\affiliation{Department of Informatics,
86 % University of Oslo, \textsf{[email protected]}}}
87 %
88 % \maketitle
89 %
90 % \begin{abstract}
91 % \noindent
92 % This paper describes the implementation of the document class
93 % \Cname{} which has been designed for writing articles in the \Jname.
94 % It corresponds to \Cname{}~\fileversion, dated \filedate.
95 % \end{abstract}
96 %
97 %
98 % \section{Introduction}
99 % The \Jname{} (see its web page at
100 % \url{https://www.journals.uio.no/index.php/bioimpedance}) has
101 % defined a typographic style for its publication, to some extent
102 % based on recommendations from the \emph{US National institute of
103 % health}\cite{NIH}. The \LaTeX{} document class \Cname{} implements
104 % this style.
105 % As an example, this documentation uses the \Cname{} class.
106 %
107 % This \LaTeX{} code is published with a \textbf{\LaTeX{} project
108 % public license}, as described in
109 % \url{http://www.latex-project.org/lppl/}.
110 %
111 %
112 % \section{Usage}
113 % To use this document class, you must first put the
114 % \url{elbioimp.cls} file somewhere that \LaTeX{} can find
115 % it.\footnote{If you are not very familiar with your \LaTeX{}
116 % installation or your system administrator, you can put the
117 % \url{elbioimp.cls} file in the same folder as your \LaTeX{} source
118 % files.}
119 % Then you can write your \LaTeX{} document starting with
120 % \begin{verbatim}
121 %\documentclass{elbioimp}
122 % \end{verbatim}
123 % The document class is based on the standard \emph{article} class and
124 % is used just like that class, with three exceptions:
125 % \begin{enumerate}
126 % \item The authors' affiliations (to companies or academic institutions)
127 % are given with the \verb:\affiliation: command:
128 % \begin{verbatim}
129 %\author{My name\affiliation{My univerisity,
130 % My city, My country}}
131 % \end{verbatim}
132 % If there is more than one author, their names should be separated
133 % by an \verb:\and: command.
134 %
135 % If two authors have the same affiliation, the latter one may use the
136 % \verb:\sameaffiliation: command, as in
137 % \begin{verbatim}
138 %\author{First Author\affiliation{My university,
139 % My city, My country}\and
140 % Second Author\sameaffiliation}
141 % \end{verbatim}
142 %
143 % In case there should be three or more authors and some have identical
144 % affiliations, \verb:\sameaffiliation: may be given a
145 % numeric option referencing a previous author; for example, if the
146 % first and the third author belong to the same institution, you may
147 % write:
148 % \begin{verbatim}
149 %\author{A Bee\affiliation{Uni A}\and
150 % C Dee\affiliation{Uni B}\and
151 % E Eff\sameaffiliation[1]}
152 % \end{verbatim}
153 %
154 % \item The author may indicate keywords by empoying the
155 % \verb:\keyword: command.
156 %
157 % \item The document class will function poorly unless there is an
158 % \verb:abstract: environment and a \verb:\maketitle: command.
159 % \end{enumerate}
160 %
161 % \StopEventually{\bibliography{elbioimp}%
162 % \onecolumn\PrintChanges\PrintIndex}
163 %
164 %
165 % \section{Class headers}
166 % All \LaTeXe{} class files contain a header with a set of standard
167 % specifications.
168 %
169 % \subsection{Class options}
170 % This document class has no options.
171 % \begin{macrocode}
172 \DeclareOption*{\ClassWarningNoLine
173 {elbioimp}{Class option \CurrentOption
174 \space is illegal in this document class}}
175 \ProcessOptions \relax
176 % \end{macrocode}
177 %
178 % \subsection{Base class}
179 % This document class is based on the standard \emph{article} class.
180 %
181 % \begin{macrocode}
182 \LoadClass[twocolumn]{article}
183 % \end{macrocode}
184 %
185 % \section{Required packages}
186 % A couple of standard packages are necessary to implement this class.
187 %
188 % \subsection{The \textsf{ifthen} package}
189 % The \textsf{ifthen} package makes testing easier.
190 % \begin{macrocode}
191 \RequirePackage{ifthen}
192 % \end{macrocode}
193 %
194 % \subsection{The \textsf{url} package}
195 % URLs should be typeset in a \textsf{Sans serif font} rather than a
196 % \texttt{Teletype font}.
197 % \begin{macrocode}
198 \RequirePackage[T1]{url}
199 \urlstyle{sf}
200 % \end{macrocode}
201 %
202 %
203 % \section{Document title area}
204 % The title area has its own particular design.
205 % It is implemented by redefining the \verb:\maketitle: command.
206 % \begin{macrocode}
207 \AtBeginDocument{\renewcommand{\maketitle}{%
208 \twocolumn[\begin{minipage}{\textwidth}
209 \renewcommand{\and}{, }
210 \let \thanks = \affiliation
211 \let \samethanks = \sameaffiliation
212 \renewcommand{\footnoterule}{}
213 \def \@makefntext ##1{\noindent
214 \small \@thefnmark. \it ##1}
215 \renewcommand{\thempfootnote}%
216 {\arabic{mpfootnote}}
217 \parindent = 0pt
218 {\huge \@title}\par\vspace{16pt}
219 {\large \@author}
220 \end{minipage}\par\vspace{14pt}\noindent
221 \elb@rule{\textwidth}\vspace{11pt}]}}
222 \newcommand{\elb@rule}[1]{\rule{#1}{0.6pt}}
223 % \end{macrocode}
224 % (The names \verb:\thanks: and \verb:\samethanks: are kept for
225 % historic reasons.)
226 %
227 % \subsection{Affiliations}
228 % Affiliations are specified using the \verb:\affiliation: and
229 % \verb:\sameaffiliation: commands.
230 % \begin{macrocode}
231 \newcommand{\affiliation}[1]{\footnote{#1}}
232 \newcommand{\sameaffiliation}[1][0]{%
233 \addtocounter{mpfootnote}{-1}%
234 \ifthenelse{#1<1}
235 {\@makefnmark}
236 {\@textsuperscript{\normalfont#1}}%
237 \addtocounter{mpfootnote}{1}}
238 % \end{macrocode}
239 %
240 % \subsection{Keywords}
241 % An additional command \verb:\keywords: makes it possible to specify
242 % keywords that apply to the document.
243 % \begin{macrocode}
244 \newcommand{\keywords}[1]{\def\elb@keywords{#1}}
245 % \end{macrocode}
246 %
247 % \subsection{Abstract}
248 % The abstract is typeset in \verb:\small:, and includes the keywords (if
249 % any).
250 % \begin{macrocode}
251 \renewenvironment{abstract}
252 {\small\noindent
253 \textbf{\abstractname}\par\vspace{1pt}
254 \noindent\ignorespaces}
255 {\par
256 \@ifundefined{elb@keywords}{}{%
257 \vspace{\baselineskip}\noindent
258 \textbf{Keywords:} \elb@keywords\par}
259 \vspace{\baselineskip}\noindent
260 \elb@rule{\columnwidth}}
261 % \end{macrocode}
262 %
263 %
264 % \section{Body text}
265 %
266 % \subsection{Text area}
267 % The text area should be in two columns and fill an A4 paper with
268 % margins 1.5\,cm (except the top margin, which should be 2.5\,cm).
269 % The gutter space should be 1\,cm.
270 % \begin{macrocode}
271 \RequirePackage[a4paper,
272 margin=1.5cm,top=2.5cm]{geometry}
273 \setlength{\columnsep}{1cm}
274 % \end{macrocode}
275 % Since the layout uses double columns, I will increase the tolerance
276 % for line-breaking.
277 % \begin{macrocode}
278 \pretolerance = 1000
279 \tolerance = 2000 \hbadness = \tolerance
280 % \end{macrocode}
281 %
282 %
283 % \subsection{Headers and footers}
284 % This document class has neither headers nor footers, presumably
285 % because the publisher will add them later.
286 % \begin{macrocode}
287 \AtBeginDocument{\pagestyle{empty}}
288 % \end{macrocode}
289 %
290 %
291 % \subsection{Text font}
292 % The specified journal font is \emph{Times Roman}. The
293 % \emph{mathptmx} packages is one of several packages that can handle this,
294 % but this particular package has the advantage that it also uses
295 % \emph{Times Roman} for the math fonts (as much as possible).
296 % \begin{macrocode}
297 \RequirePackage{mathptmx}
298 % \end{macrocode}
299 % The \emph{mathptmx} package retains the \textsf{Computer Modern Sans
300 % Serif} and \texttt{Computer Modern Teletype} fonts, but they blend
301 % reasonably well with \emph{Times Roman} (at least in my opinion) so
302 % I will keep them.
303 %
304 % \subsection{Text sizes}
305 % The specified text sizes are shown in Table\vref{tab:sizes}.
306 % The leading should be 30\%.
307 % \begin{table}
308 % \centering
309 % \begin{tabular}{cr}
310 % \Huge \strut\verb:\Huge:& 20\,pt\\
311 % \huge \strut\verb:\huge:& 16\,pt\\
312 % \LARGE \strut\verb:\LARGE:& 14\,pt\\
313 % \Large \strut\verb:\Large:& 12\,pt\\
314 % \large \strut\verb:\large:& 11\,pt\\
315 % \normalsize \strut\verb:\normalsize:& 10\,pt\\
316 % \small \strut\verb:\small:& 9\,pt\\
317 % \footnotesize \strut\verb:\footnotesize:& 8\,pt\\
318 % \scriptsize \strut\verb:\scriptsize:& 7\,pt\\
319 % \tiny \strut\verb:\tiny:& 5\,pt\\
320 % \end{tabular}
321 % \caption{Text sizes in \Cname\label{tab:sizes}}
322 % \end{table}
323 % \begin{macrocode}
324 \renewcommand{\Huge}{\@setfontsize
325 \Huge {20}{26}}
326 \renewcommand{\huge}{\@setfontsize
327 \huge {16}{20.8}}
328 \renewcommand{\LARGE}{\@setfontsize
329 \LARGE {14}{18.2}}
330 \renewcommand{\Large}{\@setfontsize
331 \Large {12}{15.6}}
332 \renewcommand{\large}{\@setfontsize
333 \large {11}{14.3}}
334 \renewcommand{\normalsize}{%
335 \@setfontsize \normalsize {10}{13}%
336 \abovedisplayskip =
337 10pt plus 2pt minus 5pt
338 \abovedisplayshortskip =
339 0pt plus 3pt
340 \belowdisplayshortskip =
341 6pt plus 3pt minus 3pt
342 \belowdisplayskip = \abovedisplayskip
343 \def\@listi{\leftmargin = \leftmargini
344 \topsep = 5pt plus 2pt minus 2pt
345 \parsep = 3pt plus 1pt minus 1pt
346 \itemsep = \topsep}}
347 \renewcommand{\small}{%
348 \@setfontsize \small {9}{11.7}%
349 \abovedisplayskip =
350 8.5pt plus 3pt minus 4pt
351 \abovedisplayshortskip =
352 0pt plus 2pt
353 \belowdisplayshortskip =
354 4pt plus 2pt minus 2pt
355 \def\@listi{\leftmargin = \leftmargini
356 \topsep = 4pt plus 2pt minus 2pt
357 \parsep = 2pt plus 1pt minus 1pt
358 \itemsep = \topsep}%
359 \belowdisplayskip = \abovedisplayskip}
360 \renewcommand{\footnotesize}{%
361 \@setfontsize \footnotesize {8}{10.4}%
362 \abovedisplayskip =
363 6pt plus 2pt minus 4pt
364 \abovedisplayshortskip =
365 0pt plus 1pt
366 \belowdisplayshortskip =
367 3pt plus 1pt minus 2pt
368 \def\@listi{\leftmargin = \leftmargini
369 \topsep = 3pt plus 1pt minus 1pt
370 \parsep = 1.5pt plus 1pt minus 1pt
371 \itemsep = \topsep}%
372 \belowdisplayskip = \abovedisplayskip}
373 \renewcommand{\scriptsize}{\@setfontsize
374 \scriptsize {7}{9.1}}
375 \renewcommand{\tiny}{\@setfontsize
376 \tiny {5}{6.5}}
377 % \end{macrocode}
378 % As expected, \verb:\normalsize: is the default.
379 % \begin{macrocode}
380 \normalsize
381 % \end{macrocode}
382 % Since the class uses some non-standard sizes (i.e., not in the
383 % $1{.}2^n$-series) it must signal \LaTeX{} that font
384 % scaling may be used.\footnote{These days, all decent \LaTeX{} installations
385 % should provide scalable fonts.}
386 % \begin{macrocode}
387 \RequirePackage{type1cm,type1ec}
388 % \end{macrocode}
389 % The class must also define some math sizes.
390 % \begin{macrocode}
391 \DeclareMathSizes{11}{11}{8}{6}
392 \DeclareMathSizes{14}{14}{11}{8}
393 \DeclareMathSizes{16}{16}{12}{10}
394 \DeclareMathSizes{20}{20}{14}{12}
395 % \end{macrocode}
396 %
397 %
398 % \section{Sectioning}
399 % The section headers in this class have a different look from the
400 % standard \LaTeX{} classes.
401 % \begin{macrocode}
402 \renewcommand{\section}{\@startsection
403 {section}{1}{0pt}%
404 {-11pt plus -6pt minus -2pt}%
405 {11pt plus 6pt minus 2pt}%
406 {\normalfont\normalsize\bf}}
407 \renewcommand{\subsection}{\@startsection
408 {subsection}{2}{0pt}%
409 {-11pt plus -6pt minus -2pt}%
410 {11pt plus 6pt minus 2pt}%
411 {\normalfont\normalsize\it}}
412 \renewcommand{\subsubsection}{\@startsection
413 {subsubsection}{3}{0pt}%
414 {-11pt plus -6pt minus -2pt}%
415 {11pt plus 6pt minus 2pt}%
416 {\normalfont\normalsize}}
417 % \end{macrocode}
418 % The default definitions of \verb:\paragraph: and
419 % \verb:\subparagraph: are retained.
420 %
421 % \subsection{Section numbering}
422 % No sections should be numbered.
423 % \begin{macrocode}
424 \setcounter{secnumdepth}{-2}
425 % \end{macrocode}
426 %
427 %
428 % \section{Floats}
429 % Formating of float captions is best handled using the
430 % \textsf{caption} package. This style wants them
431 % \begin{itemize}
432 % \item indentend 0.5\,cm on each side
433 % \item 8\,pt type size
434 % \item numbering should use ``Fig.~1'' or ``Tab.~1''.
435 % \end{itemize}
436 % \begin{macrocode}
437 \RequirePackage[margin=0.5cm,font=footnotesize,
438 aboveskip=5pt]{caption}
439 \DeclareCaptionLabelFormat{fig}
440 {\ifthenelse{\equal{#1}%
441 {Figure}}{Fig}{Tab}.~#2}
442 \captionsetup{labelformat=fig}
443 % \end{macrocode}
444 % We also adjust the spacing around the floats, and we do not want
445 % half-empty float-columns.
446 % \begin{macrocode}
447 \setlength{\floatsep}{6pt plus 3pt}
448 \setlength{\textfloatsep}{\floatsep}
449 \renewcommand{\floatpagefraction}{0.8}
450 % \end{macrocode}
451 %
452 %
453 % \section{Document reference list}
454 % The reference list should be according to the Vancouver style:
455 % \begin{macrocode}
456 \bibliographystyle{vancouver}
457 % \end{macrocode}
458 % but the bibliography should be set in 9\,pt type size with 3\,pt vertical
459 % space.
460 % \begin{macrocode}
461 \renewcommand{\@openbib@code}{\small
462 \setlength{\itemsep}{3pt}%
463 \setlength{\parsep}{1pt plus 1pt}}
464 % \end{macrocode}
465 % In the bibliography, citations will be indicated as ``1.''
466 % rather than as ``[1]''.
467 % \begin{macrocode}
468 \renewcommand\@biblabel[1]{#1.}
469 % \end{macrocode}
470 %
471 % \Finale
472 \endinput