source: ETALON/papers/2019_IPAC/i3d_BPM/jacow.cls @ 802

Last change on this file since 802 was 802, checked in by delerue, 5 years ago

Work on IPAC'19 papers

File size: 17.3 KB
Line 
1%%
2%% This file has been developed as a common template for papers
3%% destined for electronic production for Accelerator Conferences
4%%
5%% See the JACoW website for more information
6%%
7%%       http://jacow.org/
8%%
9%% This work may be distributed and/or modified under the
10%% conditions of the LaTeX Project Public License, either
11%% version 1.3c of this license or (at your option) any later
12%% version. This version of this license is in
13%%    http://www.latex-project.org/lppl/lppl-1-3c.txt
14%% and the latest version of this license is in
15%%    http://www.latex-project.org/lppl.txt
16%% and version 1.3 or later is part of all distributions of
17%% LaTeX version 2005/12/01 or later.
18%%
19%% This work has the LPPL maintenance status "maintained".
20%%
21%% This Current Maintainer of this work is Volker RW Schaa.
22%%
23%% This work consists of the following files
24%%    jacow.cls               this class file
25%%    JACoW_LaTeX_A4.tex      A4/letter templates to demonstrate the
26%%    JACoW_LaTeX_Letter.tex  .. use and explain the various parameters
27%%                            .. and settings for a submission to
28%%                            .. a JACoW conference proceedings
29%%    JACoW_LaTeX_A4.pdf      template in format A4 and European
30%%                            settings (citation and hyphenation)
31%%    JACoW_LaTeX_Letter.pdf  template in format letter and American
32%%                            setting (citation and hyphenation)
33%%    annexes-A4.tex          Annexes A-C which are included in "JACoW_LaTeX_A4.tex"
34%%    annexes-Letter.tex      Annexes A-C which are included in "JACoW_LaTeX_Letter.tex"
35%%
36%%    JACpic_mc.pdf           a graphic showing the JACoW page format
37%%    JACpic2.jpg             a graphic for a full width figure and
38%%                            multiline caption
39%%    jacow-collaboration.tex  an example title page showing the
40%%    jacow-collaboration.pdf  JACoW Colloaboration, the responsible
41%%                             editors for the various platform
42%%                            dependent templates (LaTeX, Word on PC and
43%%                            Mac, ODF). The PDF is included in the template
44%%
45%
46%  v0.1 to 1.3 : JAC2000.cls
47%  Special thanks to John Jowett and Michel Goossens from CERN and
48%  Martin Comyn at TRIUMF for their significant contributions to
49%  this class file over the period 1996 to 2000.
50%                                                 John Poole
51%                                                 March 2000
52%  v1.4 : JAC2001.cls
53%  JAC2001.cls is a modified version of JAC2000.cls to produce indented
54%  first paragraphs after section, subsection and subsubsection headings.
55%                                                 Martin Comyn  April 2001
56%
57%  v1.5 : JAC2003.cls
58%  This is a modified version of JAC2003.cls to adjust space around
59%  section and subsection headers to be more consistent with JACoW Word
60%  templates.                                     Todd Satogata  March 2011
61%
62% v 1.6 : jacow.cls
63% This is a complectly rewritten version of JAC2003.cls which needs a current
64% TeX-System to run.
65%                                                 Ulrike Fischer, November 2013
66%
67% v 1.7
68% - small change to correct the text block inside JACoW's magic red borders for
69%   a4paper (aca4); top has been set 18.5mm (19mm is defined in the template but
70%   leaves descenders outside the lower y margin).
71% - duplicate {boxit} removed
72%                                                 Volker RW Schaa, 14 April 2014
73%
74% v1.8
75% - added setup for \micro sign which disappears when using XeTeX or LuaTeX
76%   with unicode-math.                             Ulrike Fischer, 21 April 2014
77%
78% v1.9
79% - fixed the pdfLaTeX warnings for the text/math-micro hack
80%                                                  Ulrike Fischer, 22 April 2014
81%
82% v1.91
83% - Ligatures=TeX switch introduced to accommodate
84%                                                  Ulrike Fischer, 22 April 2014
85%
86% v1.92
87% - settings for top margin have to be different in A4 and letter to accommodate
88%   JACoW's PitStop Action List. This was found after receiving Plamen Hopchev's
89%   email about margins and testing the workflow with cropping the bounding box
90%   which starts at the lower left edge and not at the top (see graphic JACpic_mc
91%   in the template for measures).
92%                                                 Volker RW Schaa, 29 April 2014
93% v1.93
94% - setting the bottom margin (19mm) without top solves the problem for different
95%   A4/Letter settings. This was already the default in v1.6. Pointed out by
96%   Plamen Hopchev. To accommodate the descenders the bottom margin has been set
97%   to 56pt now.
98%                                                   Volker RW Schaa, 01 May 2014
99%
100% v1.94
101% - the micro sign in UTF-8 prevents ASCII format of the cls file. Ulrike pointed
102%   out a hack in http://tex.stackexchange.com/questions/172968/hide-notation-from-pdftex
103%   which is now introduced.
104%                                                   Volker RW Schaa, 02 May 2014
105%
106% v1.95
107% - only change to the version 1.94 are the extended documenation and license
108%   statement (lppl1.3c) as preparation for publication on CTAN.
109%                                                   Volker RW Schaa, 02 May 2014
110%
111% v1.96
112% - modification of bibatex style information. Since the JACoW template Feb-2016
113%   the bibliography requires the IEEEtran style. Heine provided an adapted
114%   version using the required values of the template:
115%   + ieee biblatex style instead of numeric-compv
116%   + doi field is cleared for all entries
117%   + et al. is used when there are > 6 authors (maxnames=6). In that case,
118%     only the first author is mentioned (minnames=1)
119%   + url field is cleared for articles and inproceedings
120%   + giveninits=true reduces all given names to initials
121%                                            Heine Dølrath Thomsen, 30 June 2016
122%
123% v2.00
124% - after using v1.96 during conferences where DOIs/URLs were present in biblio-
125%   graphic records, the following changes to Heine's version have been made:
126%   + doi field allowed
127%   + url field allowed
128%                                                 Volker RW Schaa, 02 May 2014
129% v2.1 new options introduced
130% flushend: new: keeplastbox
131% siunitx:  new: binary-units=true
132% BibLaTeX: changed: style=ieee => bibstyle=ieee, citestyle=numeric-comp
133%           new: dashed=false
134%           removed: doi=false
135%                                                 Volker RW Schaa, 02 May 2014
136%
137% v2.2
138% - adapted to the changes of template version 2018-02
139% - made this one official
140%                                                  Volker RW Schaa, 23 Feb 2018
141%
142% v2.3
143% - font for tt switched to newtxtt with option zerostyle=d (dotted 0)
144%                                                  Volker RW Schaa, 15 Jan 2019
145%
146% v2.4
147% - version 2.3 did not work for XeTeX/LuaTeX, therefore font change using
148%   \def\UrlFont and switching the fontencoding to T1 (suggested by Ulrike Fischer)
149% - package amsmath included to provide
150%                                                  Volker RW Schaa, 01 Apr 2019
151%
152\def\fileversion{2.4}
153\def\filedate{2019/04/01}
154\def\docdate {2019/04/01}
155
156\NeedsTeXFormat{LaTeX2e}
157\ProvidesClass{jacow}[\filedate\space Version \fileversion]
158
159\typeout{------------------------------------------------------------------------}
160\typeout{LaTeX2e Class file for Accelerator Conference publication for LaTeX2e users}
161\typeout{ }
162\typeout{Use the boxit option to draw a box on page showing the correct margins}
163\typeout{ }
164\typeout{Itemize, Enumerate and Description environments are compact versions}
165\typeout{------------------------------------------------------------------------}
166\typeout{ }
167
168\newif\ifjacowbiblatex
169\newif\ifjacowrefpage
170
171\DeclareOption{acus}{%
172   \PassOptionsToPackage{paper=letterpaper}{geometry}
173   \typeout{Setup for US LETTER PAPER}}
174
175\DeclareOption{letterpaper}{%
176   \PassOptionsToPackage{paper=letterpaper}{geometry}
177   \typeout{Setup for US LETTER PAPER}}
178
179\DeclareOption{a4paper}{%
180    \PassOptionsToPackage{paper=a4paper}{geometry}
181    \typeout{Setup for A4 PAPER}}
182
183\DeclareOption{aca4}{%
184    \PassOptionsToPackage{paper=a4paper}{geometry}
185    \typeout{Setup for A4 PAPER}}
186
187\DeclareOption{boxit}{\PassOptionsToPackage{showframe}{geometry}}
188
189\DeclareOption{biblatex}{\jacowbiblatextrue}
190
191\DeclareOption{refpage}{\jacowrefpagetrue}
192
193\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
194
195\ExecuteOptions{aca4}
196\ProcessOptions
197
198\RequirePackage{fix-cm}
199\LoadClass[10pt,twocolumn]{article}
200\RequirePackage[keeplastbox]{flushend} %% modified
201% Tools:
202\RequirePackage{etoolbox}
203\RequirePackage{ifxetex}
204\RequirePackage{ifluatex}
205\RequirePackage{textcase}
206%
207%Add thanks to the list of "\@nonchangecase"-commands from textcase:
208\def\@uclcnotmath#1#2#3#4{\begingroup
209      #1%
210      \def\({$}\let\)\(%
211      \def\NoCaseChange##1{\noexpand\NoCaseChange{\noexpand##1}}%
212      \@nonchangecase\label
213      \@nonchangecase\ref
214      \@nonchangecase\ensuremath
215      \@nonchangecase\thanks %new
216      \@nonchangecase\si %new
217      \@nonchangecase\SI %new
218      \def\cite##1##{\toks@{\noexpand\cite##1}\@citex}%
219      \def\@citex##1{\NoCaseChange{\the\toks@{##1}}}%
220      \def\reserved@a##1##2{\let#2\reserved@a}%
221      \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}%
222      \protected@edef\reserved@a{\endgroup
223          \noexpand\@skipmath#3#4$\valign$}%
224      \reserved@a}
225
226\RequirePackage[detect-mode,detect-weight, binary-units=true]{siunitx}
227\RequirePackage{graphicx}
228\RequirePackage{booktabs}
229\RequirePackage[figureposition=bottom,tableposition=top,skip=5pt]{caption}
230\RequirePackage{xcolor}
231\RequirePackage{amsmath}
232\AtEndPreamble{\RequirePackage[autostyle]{csquotes}}
233
234
235% Page layout:
236\RequirePackage[%
237  textwidth=170mm,
238  textheight=241mm,
239  heightrounded,
240  left=20mm,
241  bottom=56pt,
242  columnsep=5mm,
243  noheadfoot,
244  nomarginpar,
245  twocolumn]
246  {geometry}
247
248\columnseprule 0pt
249\usepackage[hang]{footmisc}
250\setlength{\footnotemargin}{.6em}
251
252
253\pagestyle{empty}
254
255\RequirePackage{url}
256%
257% redefine the default Typewriter Font to newtxtt with dotted zeros (v2.3)
258%
259\RequirePackage[zerostyle=d]{newtxtt}
260\newcommand\urlZDtxt{\fontencoding{T1}\fontfamily{newtxtt}\selectfont}
261\def\UrlFont{\urlZDtxt}
262
263\ifboolexpr{bool{xetex} or bool{luatex}}
264 {}
265 { \catcode`\^^^=9
266 }
267 
268\ifboolexpr{bool{xetex} or bool{luatex}}
269 { \let\ori@vdots\vdots
270   \RequirePackage{unicode-math}
271   \AtBeginDocument{\let\vdots\ori@vdots}
272   \setmainfont[Ligatures=TeX]{TeX Gyre Termes}
273   \setmathfont{TeX Gyre Termes Math}
274   \sisetup{
275     math-micro = \text{^^^^03bc},
276     text-micro = ^^^^03bc
277      }
278 }
279 {
280  % Fonts: Times clones
281  \RequirePackage{textcomp}
282  \RequirePackage[T1]{fontenc}
283  \RequirePackage{lmodern}
284  \RequirePackage{tgtermes}
285  \RequirePackage{newtxmath}
286  \input{glyphtounicode}
287  \pdfgentounicode=1
288%  \RequirePackage{cmap}
289 }
290
291\RequirePackage{microtype}
292
293%Lists
294
295\RequirePackage{enumitem}
296\newenvironment{Enumerate}{\begin{enumerate}[nosep]}{\end{enumerate}}
297\newenvironment{Itemize}{\begin{itemize}[nosep]}{\end{itemize}}
298\newenvironment{Description}{\begin{description}[nosep]}{\end{description}}
299
300
301%Floatparameter:
302\renewcommand{\topfraction}{.95}
303\renewcommand{\bottomfraction}{.95}
304\renewcommand{\textfraction}{0.1}
305\renewcommand{\floatpagefraction}{0.8}
306
307
308%headings:
309% section: Uppercase only for text
310\renewcommand{\section}
311   {%
312    \@startsection{section}{1}{0mm}
313       {2.0ex plus 0.8ex minus .1ex}{1.0ex plus .2ex}
314       {\normalfont\large\bfseries\mathversion{bold}\centering\MakeTextUppercase}%
315   }%
316
317\renewcommand\subsection
318  {%
319   \@startsection{subsection}{2}{\z@}
320    {1.4ex plus .8ex minus .17ex}{0.8ex plus .17ex}
321    {\normalfont\large\itshape}%
322   }
323
324\renewcommand\subsubsection
325 {%
326  \@startsection{subsubsection}{3}{\parindent}
327  {2.5ex plus .7ex minus .17ex}{-1em}
328  {\normalfont\normalsize\bfseries}%
329 }
330
331\renewcommand\paragraph
332 {%
333  \@startsection{paragraph}{4}{\z@}
334  {2.5ex plus .7ex minus .17ex}{-1em}
335  {\normalfont\normalsize\itshape}%
336 }
337
338\renewcommand\subparagraph
339 {%
340  \@startsection{subparagraph}{4}{\parindent}
341  {2.25ex plus .7ex minus .17ex}{-1em}
342  {\normalfont\normalsize\bfseries}%
343 }
344
345\setcounter{secnumdepth}{0}
346
347% This definition of \maketitle taken from article.sty, and has been
348% somewhat modified.
349
350\def\maketitle{\par
351 \begingroup
352   \def\thefootnote{\fnsymbol{footnote}}
353   \def\@makefnmark{\hbox
354       to 5pt{$^{\@thefnmark}$\hss}}
355   \twocolumn[\@maketitle]
356   \@thanks
357 \endgroup
358 \enlargethispage{\jac@copyrightspace}%
359 \setcounter{footnote}{0}
360 \let\maketitle\relax
361 \let\@maketitle\relax
362 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\thanks\relax}
363
364\newlength{\titleblockheight}       % so user can change it if need be
365\setlength{\titleblockheight}{3.5cm}
366
367\newlength\titleblockstartskip
368\setlength\titleblockstartskip{3pt}
369
370
371\newlength\titleblockmiddleskip
372\setlength\titleblockmiddleskip{1em}
373
374\newlength\titleblockendskip
375\setlength\titleblockendskip{1em}
376
377
378\def\@maketitle{%
379  \vskip \titleblockstartskip \centering
380  {\Large\bfseries \MakeTextUppercase{\@title} \par}
381  \vskip \titleblockmiddleskip               % Vertical space after title.
382  {\large\begin{tabular}[t]{@{}c@{}}\@author \end{tabular}\par}
383  \vskip \titleblockendskip}
384
385
386% The \copyrightspace command is used to produce a blank space in the first
387% column where a copyright notice may go.  It works by producing
388% with \enlargethispage and is inserted by \maketitle.
389% The command should be issued in the preamble.
390
391\newcommand\jac@copyrightspace{0pt}
392\newcommand\copyrightspace[1][1cm]{\renewcommand\jac@copyrightspace{-#1}}
393
394\ifboolexpr{bool{@titlepage}}
395{\renewenvironment{abstract}
396 {\list{}{%
397    \setlength{\leftmargin}{\dimexpr\textwidth/2-0.75\columnwidth}%
398    \setlength{\rightmargin}{\dimexpr-0.75\columnwidth-\columnsep}%
399    \setlength{\listparindent}{\parindent}%
400    \setlength{\itemsep}{\parskip}%
401    \setlength{\itemindent}{\z@}%
402    \setlength{\topsep}{\z@}%
403    \setlength{\parsep}{\parskip}%
404    \setlength{\partopsep}{\z@}%
405    \let\makelabel\@gobble
406    \setlength{\labelwidth}{\z@}%
407    \advance\@listdepth\m@ne   }%
408   \item\relax\subsection*{Abstract}}
409 {\endlist\clearpage}
410}
411{%
412 \renewenvironment{abstract}
413  {\subsection*{Abstract}}
414  {\par}
415}
416\ifboolexpr{bool{jacowbiblatex}}
417%2.00 {\RequirePackage[style=ieee,sorting=none,giveninits=true,doi=false,maxnames=6,minnames=1]{biblatex}
418%2.1 {\RequirePackage[style=ieee,sorting=none,giveninits=true,maxnames=6,minnames=1]{biblatex}
419%2.2
420  {\RequirePackage[bibstyle=ieee,citestyle=numeric-comp,dashed=false,sorting=none,giveninits=true,maxnames=6,minnames=1]{biblatex}
421  \renewbibmacro*{url+urldate}{%
422    \iffieldundef{url}
423     {}
424     {\printfield{url}%
425      \nopunct}}%
426  \DeclareFieldFormat{url}{\url{#1}}
427  \DeclareFieldFormat{eprint}{#1}
428%% when to activate this? Paper format acus/letter
429%  \DefineBibliographyExtras{american}{\stdpunctuation} % mod
430  % Drop urls for article and inproceedings entries
431%2.00  \DeclareFieldFormat
432%2.00  [article,inproceedings]
433%2.00  {url}{}
434  %
435  \setlength\bibitemsep{0pt}
436  \setlength\bibparsep{0pt}
437  \setlength\biblabelsep{5pt}
438  \ifjacowrefpage\preto\blx@bibliography{\clearpage}\fi
439  \AtBeginBibliography{\small\clubpenalty4000\widowpenalty4000}%
440 }
441 {\RequirePackage{cite}
442  % Redefine to use smaller fonts
443  \def\thebibliography#1{\setlength{\itemsep}{0pt}\setlength{\parsep}{0pt}%
444  \ifjacowrefpage\clearpage\fi
445  \section*{REFERENCES\@mkboth
446  {REFERENCES}{REFERENCES}}\small\list
447  {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
448    \advance\leftmargin\labelsep
449    \usecounter{enumi}}
450    \def\newblock{\hskip .11em plus .33em minus .07em}
451    \sloppy\clubpenalty4000\widowpenalty4000
452    \sfcode`\.=1000\relax}
453   \let\endthebibliography=\endlist
454  }
455
456
457%\sloppy
458\clubpenalty10000\widowpenalty10000
459\flushbottom
460%-----------------------------------------------------------------------
461
462%avoid bug of fixltx2e:
463%http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/4023
464\RequirePackage{fixltx2e}%
465\def\@outputdblcol{%
466  \if@firstcolumn
467    \global\@firstcolumnfalse
468    \global\setbox\@leftcolumn\copy\@outputbox
469    \splitmaxdepth\maxdimen
470    \vbadness\maxdimen
471    \setbox\@outputbox\vbox{\unvbox\@outputbox\unskip}%new
472    \setbox\@outputbox\vsplit\@outputbox to\maxdimen
473    \toks@\expandafter{\topmark}%
474    \xdef\@firstcoltopmark{\the\toks@}%
475    \toks@\expandafter{\splitfirstmark}%
476    \xdef\@firstcolfirstmark{\the\toks@}%
477    \ifx\@firstcolfirstmark\@empty
478      \global\let\@setmarks\relax
479    \else
480      \gdef\@setmarks{%
481        \let\firstmark\@firstcolfirstmark
482        \let\topmark\@firstcoltopmark}%
483    \fi
484  \else
485    \global\@firstcolumntrue
486    \setbox\@outputbox\vbox{%
487     \hb@xt@\textwidth{%
488        \hb@xt@\columnwidth{\box\@leftcolumn \hss}%
489        \hfil
490        \vrule \@width\columnseprule
491        \hfil
492       \hb@xt@\columnwidth{\box\@outputbox \hss}}}%
493  \@combinedblfloats
494    \@setmarks
495    \@outputpage
496    \begingroup
497      \@dblfloatplacement
498      \@startdblcolumn
499      \@whilesw\if@fcolmade \fi{\@outputpage\@startdblcolumn}%
500    \endgroup
501  \fi}
502
503\endinput
Note: See TracBrowser for help on using the repository browser.