summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/iaria/iaria.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/iaria/iaria.dtx')
-rw-r--r--macros/latex/contrib/iaria/iaria.dtx243
1 files changed, 159 insertions, 84 deletions
diff --git a/macros/latex/contrib/iaria/iaria.dtx b/macros/latex/contrib/iaria/iaria.dtx
index bc091c3b83..299a34c894 100644
--- a/macros/latex/contrib/iaria/iaria.dtx
+++ b/macros/latex/contrib/iaria/iaria.dtx
@@ -1,16 +1,16 @@
%\iffalse
% iaria.dtx generated using makedtx version 1.2 (c) Nicola Talbot
% Command line args:
-% -author "Christoph P. Neumann "
% -dir "src"
+% -setambles ".*=>\nopreamble"
% -src "(_cpn_copyIntoExamplesFolder_cls.cmd|iaria.cls)=>\1"
-% -preamble "Copyright 2023-2024 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. "
% -date "2023-2024"
-% -doc "doc/iaria.tex"
% -macrocode ".*"
-% -setambles ".*=>\nopreamble"
+% -author "Christoph P. Neumann "
+% -preamble "Copyright 2023-2024 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. "
+% -doc "doc/iaria.tex"
% iaria
-% Created on 2024/4/10 18:20
+% Created on 2024/10/26 14:47
%\fi
%\iffalse
%<*package>
@@ -56,7 +56,7 @@
%\title{\textsf{iaria}\\
%An Unofficial IARIA LaTeX Class}
%\author{Christoph P.\ Neumann \texttt{$<$cyberpetaneuron@gmail.com$>$}}
-%\date{Version 0.2}
+%\date{Version 0.5}
%\maketitle
%\PrintChanges
%
@@ -104,7 +104,7 @@
%
%\section{Templates}
%
-%For a quick start the \textsf{iaria-lite} distribution contains document
+%For a quick start the \textsf{iaria} distribution contains document
%templates.
%The templates can be found in the \texttt{iaria-example-neumann.zip} file.
%
@@ -114,14 +114,35 @@
%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
+%\item |subfig| Loads subfig package with IARIA style settings
+%\item |subcaption| Loads subcaption package with IARIA style settings
+%\item |flushend| Activate flushend package (compatible with arXiv build process)
+%\item |pbalance| Activate pbalance package (incompatible with arXiv build process)
%\end{itemize}
%
+%A Remark about two-column document balancing on the last page:
+%The flushend package is recommended, because it works within the arXiv automated build process.
+%However, flushend has a major incampatibility with package lineno, which is, e.\,g., transitively loaded by package mindflow.
+%Thus, in case when flushend does not have any effect, check whether one of your packages loads lineno.
+%Usually you are stuck with your packages and, thus, will instead be forced to switch from flushend to pbalance.
+%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.
+%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.
+%I hope this remark proves helpful, it took me some nerve to find out.
+%
+%There is also another important difference between flushend and pbalance: the handling of footnotes on the last page.
+%Flushend provides a decent result, but the result of pbalance is incomprehensible.
+%I strongly recommend avoiding footnotes on the last page.
+%If you absolutely need footnotes on the last page, consider staying away from two-column balancing on the last page.
+%
+%About subfigures:
+%Both well-known packages subfig and subcaption can be used.
+%However, they are not compatible with each other and we can either load one or the other.
+%Both require dedicated style settings to be compatible with IARIA formatting rules.
+%Thus, the document class provides options to load them for you with correct settings.
+%
%\section{Requirements}
%
%We instrument several other \LaTeX\ packages for different purposes,
@@ -138,6 +159,8 @@
%\item inputenc
%\item orcidlink
%\item pbalance
+%\item subcaption
+%\item subfig
%\item times
%\item url
%\item xcolor
@@ -178,7 +201,7 @@ pause% \end{macrocode}
% \end{macrocode}
%\fi
% \begin{macrocode}
-%# Copyright (c) 2023 Christoph P. Neumann,
+%# Copyright (c) 2023-2024 Christoph P. Neumann
% !TeX spellcheck = en-US
% LTeX: language=en-US
@@ -186,34 +209,51 @@ pause% \end{macrocode}
% !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.
+% 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.
+
\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}[2024/04/10 unofficial IARIA conference template v0.2]
+\ProvidesClass{iaria}[2024/10/24 unofficial IARIA conference template v0.5]
% Define marker counter for options (counter are global in latex):
+\newcounter{iaria@subfigtracker}
+\newcounter{iaria@subcaptiontracker}
\newcounter{iaria@pbalancetracker}
\newcounter{iaria@flushendtracker}
% Declare options:
-\DeclareOption{onecolumn}{\OptionNotUsed} % IEEE option onecolumn will be ignored
+
+\DeclareOption{subfig}{
+ \setcounter{iaria@subfigtracker}{1}
+ \typeout{iaria class: subfig option is set (use subfloat command).}
+}
+\DeclareOption{subcaption}{
+ \setcounter{iaria@subcaptiontracker}{1}
+ \typeout{iaria class: subcaption option is set (use subfigure command).}
+}
+
+% IEEE option onecolumn will be ignored
+\DeclareOption{onecolumn}{\OptionNotUsed}
\DeclareOption{pbalance}{
\setcounter{iaria@pbalancetracker}{1}
@@ -225,19 +265,22 @@ pause% \end{macrocode}
}
% We'll pass any document class options along to the underlying class
+% (required IEEE options: conference! For IARIA purposes.)
\DeclareOption*{%
- \PassOptionsToClass{\CurrentOption}{IEEEtran}% required IEEE options: conference (for IARIA purposes)
+ \PassOptionsToClass{\CurrentOption}{IEEEtran}
}
% 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,
+% 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.)
+% Replace \usepackage with \RequirePackage.
+% (The syntax for both commands is the same.)
\RequirePackage{times} % Times New Roman
@@ -245,7 +288,8 @@ pause% \end{macrocode}
\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.
+% Has to be loaded AFTER any font packages.
+% See https://tex.stackexchange.com/a/2869/9075.
\RequirePackage[T1]{fontenc}
\RequirePackage{graphicx}
@@ -259,57 +303,78 @@ pause% \end{macrocode}
% 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}
+\RequirePackage[
+ defernumbers=true,
+ style=ieee,
+ backend=biber,
+ url=false,
+ hyperref,
+ maxnames=5,
+ minnames=1,
+ maxcitenames=2,
+ mincitenames=1
+]{biblatex}
+
+% Due to applied option defernumbers=true:
+% Prevent citations in the references are being numbered as '0' in ArXiv
+% https://tex.stackexchange.com/questions/463556/all-the-citations-in-the-references-are-being-numbered-as-0-in-arxiv-while-upl
+\makeatletter
+\let\blx@rerun@biber\relax
+\makeatother
+
\renewcommand*{\bibfont}{\small}
-% Diferring from IEEE, IARIA requires, for ONLINE entries, no point but a comma between author and title:
+% 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}}
+ \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
+% Diferring from IEEE, IARIA requires 14 point bold Times 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:
+% Diferring from IEEE, IARIA requires a hyphen after "Keywords"
+% instead of an emdash:
\xpatchcmd\IEEEkeywords{---}{-}{}{}
-% Diferring from IEEE, IARIA requires also the keywords in Italic (and Bold)(and lower case!):
+% Diferring from IEEE, IARIA requires also the keywords in Italic
+% (and Bold)(and lower case!):
\let\oldIEEEkeywords\IEEEkeywords
\def\IEEEkeywords{\oldIEEEkeywords\itshape\ignorespaces}
@@ -318,23 +383,14 @@ pause% \end{macrocode}
% 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
-% IARIA subfigure captions require this:
-\RequirePackage[caption=false,font=footnotesize]{subfig}
-
% IARIA requires to bring the table caption in the same line of "Table I"
\usepackage{etoolbox}
\makeatletter
@@ -345,9 +401,16 @@ pause% \end{macrocode}
{}
\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
+% IARIA subfigure captions require parentheses and footnotesize:
+\ifnum\value{iaria@subfigtracker}=1
+ \typeout{iaria class: load subfig package (use subfloat command).}
+ \RequirePackage[caption=false,font=footnotesize]{subfig}
+\fi
+\ifnum\value{iaria@subcaptiontracker}=1
+ \typeout{iaria class: load subcaption package (use subfigure command).}
+ \RequirePackage{subcaption}
+ \captionsetup[subfigure]{labelformat=parens,font=footnotesize}
+\fi
% Balance/level columns at the last page / in bibliography
% DISCLAIMER: No solution is a 100%/perfect one!
@@ -357,13 +420,25 @@ pause% \end{macrocode}
\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.)
+% 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.
+% ========================================================
+% Packages with recommendation to load them last:
+
+% 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
+% Use \-/ for a breakable dash that does not prevent the
+% remainer of the word to be hyphenated.
+\RequirePackage[shortcuts]{extdash}
+% ========================================================
+
+% 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