Debian Codegraph @

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

raw
1 %\iffalse
2 % iaria.dtx generated using makedtx version 1.2 (c) Nicola Talbot
3 % Command line args:
4 % -macrocode ".*"
5 % -setambles ".*=>\nopreamble"
6 % -preamble "Copyright 2023-2026 Christoph P. Neumann This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c 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. "
7 % -author "Christoph P. Neumann "
8 % -src "(_cpn_copyIntoExamplesFolder_cls.cmd|iaria.cls)=>\1"
9 % -date "2023-2026"
10 % -dir "src"
11 % -doc "doc/iaria.tex"
12 % iaria
13 % Created on 2026/2/24 20:08
14 %\fi
15 %\iffalse
16 %<*package>
17 %% \CharacterTable
18 %% {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
19 %% 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
20 %% Digits \0\1\2\3\4\5\6\7\8\9
21 %% Exclamation \! Double quote \" Hash (number) \#
22 %% Dollar \$ Percent \% Ampersand \&
23 %% Acute accent \' Left paren \( Right paren \)
24 %% Asterisk \* Plus \+ Comma \,
25 %% Minus \- Point \. Solidus \/
26 %% Colon \: Semicolon \; Less than \<
27 %% Equals \= Greater than \> Question mark \?
28 %% Commercial at \@ Left bracket \[ Backslash \\
29 %% Right bracket \] Circumflex \^ Underscore \_
30 %% Grave accent \` Left brace \{ Vertical bar \|
31 %% Right brace \} Tilde \~}
32 %</package>
33 %\fi
34 % \iffalse
35 % Doc-Source file to use with LaTeX2e
36 % Copyright (C) 2023-2026 Christoph P. Neumann , all rights reserved.
37 % \fi
38 % \iffalse
39 %<*driver>
40 \documentclass{ltxdoc}
41
42 \CodelineNumbered
43 \EnableCrossrefs
44 \CodelineIndex
45 \RecordChanges
46 \GetFileInfo{iaria.cls}
47
48 \parskip1.0ex
49 \parindent0.0ex
50
51 \begin{document}
52 \DocInput{iaria.dtx}
53 \end{document}
54 %</driver>
55 %\fi
56 %\title{\textsf{iaria}\\
57 %An Unofficial IARIA LaTeX Class}
58 %\author{Christoph P.\ Neumann \texttt{$<[email protected]$>$}}
59 %\date{Version 0.9.1}
60 %\maketitle
61 %\PrintChanges
62 %
63 %\begin{abstract}
64 %The \texttt{iaria}--class provides a convenient environment for writing IARIA scholary publications.
65 %This version also implements full IARIA specifications for citation style,
66 %which can only be templated for a specific technological combination like latex/pdflatex in combination with biblatex using a biber backend.
67 %\end{abstract}
68 %
69 %\section{Installation}
70 %
71 %The \texttt{zip} or \texttt{tar.gz} file comes with a \texttt{iaria.ins}
72 %and a \texttt{iaria.dtx} file included which contains the \LaTeX\ stuff.
73 %
74 %To extract the class files call:
75 %
76 %\begin{verbatim}
77 % $ latex iaria.ins
78 %\end{verbatim}
79 %
80 %This call will extract all \LaTeX\ specific files to the current
81 %directory. You can either use the files for a single
82 %cv project or you can integrate the files into your \TeX\ installation.
83 %
84 %If you just want to use \textsf{iaria} for a single curriculum vitae
85 %project, the simplest way is just to copy the generated files to the
86 %folder of the project.
87 %
88 %If you want to integrate \textsf{iaria} into your \TeX\ installation,
89 %create a directory \texttt{tex/latex/iaria} beneath your \TeX\ installation
90 %(e.g.~beneath \texttt{/usr/share/texmf}) and copy all files from the
91 %current directory there. Now call:
92 %
93 %\begin{verbatim}
94 % $ mktexlsr
95 %\end{verbatim}
96 %
97 %to update the file--cache of \LaTeX.
98 %
99 %Hint: The \textsf{iaria} distribution contains a sample docstrip configuration
100 %in \texttt{docstrip.cfg} via which files can be distributed
101 %automatically to their correct positions inside a \LaTeX\ installation.
102 %Feel free to adapt this file to your environment and afterwards call
103 %\texttt{latex iaria.ins} to install the package to its right place.
104 %
105 %\section{Templates}
106 %
107 %For a quick start the \textsf{iaria} distribution contains document
108 %templates.
109 %The templates can be found in the \texttt{iaria-example-ctan.zip} file.
110 %
111 %Especially beginners should NOT start from scatch! Use the example file!
112 %The iaria package assumes that the latex user has former experience with IEEEtran!
113 %For example, the formatting of the author block is not documented here, please refer to the IEEEtran documentantion.
114 %For shared affiliations, there is a formatting option called ``alternate long format'', which you can find in the well-known IEEEtran\_HOWTO.pdf;
115 %it is also the superior option for IARIA papers with shared affiliations.
116 %
117 %BEWARE: If you are completely new to LaTeX, then do NOT use iaria class for your first LaTeX experiment, but please use the IARIA Word template.
118 %The same advice is true when you have no former IEEEtran experience and when you are not willing to acquire IEEEtran knowledge on your own.
119 %
120 %DISCLAIMER: Using this package still requires that you additionally MUST read the
121 %IARIA formatting guide (www.iaria.org/formatting.doc)
122 %as well as the IARIA editorial rules (www.iaria.org/editorialrules.html).
123 %Simply using this package does not relieve you of your responsibility!
124 %This applies to all aspects: IARIA style and LaTeX/BibTeX know how (like interfering packages) as well as IEEEtran implications (like conference mode, author block, shared affiliation, or cite compression).
125 %In case of doubt, you are required to understand the content of the iaria.cls file, because before this community-provided package you had to make all these adjustments yourself.
126 %
127 %\section{Documentclass}
128 %
129 %\DescribeMacro{documentclass iaria}
130 %This package provides the documentclass \texttt{iaria}. The documentclass
131 %supports the following options:
132 %
133 %\begin{itemize}
134 %\item |conference| Passed to IEEEtran (i.\,a., it suppresses page numbers)
135 %\item |a4paper| Passed to IEEEtran
136 %\item |subfig| Loads subfig package with IARIA style settings
137 %\item |subcaption| Loads subcaption package with IARIA style settings
138 %\item |flushend| Activate flushend package (compatible with arXiv build process)
139 %\item |pbalance| Activate pbalance package (incompatible with arXiv build process)
140 %\end{itemize}
141 %
142 %BEWARE: Usually, you will/must provide IEEEtran option ``conference'' to the iaria package, both for IARIA conferences AND for IARIA journals! Because for IARIA, the formatting rules are the same for conferences and journals -- in contrast to IEEE. Its conference style is the base for IARIA formatting.
143 %The example file (see above) prominently applies this option.
144 %
145 %A Remark about two-column document balancing on the last page:
146 %The flushend package is recommended, because it works within the arXiv automated build process.
147 %However, flushend has a major incampatibility with package lineno, which is, e.\,g., transitively loaded by package mindflow.
148 %Thus, in case when flushend does not have any effect, check whether one of your packages loads lineno.
149 %Usually you are stuck with your packages and, thus, will instead be forced to switch from flushend to pbalance.
150 %Please be aware that pbalance works great and has high compatibility, but unfortunately it will not have any effect within the arXiv automated build process.
151 %In case of both, a somehow needed lineno package and an intended arXiv upload, I recommend to do without two-column balancing on the last page and just to stay away from both flushend and pbalance, in order to ensure that your paper is layouted identically in IARIA submission and arXiv upload.
152 %I hope this remark proves helpful, it took me some nerve to find out.
153 %
154 %There is also another important difference between flushend and pbalance: the handling of footnotes on the last page.
155 %Flushend provides a decent result, but the result of pbalance is incomprehensible.
156 %I strongly recommend avoiding footnotes on the last page.
157 %If you absolutely need footnotes on the last page, consider staying away from two-column balancing on the last page.
158 %
159 %About subfigures:
160 %Both well-known packages subfig and subcaption can be used.
161 %However, they are not compatible with each other and we can either load one or the other.
162 %Both require dedicated style settings to be compatible with IARIA formatting rules.
163 %Thus, the document class provides options to load them for you with correct settings.
164 %
165 %In order, to configure table/figure captions correctly for IARIA requirements, the package caption is used.
166 %There would be other options to achieve this, however, the babel package is disruptive to the table label -- using package caption provides stability to the label configuration against babel intervention.
167 %There are minor downsides of using caption package:
168 %it results in a warning about unknown document class that cannot be suppressed, and if you do not use any tables or figures, caption package also results in a warning about ``unused captionsetup'' that cannot be suppressed, either.
169 %
170 %There is an open issue about cite compression. Currently, numeric-comp is used instead of ieee-comp.
171 %This results in ``[7-9]'' for cite compression.
172 %IARIA would prefer IEEE-style cite compression ``[7]-[9]'', which could be accomplished with ieee-comp, however, ieee-comp is currently not available on Overleaf.
173 %Due to the significance of Overleaf to many authors, this has been a hard choice.
174 %The cite compression is activated for biblatex with option citestyle, which must be given at package load time, and is not supported later on by command ExecuteBibliographyOptions.
175 %Thus, you are bound to my chosen compromise.
176 %In case of doubt, you might consider to use my alternative package \texttt{iaria-lite}, which allows you to adjust your bib stack.
177 %
178 %\section{Requirements}
179 %
180 %We instrument several other \LaTeX\ packages for different purposes,
181 %which must be available under your installation.
182 %
183 %\begin{itemize}
184 %\item IEEEtran
185 %\item biblatex
186 %\item biblatex-ieee
187 %\item extdash
188 %\item floatrow
189 %\item flushend
190 %\item fontenc
191 %\item graphicx
192 %\item hyperref
193 %\item inputenc
194 %\item orcidlink
195 %\item pbalance
196 %\item subcaption
197 %\item subfig
198 %\item times
199 %\item url
200 %\item xcolor
201 %\item xpatch
202 %\end{itemize}
203 %
204 %
205 %\StopEventually{}
206 %\section{The Code}
207 %\iffalse
208 % \begin{macrocode}
209 %<*_cpn_copyIntoExamplesFolder_cls.cmd>
210 % \end{macrocode}
211 %\fi
212 % \begin{macrocode}
213 @echo off
214
215 rem ***************************************************************************
216 rem * author: Christoph P. Neumann
217 rem ***************************************************************************
218 cd /d "%~dp0"
219
220 echo == ..\examples\* ==
221 for /D %%D in (..\examples\*) do (
222 echo == %%D ==
223 xcopy /Y ".\*.cls" "%%~D"
224 )
225
226 pause% \end{macrocode}
227 %\iffalse
228 % \begin{macrocode}
229 %</_cpn_copyIntoExamplesFolder_cls.cmd>
230 % \end{macrocode}
231 %\fi
232 %\iffalse
233 % \begin{macrocode}
234 %<*iaria.cls>
235 % \end{macrocode}
236 %\fi
237 % \begin{macrocode}
238 %# Copyright (c) 2023-2026 Christoph P. Neumann
239
240 % !TeX spellcheck = en-US
241 % LTeX: language=en-US
242 % !TeX encoding = utf8
243 % !TeX program = pdflatex
244 % !BIB program = biblatex / biber
245
246 % DISCLAIMER: Only for latex/pdflatex in combination with biblatex using a
247 % biber backend. (And neither for XeLaTeX or LuaTeX nor for bibtex or natbib.)
248 % Because to set the required bibliography configuration, the biblatex
249 % package needs to be loaded.
250 % I also need to adjust formatting of ONLINE entries, thus, I have to make
251 % some assumptions to rely on. And inputenc must be loaded before biblatex.
252 % Thus, inputenc, fontenc and biblatex with backend=biber are hard coded part
253 % of this template.
254 % I could remove these from the cls and make this part of the example.tex,
255 % but then it would be less foolproof in my opinion.
256 % I apologize for this opinionated design decission to anyone who is
257 % jeopardised by it.
258 %
259 % I also had to decide whether to hardcode required usage of IEEEtran
260 % "conference" option into my class. I decided against it.
261 % Thus, it is required to use IARIA class like this:
262 % \documentclass[conference]{iaria}.
263 % The iaria class passes all class options (like "conference") to IEEEtran.
264 % The reasoning: There might be a future use case (speculatively) to pass
265 % IEEEtran options like "a4paper", for IARIA purposes (?)
266 % For now, IARIA requires IEEE "conference" option, only.
267
268 \NeedsTeXFormat{LaTeX2e}
269
270 \ProvidesClass{iaria}[2026/02/24 IARIA template v0.9.1]
271
272 % Define marker counter for options (counter are global in latex):
273 \newcounter{iaria@subfigtracker}
274 \newcounter{iaria@subcaptiontracker}
275 \newcounter{iaria@pbalancetracker}
276 \newcounter{iaria@flushendtracker}
277
278 % Declare options:
279
280 \DeclareOption{subfig}{
281 \setcounter{iaria@subfigtracker}{1}
282 \typeout{iaria class: subfig option is set (use subfloat command).}
283 }
284 \DeclareOption{subcaption}{
285 \setcounter{iaria@subcaptiontracker}{1}
286 \typeout{iaria class: subcaption option is set (use subfigure command).}
287 }
288
289 % IEEE option onecolumn will be ignored
290 \DeclareOption{onecolumn}{\OptionNotUsed}
291
292 \DeclareOption{pbalance}{
293 \setcounter{iaria@pbalancetracker}{1}
294 \typeout{iaria class: pbalance option is set.}
295 }
296 \DeclareOption{flushend}{
297 \setcounter{iaria@flushendtracker}{1}
298 \typeout{iaria class: flushend option is set.}
299 }
300
301 % We'll pass any document class options along to the underlying class
302 % (required IEEE options: conference! For IARIA purposes.)
303 \DeclareOption*{%
304 \PassOptionsToClass{\CurrentOption}{IEEEtran}
305 }
306
307 % Now we'll execute any options passed in
308 \ProcessOptions\relax
309
310 % Instead of defining each and every little detail
311 % required to create a new document class,
312 % you can base your class on an existing document class.
313 \LoadClass{IEEEtran}
314
315 % Now paste your code from the preamble here.
316 % Replace \usepackage with \RequirePackage.
317 % (The syntax for both commands is the same.)
318
319 \RequirePackage{times} % Times New Roman
320
321 % inputenc must be loaded before biblatex
322 \RequirePackage[utf8]{inputenc}
323
324 % https://tex.stackexchange.com/questions/664
325 % /why-should-i-use-RequirePackaget1fontenc
326 % Has to be loaded AFTER any font packages.
327 % See https://tex.stackexchange.com/a/2869/9075.
328 \RequirePackage[T1]{fontenc}
329
330 \RequirePackage{graphicx}
331 \RequirePackage{xcolor}
332
333 \RequirePackage{url}
334 \RequirePackage{orcidlink}
335 \RequirePackage{hyperref}
336 \hypersetup{hidelinks,unicode}
337
338 % For cite compression: activated by citestyle, which
339 % must be given at package load time, and is NOT supported
340 % later on by \ExecuteBibliographyOptions
341 \RequirePackage[
342 style=ieee,
343 citestyle=ieee-comp, % by default, activate cite compression
344 backend=biber
345 ]{biblatex}
346 % TODO: numeric-comp results in "[7-9]" and ieee-comp in "[7]-[9]". IARIA requires IEEE-style cite compression, i.e., ieee-comp!
347 % However, ieee-comp is relatively new! From the perspective of Overleaf, it is only available with Overlead TeXlive 2025 as compiler setting. If you need a lower texlive version, for whichever reason, downgrade to numeric-comp, and usually you will still get it accepted (but then, also use \multiciterangedelim, below)
348
349 % Diferring from IEEE, IARIA requires
350 % in bibliography: 6+ authors as first author et al.
351 % in \citeauthor: any case of et al. with just first author et al.
352 % as preamble options of biblatex that may be given after load-time:
353 \ExecuteBibliographyOptions{
354 defernumbers=true,
355 hyperref,
356 maxnames=5,
357 minnames=1,
358 maxcitenames=2,
359 mincitenames=1,
360 %%% IARIA requires format for "Accessed: " dates in YYYY-MM-DD
361 %urldate=iso8601, % DEPRECATED, use iso
362 urldate=iso, % iso requires also seconds=true
363 seconds=true
364 }
365
366 % Due to applied option defernumbers=true:
367 % Prevent citations in the references are being numbered as '0' in ArXiv
368 % https://tex.stackexchange.com/questions/463556
369 % /all-the-citations-in-the-references-are-being-numbered-as-0-in-arxiv-while-upl
370 \makeatletter
371 \let\blx@rerun@biber\relax
372 \makeatother
373
374 % When using multiple citation keys in the same \cite command,
375 % change IEEEtran "[1], [5], [7]" to IARIA-required "[1][5][7]":
376 %\renewcommand*{\multicitedelim}{][} % for numeric-comp
377 \renewcommand*{\multicitedelim}{} % for ieee-comp
378 %\renewcommand*{\multiciterangedelim}{]--[} % only required for numeric-comp, not for ieee-comp
379
380 \renewcommand*{\bibfont}{\small}
381
382 % Zotero generates wrong language fields with wrong "en"
383 % instead of correct "english" option, thus, despite
384 % default biblatex clearlang, the "en" will incorrectly
385 % be printed out, even in english papers.
386 % Make "en" equivalent to "english" and/or its derivatives:
387 \DeclareRedundantLanguages{en}{english,american,british,
388 canadian,australian,newzealand,USenglish,UKenglish}
389
390 % Diferring from IEEE, IARIA requires, for ONLINE entries,
391 % no point but a comma between author and title:
392 % For style=ieee
393 \DeclareBibliographyDriver{online}{%
394 \usebibmacro{bibindex}%
395 \usebibmacro{begentry}%
396 \usebibmacro{author/editor+others/translator+others}
397 \setunit{\labelnamepunct}\newblock
398 \usebibmacro{title}%
399 \newunit
400 \printlist{language}%
401 \newunit\newblock
402 \usebibmacro{byauthor}%
403 \newunit\newblock
404 \usebibmacro{byeditor+others}%
405 \newunit\newblock
406 \printfield{version}%
407 \newunit
408 \printfield{note}%
409 \newunit\newblock
410 \printlist{organization}
411 \newunit\newblock
412 \usebibmacro{date}%
413 \newunit\newblock
414 \iftoggle{bbx:eprint}
415 {\usebibmacro{eprint}}
416 {}%
417 \newunit\newblock
418 \usebibmacro{url+urldate}%
419 \newunit\newblock
420 \usebibmacro{addendum+pubstate}%
421 \setunit{\bibpagerefpunct}\newblock
422 \usebibmacro{pageref}%
423 \usebibmacro{finentry}}
424
425 \makeatletter
426 % Diferring from IEEE, IARIA requires non-abbreviated references:
427 \renewcommand{\fnum@figure}{Figure~\thefigure}
428 % Diferring from IEEE, IARIA requires 14 point bold Times for the title
429 \renewcommand{\title}[1]{\renewcommand{\@title}{\bfseries\Large #1}}
430 % Diferring from IEEE, IARIA requires "Keywords" instead of "Index Terms":
431 \renewcommand\IEEEkeywordsname{Keywords}
432 \makeatother
433
434 \RequirePackage{xpatch}
435 % Diferring from IEEE, IARIA requires a hyphen after "Keywords"
436 % instead of an emdash:
437 \xpatchcmd\IEEEkeywords{---}{-}{}{}
438
439 % Diferring from IEEE, IARIA requires also the keywords in Italic
440 % (and Bold)(and lower case!):
441 \let\oldIEEEkeywords\IEEEkeywords
442 \def\IEEEkeywords{\oldIEEEkeywords\itshape\ignorespaces}
443
444 \makeatletter
445 \renewcommand{\IEEEauthorblockN}[1]{%
446 % copied from IEEEtran.cls:
447 \relax\@IEEEauthorblockNstyle% set the default text style
448 \gdef\@IEEEauthorblockXinterlinespace{0pt}% disable strut for spacer row
449 \if@IEEEprevauthorblockincol\expandafter\@IEEEauthorblockNtopspaceline\fi
450 \global\@IEEEprevauthorblockincoltrue% we now have a block in this column
451 \gdef\@IEEEauthorblockXinterlinespace{\@IEEEauthorblockNinterlinespace}%
452 \large
453 #1%
454 \crcr}
455 \makeatother
456
457 % IARIA requires to bring the table caption
458 % in the same line as label "TABLE I"
459 \usepackage{etoolbox}
460 \makeatletter
461 \patchcmd{\@makecaption}
462 {\\}
463 {.\ }
464 {}
465 {}
466 \makeatother
467
468 % caption is compatible with babel that intervenes with tablename
469 \RequirePackage{caption}
470 % IARIA requires table caption to be
471 % above, centered, with upper case label ('TABLE'), and small caps text.
472 % (note that the caption package is only controlling the look & feel of the captions,
473 % it does not control the placement of the captions.)
474 \captionsetup[table]{
475 style=base,
476 name=TABLE,
477 position=auto, % position option is NOT about forcing the label above/below, but ONLY about spacing!
478 justification=centering,
479 labelsep=period,
480 textfont={footnotesize, sc},
481 labelfont=footnotesize}
482 % IARIA requires figure caption to be
483 % below and centered
484 \captionsetup[figure]{
485 style=base,
486 position=auto, % position option is NOT about forcing the label above/below, but ONLY about spacing!
487 justification=centering,
488 labelsep=period,
489 font={footnotesize,rm}}
490 % For controlling the placement of the captions
491 % (table: top | figure: bottom), the package caption
492 % recommends to use package floatrow:
493 % (Without foatrom, the positioning is determined by
494 % the textual (!) position of command \label in relation to
495 % includegraphics/begin-tabular; a well-known latex aspect.)
496 \RequirePackage{floatrow}
497 \floatsetup[table]{capposition=top,captionskip=5pt}
498 \floatsetup[figure]{capposition=bottom,captionskip=8pt}
499
500 % IARIA subfigure captions require parentheses and footnotesize:
501 \ifnum\value{iaria@subfigtracker}=1
502 \typeout{iaria class: load subfig package (use subfloat command).}
503 \RequirePackage[caption=false,font=footnotesize]{subfig}
504 \fi
505 \ifnum\value{iaria@subcaptiontracker}=1
506 \typeout{iaria class: load subcaption package (use subfigure command).}
507 \RequirePackage{subcaption}
508 % IARIA requires subfigure caption to number them with
509 % parentheses around latin chars (like "(a)" and "(b)")
510 \captionsetup[subfigure]{labelformat=parens,font=footnotesize}
511 \fi
512
513 % Balance/level columns at the last page / in bibliography
514 % DISCLAIMER: No solution is a 100%/perfect one!
515 % Mainstream option: pbalance (see https://ctan.org/pkg/pbalance)
516 % BUT: incompatible with arxiv automated process (!)
517 \ifnum\value{iaria@pbalancetracker}=1
518 \typeout{iaria class: load pbalance package.}
519 \RequirePackage{pbalance}
520 \fi
521 % Flushend => works with arxiv, but major incampatibility with lineno
522 % (and, thus, also with mindflow et al.)
523 \ifnum\value{iaria@flushendtracker}=1
524 \typeout{iaria class: load flushend package.}
525 \RequirePackage{flushend}
526 \fi
527
528 % ========================================================
529 % Packages with recommendation to load them last:
530
531 % Allows to hyphenate a word that contains a dash:
532 % https://stackoverflow.com/questions/2193307
533 % /how-do-i-get-latex-to-hyphenate-a-word-that-contains-a-dash
534 % Use \-/ for a breakable dash that does not prevent the
535 % remainer of the word to be hyphenated.
536 \RequirePackage[shortcuts]{extdash}
537 % ========================================================
538
539 % Finally, we'll use \endinput to indicate that LaTeX can stop reading
540 % this file. LaTeX will ignore anything after this line.
541 \endinput
542 % \end{macrocode}
543 %\iffalse
544 % \begin{macrocode}
545 %</iaria.cls>
546 % \end{macrocode}
547 %\fi
548 %\Finale
549 \endinput