~ubuntu-branches/debian/sid/simpleitk/sid

« back to all changes in this revision

Viewing changes to Wrapping/R/Packaging/SimpleITK/vignettes/jss.cls

  • Committer: Package Import Robot
  • Author(s): Ghislain Antony Vaillant
  • Date: 2017-11-02 08:49:18 UTC
  • Revision ID: package-import@ubuntu.com-20171102084918-7hs09ih668xq87ej
Tags: upstream-1.0.1
ImportĀ upstreamĀ versionĀ 1.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%
 
2
%% This is file `jss.cls',
 
3
\def\fileversion{2.0}
 
4
\def\filename{jss}
 
5
\def\filedate{2009/09/24}
 
6
%%
 
7
%% Package `jss' to use with LaTeX2e for JSS publications (http://www.jstatsoft.org/)
 
8
%% License: GPL-2
 
9
%% Copyright: (C) Achim Zeileis
 
10
%% Please report errors to Achim.Zeileis@R-project.org
 
11
%%
 
12
\NeedsTeXFormat{LaTeX2e}
 
13
\ProvidesClass{jss}[\filedate\space\fileversion\space jss class by Achim Zeileis]
 
14
%% options
 
15
\newif\if@article
 
16
\newif\if@codesnippet
 
17
\newif\if@bookreview
 
18
\newif\if@softwarereview
 
19
\newif\if@review
 
20
\newif\if@shortnames
 
21
\newif\if@nojss
 
22
\newif\if@notitle
 
23
\newif\if@noheadings
 
24
 
 
25
\@articletrue
 
26
\@codesnippetfalse
 
27
\@bookreviewfalse
 
28
\@softwarereviewfalse
 
29
\@reviewfalse
 
30
\@shortnamesfalse
 
31
\@nojssfalse
 
32
\@notitlefalse
 
33
\@noheadingsfalse
 
34
 
 
35
\DeclareOption{article}{\@articletrue%
 
36
  \@codesnippetfalse \@bookreviewfalse \@softwarereviewfalse}
 
37
\DeclareOption{codesnippet}{\@articlefalse%
 
38
  \@codesnippettrue \@bookreviewfalse \@softwarereviewfalse}
 
39
\DeclareOption{bookreview}{\@articlefalse%
 
40
  \@codesnippetfalse \@bookreviewtrue \@softwarereviewfalse}
 
41
\DeclareOption{softwarereview}{\@articlefalse%
 
42
  \@codesnippetfalse \@bookreviewfalse \@softwarereviewtrue}
 
43
\DeclareOption{shortnames}{\@shortnamestrue}
 
44
\DeclareOption{nojss}{\@nojsstrue}
 
45
\DeclareOption{notitle}{\@notitletrue}
 
46
\DeclareOption{noheadings}{\@noheadingstrue}
 
47
 
 
48
\ProcessOptions
 
49
\LoadClass[11pt,a4paper,twoside]{article}
 
50
%% required packages
 
51
\RequirePackage{graphicx,a4wide,color,ae,fancyvrb}
 
52
\RequirePackage[T1]{fontenc}
 
53
\IfFileExists{upquote.sty}{\RequirePackage{upquote}}{}
 
54
%% bibliography
 
55
\if@shortnames
 
56
  \usepackage[authoryear,round]{natbib}
 
57
\else
 
58
  \usepackage[authoryear,round,longnamesfirst]{natbib}
 
59
\fi
 
60
\bibpunct{(}{)}{;}{a}{}{,}
 
61
\bibliographystyle{jss}
 
62
%% paragraphs
 
63
\setlength{\parskip}{0.7ex plus0.1ex minus0.1ex}
 
64
\setlength{\parindent}{0em}
 
65
%% for all publications
 
