summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/iaria/iaria.dtx
blob: 8d8d394d0990b8df4de07c9e75ab49a40304e507 (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
%\iffalse
% iaria.dtx generated using makedtx version 1.2 (c) Nicola Talbot
% Command line args:
%   -setambles ".*=>\nopreamble"
%   -dir "src"
%   -src "(iaria.cls)=>\1"
%   -date "2023-2024"
%   -author "Christoph P. Neumann "
%   -macrocode ".*"
%   -preamble "Copyright 2024 Christoph P. Neumann    This work may be distributed and/or modified under the  conditions of the LaTeX Project Public License, either version 1.3  of this license or any later version.  The latest version of this license is in  https://www.latex-project.org/lppl.txt  and version 1.3c or later is part of all distributions of LaTeX  version 2008 or later.    This work has the LPPL maintenance status «maintained».    The Current Maintainer of this work is Christoph P. Neumann. "
%   -doc "doc/iaria.tex"
%   iaria
% Created on 2024/3/20 15:50
%\fi
%\iffalse
%<*package>
%% \CharacterTable
%%  {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
%%   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
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%</package>
%\fi
% \iffalse
% Doc-Source file to use with LaTeX2e
% Copyright (C) 2023-2024 Christoph P. Neumann , all rights reserved.
% \fi
% \iffalse
%<*driver>
%%
%% Copyright 2023 Christoph P. Neumann
%%
%% This LaTeX class provides a simple interface for creating
%% a verfy fancy Curriculum Vitae. At the moment only CVs in
%% the german language are supported.
%%
%% This file is free property; as a special exception the author
%% gives unlimited permission to copy and/or distribute it, with
%% or without modifications, as long as this notice is
%% preserved.
%%
%% This file is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY, to the extent permitted by law;
%% without even the implied warranty of MERCHANTABILITY or
%% FITNESS FOR A PARTICULAR PURPOSE.

\documentclass{ltxdoc}

\CodelineNumbered
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\GetFileInfo{iaria.cls}

\parskip1.0ex
\parindent0.0ex

\begin{document}
\DocInput{iaria.dtx}
\end{document}
%</driver>
%\fi
%\title{\textsf{iaria}\\
%An Unofficial IARIA LaTeX Class}
%\author{Christoph P.\ Neumann \texttt{$<$cyberpetaneuron@gmail.com$>$}}
%\maketitle
%\PrintChanges
%
%\begin{abstract}
%The \texttt{iaria}--class provides a convenient environment for writing IARIA scholary publications.
%This version also implements full IARIA specifications for citation style,
%which can only be templated for a specific technological combination like latex/pdflatex in combination with biblatex using a biber backend.
%\end{abstract}
%
%\section{Installation}
%
%The \texttt{zip} or \texttt{tar.gz} file comes with a \texttt{iaria.ins}
%and a \texttt{iaria.dtx} file included which contains the \LaTeX\ stuff.
%
%To extract the class files call:
%
%\begin{verbatim}
%  $ latex iaria.ins
%\end{verbatim}
%
%This call will extract all \LaTeX\ specific files to the current
%directory. You can either use the files for a single
%cv project or you can integrate the files into your \TeX\ installation.
%
%If you just want to use \textsf{iaria} for a single curriculum vitae
%project, the simplest way is just to copy the generated files to the
%folder of the project.
%
%If you want to integrate \textsf{iaria} into  your \TeX\ installation,
%create a directory \texttt{tex/latex/iaria} beneath your \TeX\ installation
%(e.g.~beneath \texttt{/usr/share/texmf}) and copy all files from the
%current directory there. Now call:
%
%\begin{verbatim}
%  $ mktexlsr
%\end{verbatim}
%
%to update the file--cache of \LaTeX.
%
%Hint: The \textsf{iaria} distribution contains a sample docstrip configuration
%in \texttt{docstrip.cfg} via which files can be distributed
%automatically to their correct positions inside a \LaTeX\ installation.
%Feel free to adapt this file to your environment and afterwards call
%\texttt{latex iaria.ins} to install the package to its right place.
%
%\section{Templates}
%
%For a quick start the \textsf{iaria-lite} distribution contains document
%templates.
%The templates can be found in the \texttt{iaria-example-neumann.zip} file.
%
%\section{Documentclass}
%
%\DescribeMacro{documentclass iaria}
%This package provides the documentclass \texttt{iaria}. The documentclass
%supports the following options:
%
%
%\begin{itemize}
%\item |conference| Passed to IEEEtran
%\item |a4paper|    Passed to IEEEtran
%\item |flushend|   Activate flushend package
%\item |pbalance|   Activate pbalance package
%\end{itemize}
%
%\section{Requirements}
%
%We instrument several other \LaTeX\ packages for different purposes,
%which must be available under your installation.
%
%\begin{itemize}
%\item IEEEtran
%\item biblatex
%\item extdash
%\item flushend
%\item fontenc
%\item graphicx
%\item hyperref
%\item inputenc
%\item orcidlink
%\item pbalance
%\item times
%\item url
%\item xcolor
%\item xpatch
%\end{itemize}
%
%
%\StopEventually{}
%\section{The Code}
%\iffalse
%    \begin{macrocode}
%<*iaria.cls>
%    \end{macrocode}
%\fi
%    \begin{macrocode}
%# Copyright (c) 2023 Christoph P. Neumann,  

% !TeX spellcheck = en-US
% LTeX: language=en-US
% !TeX encoding = utf8
% !TeX program = pdflatex
% !BIB program = biblatex / biber

%# DISCLAIMER: Only for latex/pdflatex in combination with biblatex using a biber backend.
%# (And neither for XeLaTeX or LuaTeX nor for bibtex or natbib.)
%# Because to set the required bibliography configuration, the biblatex package needs to be loaded.
%# I also need to adjust formatting of ONLINE entries, thus, I have to make some assumptions to rely on.
%# And inputenc must be loaded before biblatex.
%# Thus, inputenc, fontenc and biblatex with backend=biber are hard coded part of this template.
%# I could remove these from the cls and make this part of the example.tex, but then it would be less foolproof in my opinion.
%# I apologize for this opinionated design decission to anyone who is jeopardised by it.
%#
%# I also had to decide whether to hardcode required usage of IEEEtran "conference" option into my class.
%# I decided against it.
%# Thus, it is required to use IARIA class like this: \documentclass[conference]{iaria}.
%# The iaria class passes all class options (like "conference") to IEEEtran.
%# The reasoning: There might be a future use case (speculatively) to pass IEEEtran options like "a4paper", for IARIA purposes (?)
%# For now, IARIA requires IEEE "conference" option, only.

% Declare that this document class file requires at least LaTeX version 2e.
\NeedsTeXFormat{LaTeX2e}

% Provide the name of your document class, the date it was last updated, and a comment about what it's used for
\ProvidesClass{iaria}[2023/01/01 unofficial IARIA conference template]

% Define marker counter for options (counter are global in latex):
\newcounter{iaria@pbalancetracker}
\newcounter{iaria@flushendtracker}

% Declare options:
\DeclareOption{onecolumn}{\OptionNotUsed} % IEEE option onecolumn will be ignored

\DeclareOption{pbalance}{
  \setcounter{iaria@pbalancetracker}{1}
  \typeout{iaria class: pbalance option is set.}
}
\DeclareOption{flushend}{
  \setcounter{iaria@flushendtracker}{1}
  \typeout{iaria class: flushend option is set.}
}

% We'll pass any document class options along to the underlying class
\DeclareOption*{%
  \PassOptionsToClass{\CurrentOption}{IEEEtran}% required IEEE options: conference (for IARIA purposes)
}

% Now we'll execute any options passed in
\ProcessOptions\relax

% Instead of defining each and every little detail required to create a new document class,
% you can base your class on an existing document class.
\LoadClass{IEEEtran}

% Now paste your code from the preamble here.
% Replace \usepackage with \RequirePackage. (The syntax for both commands is the same.)

\RequirePackage{times} % Times New Roman

% inputenc must be loaded before biblatex
\RequirePackage[utf8]{inputenc}

% https://tex.stackexchange.com/questions/664/why-should-i-use-RequirePackaget1fontenc
% Has to be loaded AFTER any font packages. See https://tex.stackexchange.com/a/2869/9075.
\RequirePackage[T1]{fontenc}

\RequirePackage{graphicx}
\RequirePackage{xcolor}

\RequirePackage{url}
\RequirePackage{orcidlink}
\RequirePackage{hyperref}
\hypersetup{hidelinks,unicode}

% Diferring from IEEE, IARIA requires 
% in bibliography: 6+ authors as first author et al.
% in \citeauthor: any case of et al. with just first author et al.
\RequirePackage[style=ieee, backend=biber, url=false, hyperref, maxnames=5, minnames=1, maxcitenames=2, mincitenames=1]{biblatex}
\renewcommand*{\bibfont}{\small}

% Diferring from IEEE, IARIA requires, for ONLINE entries, no  point but a comma between author and title:
% For style=ieee
\DeclareBibliographyDriver{online}{%
    \usebibmacro{bibindex}%
    \usebibmacro{begentry}%
    \usebibmacro{author/editor+others/translator+others}
    \setunit{\labelnamepunct}\newblock
    \usebibmacro{title}%
    \newunit
    \printlist{language}%
    \newunit\newblock
    \usebibmacro{byauthor}%
    \newunit\newblock
    \usebibmacro{byeditor+others}%
    \newunit\newblock
    \printfield{version}%
    \newunit
    \printfield{note}%
    \newunit\newblock
    \printlist{organization}
    \newunit\newblock
    \usebibmacro{date}%
    \newunit\newblock
    \iftoggle{bbx:eprint}
    {\usebibmacro{eprint}}
    {}%
    \newunit\newblock
    \usebibmacro{url+urldate}%
    \newunit\newblock
    \usebibmacro{addendum+pubstate}%
    \setunit{\bibpagerefpunct}\newblock
    \usebibmacro{pageref}%
    \usebibmacro{finentry}}

\makeatletter
% Diferring from IEEE, IARIA requires non-abbreviated references:
\renewcommand{\fnum@figure}{Figure~\thefigure}
% Diferring from IEEE, IARIA requires 14 point bold Times New Roman for the title
\renewcommand{\title}[1]{\renewcommand{\@title}{\bfseries\Large #1}}
% Diferring from IEEE, IARIA requires "Keywords" instead of "Index Terms":
\renewcommand\IEEEkeywordsname{Keywords}
\makeatother

\RequirePackage{xpatch}
% Diferring from IEEE, IARIA requires a hyphen after "Keywords" instead of an  emdash:
\xpatchcmd\IEEEkeywords{---}{-}{}{}

\makeatletter
\renewcommand{\IEEEauthorblockN}[1]{%
% copied from IEEEtran.cls:
    \relax\@IEEEauthorblockNstyle% set the default text style
    \gdef\@IEEEauthorblockXinterlinespace{0pt}% disable strut for spacer row
    % the \expandafter hides the \cr in conditional tex, see the array.sty docs
    % for details, probably not needed here as the \cr is in a macro
    % do a spacer row if needed
    \if@IEEEprevauthorblockincol\expandafter\@IEEEauthorblockNtopspaceline\fi
    \global\@IEEEprevauthorblockincoltrue% we now have a block in this column
    %restore the correct strut value
    \gdef\@IEEEauthorblockXinterlinespace{\@IEEEauthorblockNinterlinespace}%
    % input the author names
    \large
    #1%
    % end the row if the user did not already
    \crcr}
\makeatother

% Allows to hyphenate a word that contains a dash:
% https://stackoverflow.com/questions/2193307/how-do-i-get-latex-to-hyphenate-a-word-that-contains-a-dash
\RequirePackage[shortcuts]{extdash} % Use \-/ for a breakable dash that does not prevent the remainer of the word to be hyphenated

% Balance/level columns at the last page / in bibliography
% DISCLAIMER: No solution is a 100%/perfect one!
% Mainstream option: pbalance (see https://ctan.org/pkg/pbalance)
% BUT: incompatible with arxiv automated process (!)
\ifnum\value{iaria@pbalancetracker}=1
  \typeout{iaria class: load pbalance package.}
  \RequirePackage{pbalance}
\fi
% Flushend => works with arxiv, but major incampatibility with lineno (and, thus, also with mindflow et al.)
\ifnum\value{iaria@flushendtracker}=1
  \typeout{iaria class: load flushend package.}
  \RequirePackage{flushend}
\fi

% Finally, we'll use \endinput to indicate that LaTeX can stop reading this file. LaTeX will ignore anything after this line.
\endinput
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</iaria.cls>
%    \end{macrocode}
%\fi
%\Finale
\endinput