66
\newcommand{\Address}[1]{\def\@Address{#1}}
 
67
\newcommand{\Plaintitle}[1]{\def\@Plaintitle{#1}}
 
68
\newcommand{\Shorttitle}[1]{\def\@Shorttitle{#1}}
 
69
\newcommand{\Plainauthor}[1]{\def\@Plainauthor{#1}}
 
70
\newcommand{\Volume}[1]{\def\@Volume{#1}}
 
71
\newcommand{\Year}[1]{\def\@Year{#1}}
 
72
\newcommand{\Month}[1]{\def\@Month{#1}}
 
73
\newcommand{\Issue}[1]{\def\@Issue{#1}}
 
74
\newcommand{\Submitdate}[1]{\def\@Submitdate{#1}}
 
75
%% for articles and code snippets
 
76
\newcommand{\Acceptdate}[1]{\def\@Acceptdate{#1}}
 
77
\newcommand{\Abstract}[1]{\def\@Abstract{#1}}
 
78
\newcommand{\Keywords}[1]{\def\@Keywords{#1}}
 
79
\newcommand{\Plainkeywords}[1]{\def\@Plainkeywords{#1}}
 
80
%% for book and software reviews
 
81
\newcommand{\Reviewer}[1]{\def\@Reviewer{#1}}
 
82
\newcommand{\Booktitle}[1]{\def\@Booktitle{#1}}
 
83
\newcommand{\Bookauthor}[1]{\def\@Bookauthor{#1}}
 
84
\newcommand{\Publisher}[1]{\def\@Publisher{#1}}
 
85
\newcommand{\Pubaddress}[1]{\def\@Pubaddress{#1}}
 
86
\newcommand{\Pubyear}[1]{\def\@Pubyear{#1}}
 
87
\newcommand{\ISBN}[1]{\def\@ISBN{#1}}
 
88
\newcommand{\Pages}[1]{\def\@Pages{#1}}
 
89
\newcommand{\Price}[1]{\def\@Price{#1}}
 
90
\newcommand{\Plainreviewer}[1]{\def\@Plainreviewer{#1}}
 
91
\newcommand{\Softwaretitle}[1]{\def\@Softwaretitle{#1}}
 
92
\newcommand{\URL}[1]{\def\@URL{#1}}
 
93
%% for internal use
 
94
\newcommand{\Seriesname}[1]{\def\@Seriesname{#1}}
 
95
\newcommand{\Hypersubject}[1]{\def\@Hypersubject{#1}}
 
96
\newcommand{\Hyperauthor}[1]{\def\@Hyperauthor{#1}}
 
97
\newcommand{\Footername}[1]{\def\@Footername{#1}}
 
98
\newcommand{\Firstdate}[1]{\def\@Firstdate{#1}}
 
99
\newcommand{\Seconddate}[1]{\def\@Seconddate{#1}}
 
100
\newcommand{\Reviewauthor}[1]{\def\@Reviewauthor{#1}}
 
101
%% defaults
 
102
\author{Firstname Lastname\\Affiliation}
 
103
\title{Title}
 
104
\Abstract{---!!!---an abstract is required---!!!---}
 
105
\Plainauthor{\@author}
 
106
\Volume{VV}
 
107
\Year{YYYY}
 
108
\Month{MMMMMM}
 
109
\Issue{II}
 
110
\Submitdate{yyyy-mm-dd}
 
111
\Acceptdate{yyyy-mm-dd}
 
112
\Address{
 
113
  Firstname Lastname\\
 
114
  Affiliation\\
 
115
  Address, Country\\
 
116
  E-mail: \email{name@address}\\
 
117
  URL: \url{http://link/to/webpage/}
 
118
}
 
119
 
 
120
\Reviewer{Firstname Lastname\\Affiliation}
 
121
\Plainreviewer{Firstname Lastname}
 
122
\Booktitle{Book Title}
 
123
\Bookauthor{Book Author}
 
124
\Publisher{Publisher}
 
125
\Pubaddress{Publisher's Address}
 
126
\Pubyear{YYY}
 
127
\ISBN{x-xxxxx-xxx-x}
 
128
\Pages{xv + 123}
 
129
\Price{USD 69.95 (P)}
 
130
\URL{http://link/to/webpage/}
 
131
\if@article
 
132
  \Seriesname{Issue}
 
133
  \Hypersubject{Journal of Statistical Software}
 
134
  \Plaintitle{\@title}
 
135
  \Shorttitle{\@title}
 
136
  \Plainkeywords{\@Keywords}
 
137
\fi
 
138
 
 
139
\if@codesnippet
 
140
  \Seriesname{Code Snippet}
 
141
  \Hypersubject{Journal of Statistical Software -- Code Snippets}
 
142
  \Plaintitle{\@title}
 
143
  \Shorttitle{\@title}
 
144
  \Plainkeywords{\@Keywords}
 
145
\fi
 
146
 
 
147
\if@bookreview
 
148
  \Seriesname{Book Review}
 
149
  \Hypersubject{Journal of Statistical Software -- Book Reviews}
 
150
  \Plaintitle{\@Booktitle}
 
151
  \Shorttitle{\@Booktitle}
 
152
  \Reviewauthor{\@Bookauthor\\
 
153
                \@Publisher, \@Pubaddress, \@Pubyear.\\
 
154
                ISBN~\@ISBN. \@Pages~pp. \@Price.\\
 
155
                \url{\@URL}}
 
156
  \Plainkeywords{}
 
157
  \@reviewtrue
 
158
\fi
 
159
 
 
160
\if@softwarereview
 
161
  \Seriesname{Software Review}
 
162
  \Hypersubject{Journal of Statistical Software -- Software Reviews}
 
163
  \Plaintitle{\@Softwaretitle}
 
164
  \Shorttitle{\@Softwaretitle}
 
165
  \Booktitle{\@Softwaretitle}
 
166
  \Reviewauthor{\@Publisher, \@Pubaddress. \@Price.\\
 
167
                \url{\@URL}}
 
168
  \Plainkeywords{}
 
169
  \@reviewtrue
 
170
\fi
 
171
 
 
172
\if@review
 
173
  \Hyperauthor{\@Plainreviewer}
 
174
  \Keywords{}
 
175
  \Footername{Reviewer}
 
176
  \Firstdate{\textit{Published:} \@Submitdate}
 
177
  \Seconddate{}
 
178
\else
 
179
  \Hyperauthor{\@Plainauthor}
 
180
  \Keywords{---!!!---at least one keyword is required---!!!---}
 
181
  \Footername{Affiliation}
 
182
  \Firstdate{\textit{Submitted:} \@Submitdate}
 
183
  \Seconddate{\textit{Accepted:} \@Acceptdate}
 
184
\fi
 
185
%% Sweave(-like)
 
186
\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl}
 
187
\DefineVerbatimEnvironment{Soutput}{Verbatim}{}
 
188
\DefineVerbatimEnvironment{Scode}{Verbatim}{fontshape=sl}
 
189
\newenvironment{Schunk}{}{}
 
190
\DefineVerbatimEnvironment{Code}{Verbatim}{}
 
191
\DefineVerbatimEnvironment{CodeInput}{Verbatim}{fontshape=sl}
 
192
\DefineVerbatimEnvironment{CodeOutput}{Verbatim}{}
 
193
\newenvironment{CodeChunk}{}{}
 
194
\setkeys{Gin}{width=0.8\textwidth}
 
195
%% footer
 
196
\newlength{\footerskip}
 
197
\setlength{\footerskip}{2.5\baselineskip plus 2ex minus 0.5ex}
 
198
 
 
199
\newcommand{\makefooter}{%
 
200
  \vspace{\footerskip}
 
201
 
 
202
  \if@nojss
 
203
    \begin{samepage}
 
204
    \textbf{\large \@Footername: \nopagebreak}\\[.3\baselineskip] \nopagebreak
 
205
    \@Address \nopagebreak
 
206
    \end{samepage}
 
207
  \else
 
208
    \begin{samepage}
 
209
    \textbf{\large \@Footername: \nopagebreak}\\[.3\baselineskip] \nopagebreak
 
210
    \@Address \nopagebreak
 
211
    \vfill
 
212
    \hrule \nopagebreak
 
213
    \vspace{.1\baselineskip}
 
214
    {\fontfamily{pzc} \fontsize{13}{15} \selectfont Journal of Statistical Software}
 
215
    \hfill
 
216
    \url{http://www.jstatsoft.org/}\\ \nopagebreak
 
217
    published by the American Statistical Association
 
218
    \hfill
 
219
    \url{http://www.amstat.org/}\\[.3\baselineskip] \nopagebreak
 
220
    {Volume~\@Volume, \@Seriesname~\@Issue}
 
221
    \hfill
 
222
    \@Firstdate\\ \nopagebreak
 
223
    {\@Month{} \@Year}
 
224
    \hfill
 
225
    \@Seconddate  \nopagebreak
 
226
    \vspace{.3\baselineskip}
 
227
    \hrule
 
228
    \end{samepage}
 
229
  \fi
 
230
}
 
231
\AtEndDocument{\makefooter}
 
232
%% required packages
 
233
\RequirePackage{hyperref}
 
234
%% new \maketitle
 
235
\def\@myoddhead{
 
236
  {\color{white} JSS}\\[-1.42cm]
 
237
  \hspace{-2em} \includegraphics[height=23mm,keepaspectratio]{jsslogo} \hfill
 
238
  \parbox[b][23mm]{118mm}{\hrule height 3pt
 
239
   \center{
 
240
   {\fontfamily{pzc} \fontsize{28}{32} \selectfont Journal of Statistical Software}
 
241
   \vfill
 
242
   {\it \small \@Month{} \@Year, Volume~\@Volume, \@Seriesname~\@Issue.%
 
243
            \hfill \href{http://www.jstatsoft.org/}{http://www.jstatsoft.org/}}}\\[0.1cm]
 
244
     \hrule height 3pt}}
 
245
\if@review
 
246
  \renewcommand{\maketitle}{
 
247
  \if@nojss
 
248
    %% \@oddhead{\@myoddhead}\\[3\baselineskip]
 
249
  \else
 
250
    \@oddhead{\@myoddhead}\\[3\baselineskip]
 
251
  \fi
 
252
    {\large
 
253
    \noindent
 
254
    Reviewer: \@Reviewer
 
255
    \vspace{\baselineskip}
 
256
    \hrule
 
257
    \vspace{\baselineskip}
 
258
    \textbf{\@Booktitle}
 
259
    \begin{quotation} \noindent
 
260
    \@Reviewauthor
 
261
    \end{quotation}
 
262
    \vspace{0.7\baselineskip}
 
263
    \hrule
 
264
    \vspace{1.3\baselineskip}
 
265
    }
 
266
 
 
267
    \thispagestyle{empty}
 
268
    \if@nojss
 
269
      \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hyperauthor}}
 
270
    \else
 
271
      \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hypersubject}}
 
272
    \fi
 
273
    \pagestyle{myheadings}
 
274
  }
 
275
\else
 
276
  \def\maketitle{
 
277
  \if@nojss
 
278
    %% \@oddhead{\@myoddhead} \par
 
279
  \else
 
280
    \@oddhead{\@myoddhead} \par
 
281
  \fi
 
282
   \begingroup
 
283
     \def\thefootnote{\fnsymbol{footnote}}
 
284
     \def\@makefnmark{\hbox to 0pt{$^{\@thefnmark}$\hss}}
 
285
     \long\def\@makefntext##1{\parindent 1em\noindent
 
286
                              \hbox to1.8em{\hss $\m@th ^{\@thefnmark}$}##1}
 
287
     \@maketitle \@thanks
 
288
   \endgroup
 
289
   \setcounter{footnote}{0}
 
290
 
 
291
   \if@noheadings
 
292
    %% \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hypersubject}}
 
293
    \else
 
294
     \thispagestyle{empty}
 
295
      \if@nojss
 
296
        \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hyperauthor}}
 
297
      \else
 
298
        \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hypersubject}}
 
299
      \fi
 
300
     \pagestyle{myheadings}
 
301
   \fi
 
302
 
 
303
   \let\maketitle\relax \let\@maketitle\relax
 
304
   \gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\thanks\relax
 
305
  }
 
306
 
 
307
  \def\@maketitle{\vbox{\hsize\textwidth \linewidth\hsize
 
308
  \if@nojss
 
309
    %% \vskip 1in
 
310
  \else
 
311
    \vskip 1in
 
312
  \fi
 
313
   {\centering
 
314
   {\LARGE\bf \@title\par}
 
315
   \vskip 0.2in plus 1fil minus 0.1in
 
316
   {
 
317
       \def\and{\unskip\enspace{\rm and}\enspace}%
 
318
       \def\And{\end{tabular}\hss \egroup \hskip 1in plus 2fil
 
319
          \hbox to 0pt\bgroup\hss \begin{tabular}[t]{c}\large\bf\rule{\z@}{24pt}\ignorespaces}%
 
320
       \def\AND{\end{tabular}\hss\egroup \hfil\hfil\egroup
 
321
          \vskip 0.1in plus 1fil minus 0.05in
 
322
          \hbox to \linewidth\bgroup\rule{\z@}{10pt} \hfil\hfil
 
323
          \hbox to 0pt\bgroup\hss \begin{tabular}[t]{c}\large\bf\rule{\z@}{24pt}\ignorespaces}
 
324
       \hbox to \linewidth\bgroup\rule{\z@}{10pt} \hfil\hfil
 
325
       \hbox to 0pt\bgroup\hss \begin{tabular}[t]{c}\large\bf\rule{\z@}{24pt}\@author
 
326
       \end{tabular}\hss\egroup
 
327
   \hfil\hfil\egroup}
 
328
   \vskip 0.3in minus 0.1in
 
329
   \hrule
 
330
   \begin{abstract}
 
331
   \@Abstract
 
332
   \end{abstract}}
 
333
   \textit{Keywords}:~\@Keywords.
 
334
   \vskip 0.1in minus 0.05in
 
335
   \hrule
 
336
   \vskip 0.2in minus 0.1in
 
337
  }}
 
338
\fi
 
339
%% sections, subsections, and subsubsections
 
340
\newlength{\preXLskip}
 
341
\newlength{\preLskip}
 
342
\newlength{\preMskip}
 
343
\newlength{\preSskip}
 
344
\newlength{\postMskip}
 
345
\newlength{\postSskip}
 
346
\setlength{\preXLskip}{1.8\baselineskip plus 0.5ex minus 0ex}
 
347
\setlength{\preLskip}{1.5\baselineskip plus 0.3ex minus 0ex}
 
348
\setlength{\preMskip}{1\baselineskip plus 0.2ex minus 0ex}
 
349
\setlength{\preSskip}{.8\baselineskip plus 0.2ex minus 0ex}
 
350
\setlength{\postMskip}{.5\baselineskip plus 0ex minus 0.1ex}
 
351
\setlength{\postSskip}{.3\baselineskip plus 0ex minus 0.1ex}
 
352
 
 
353
\newcommand{\jsssec}[2][default]{\vskip \preXLskip%
 
354
  \pdfbookmark[1]{#1}{Section.\thesection.#1}%
 
355
  \refstepcounter{section}%
 
356
  \centerline{\textbf{\Large \thesection. #2}} \nopagebreak
 
357
  \vskip \postMskip \nopagebreak}
 
358
\newcommand{\jsssecnn}[1]{\vskip \preXLskip%
 
359
  \centerline{\textbf{\Large #1}} \nopagebreak
 
360
  \vskip \postMskip \nopagebreak}
 
361
 
 
362
\newcommand{\jsssubsec}[2][default]{\vskip \preMskip%
 
363
  \pdfbookmark[2]{#1}{Subsection.\thesubsection.#1}%
 
364
  \refstepcounter{subsection}%
 
365
  \textbf{\large \thesubsection. #2} \nopagebreak
 
366
  \vskip \postSskip \nopagebreak}
 
367
\newcommand{\jsssubsecnn}[1]{\vskip \preMskip%
 
368
  \textbf{\large #1} \nopagebreak
 
369
  \vskip \postSskip \nopagebreak}
 
370
 
 
371
\newcommand{\jsssubsubsec}[2][default]{\vskip \preSskip%
 
372
  \pdfbookmark[3]{#1}{Subsubsection.\thesubsubsection.#1}%
 
373
  \refstepcounter{subsubsection}%
 
374
  {\large \textit{#2}} \nopagebreak
 
375
  \vskip \postSskip \nopagebreak}
 
376
\newcommand{\jsssubsubsecnn}[1]{\vskip \preSskip%
 
377
  {\textit{\large #1}} \nopagebreak
 
378
  \vskip \postSskip \nopagebreak}
 
379
 
 
380
\newcommand{\jsssimplesec}[2][default]{\vskip \preLskip%
 
381
%%  \pdfbookmark[1]{#1}{Section.\thesection.#1}%
 
382
  \refstepcounter{section}%
 
383
  \textbf{\large #1} \nopagebreak
 
384
  \vskip \postSskip \nopagebreak}
 
385
\newcommand{\jsssimplesecnn}[1]{\vskip \preLskip%
 
386
  \textbf{\large #1} \nopagebreak
 
387
  \vskip \postSskip \nopagebreak}
 
388
 
 
389
\if@review
 
390
  \renewcommand{\section}{\secdef \jsssimplesec \jsssimplesecnn}
 
391
  \renewcommand{\subsection}{\secdef \jsssimplesec \jsssimplesecnn}
 
392
  \renewcommand{\subsubsection}{\secdef \jsssimplesec \jsssimplesecnn}
 
393
\else
 
394
  \renewcommand{\section}{\secdef \jsssec \jsssecnn}
 
395
  \renewcommand{\subsection}{\secdef \jsssubsec \jsssubsecnn}
 
396
  \renewcommand{\subsubsection}{\secdef \jsssubsubsec \jsssubsubsecnn}
 
397
\fi
 
398
%% colors
 
399
\definecolor{Red}{rgb}{0.5,0,0}
 
400
\definecolor{Blue}{rgb}{0,0,0.5}
 
401
\if@review
 
402
  \hypersetup{%
 
403
    hyperindex = {true},
 
404
    colorlinks = {true},
 
405
    linktocpage = {true},
 
406
    plainpages = {false},
 
407
    linkcolor = {Blue},
 
408
    citecolor = {Blue},
 
409
    urlcolor = {Red},
 
410
    pdfstartview = {Fit},
 
411
    pdfpagemode = {None},
 
412
    pdfview = {XYZ null null null}
 
413
  }
 
414
\else
 
415
  \hypersetup{%
 
416
    hyperindex = {true},
 
417
    colorlinks = {true},
 
418
    linktocpage = {true},
 
419
    plainpages = {false},
 
420
    linkcolor = {Blue},
 
421
    citecolor = {Blue},
 
422
    urlcolor = {Red},
 
423
    pdfstartview = {Fit},
 
424
    pdfpagemode = {UseOutlines},
 
425
    pdfview = {XYZ null null null}
 
426
  }
 
427
\fi
 
428
\if@nojss
 
429
  \AtBeginDocument{
 
430
    \hypersetup{%
 
431
      pdfauthor = {\@Hyperauthor},
 
432
      pdftitle = {\@Plaintitle},
 
433
      pdfkeywords = {\@Plainkeywords}
 
434
    }
 
435
  }
 
436
\else
 
437
  \AtBeginDocument{
 
438
    \hypersetup{%
 
439
      pdfauthor = {\@Hyperauthor},
 
440
      pdftitle = {\@Plaintitle},
 
441
      pdfsubject = {\@Hypersubject},
 
442
      pdfkeywords = {\@Plainkeywords}
 
443
    }
 
444
  }
 
445
\fi
 
446
\if@notitle
 
447
  %% \AtBeginDocument{\maketitle}
 
448
\else
 
449
  \AtBeginDocument{\maketitle}
 
450
\fi
 
451
%% commands
 
452
\makeatletter
 
453
\newcommand\code{\bgroup\@makeother\_\@makeother\~\@makeother\$\@codex}
 
454
\def\@codex#1{{\normalfont\ttfamily\hyphenchar\font=-1 #1}\egroup}
 
455
\makeatother
 
456
%%\let\code=\texttt
 
457
\let\proglang=\textsf
 
458
\newcommand{\pkg}[1]{{\fontseries{b}\selectfont #1}}
 
459
\newcommand{\email}[1]{\href{mailto:#1}{\normalfont\texttt{#1}}}
 
460
\newcommand{\doi}[1]{\href{http://dx.doi.org/#1}{\normalfont\texttt{doi:#1}}}
 
461
\newcommand{\E}{\mathsf{E}}
 
462
\newcommand{\VAR}{\mathsf{VAR}}
 
463
\newcommand{\COV}{\mathsf{COV}}
 
464
\newcommand{\Prob}{\mathsf{P}}
 
465
\endinput
 
466
%%
 
467
%% End of file `jss.cls'.