diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a205a8..9958243 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - use style `orcidlink.sty` instead of local logo for the ORCID icon. +- `\authorsetup{}` is now the preferred way for configuring the package ## [1.2.1] - 2022-04-25 diff --git a/README.md b/README.md index 134b03b..282391c 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,25 @@ your `texmf` tree or the local directory with your main LaTeX file). A simple use for LNCS-formatted papers is as follows: +```tex +\usepackage{authorarchive} +\authorsetup{LNCS, + key=brucker-authorarchive-2016, + year=2016, + publication={Anonymous et al.\ (eds). Proceedings of the International + Conference on LaTeX-Hacks, LNCS~42. Some Publisher} + startpage={42}, + doi={00/00_00}, + doiText={0/00\_00}, + nocopyright +} +``` + +Note that this is the preferred way of configuring the package, as it allows, +e.g., for LaTeX commands in options. Only if no (complex) LaTeX commands are +used, the configuration can also be passes as package options (this is a +limitation of the way LaTeX is passing options to packages): + ```tex \usepackage[LNCS, key=brucker-authorarchive-2016, @@ -40,7 +59,7 @@ A simple use for LNCS-formatted papers is as follows: doi={00/00_00}, doiText={0/00\_00}, nocopyright - ]{authorarchive} +]{authorarchive} ``` The following layout-styles are pre-defined: diff --git a/authorarchive.sty b/authorarchive.sty index afefb1c..219cd8a 100644 --- a/authorarchive.sty +++ b/authorarchive.sty @@ -80,8 +80,34 @@ } \ProcessKeyvalOptions* +\newcommand{\AA@defIncludeFiles}{ + \def\AA@bibBibTeX{\AA@bibtexdir/\AA@key.bib} + \def\AA@bibBibTeXLong{\AA@bibtexdir/\AA@key.bibtex} + \def\AA@bibWord{\AA@bibtexdir/\AA@key.word.xml} + \def\AA@bibEndnote{\AA@bibtexdir/\AA@key.enw} + \def\AA@bibRIS{\AA@bibtexdir/\AA@key.ris} +} +\AA@defIncludeFiles + +\newboolean{AA@bibExists} +\setboolean{AA@bibExists}{false} +\newcommand{\AA@defIncludeSwitches}{ + \IfFileExists{\AA@bibBibTeX}{\setboolean{AA@bibExists}{true}}{} + \IfFileExists{\AA@bibBibTeXLong}{\setboolean{AA@bibExists}{true}}{} + \IfFileExists{\AA@bibWord}{\setboolean{AA@bibExists}{true}}{} + \IfFileExists{\AA@bibEndnote}{\setboolean{AA@bibExists}{true}}{} + \IfFileExists{\AA@bibRIS}{\setboolean{AA@bibExists}{true}}{} +} +\AA@defIncludeSwitches + + % Provide command for dynamic configuration setup -\def\authorsetup{\kvsetkeys{AA}} +% \def\authorsetup{\kvsetkeys{AA}} +\newcommand{\authorsetup}[1]{% + \kvsetkeys{AA}{#1} + \AA@defIncludeFiles + \AA@defIncludeSwitches +} % Load local configuration \InputIfFileExists{authorarchive.config}{}{} @@ -99,20 +125,6 @@ \newlength\AA@y \newlength\AA@width -\def\AA@bibBibTeX{\AA@bibtexdir/\AA@key.bib} -\def\AA@bibBibTeXLong{\AA@bibtexdir/\AA@key.bibtex} -\def\AA@bibWord{\AA@bibtexdir/\AA@key.word.xml} -\def\AA@bibEndnote{\AA@bibtexdir/\AA@key.enw} -\def\AA@bibRIS{\AA@bibtexdir/\AA@key.ris} - -\newboolean{AA@bibExists} -\setboolean{AA@bibExists}{false} -\IfFileExists{\AA@bibBibTeX}{\setboolean{AA@bibExists}{true}}{} -\IfFileExists{\AA@bibBibTeXLong}{\setboolean{AA@bibExists}{true}}{} -\IfFileExists{\AA@bibWord}{\setboolean{AA@bibExists}{true}}{} -\IfFileExists{\AA@bibEndnote}{\setboolean{AA@bibExists}{true}}{} -\IfFileExists{\AA@bibRIS}{\setboolean{AA@bibExists}{true}}{} - \setlength\AA@x{1in+\hoffset+\oddsidemargin} \newcommand{\authorcrfont}{\footnotesize} diff --git a/examples/brucker-authorarchive-2016-IEEEtran-nourl.tex b/examples/brucker-authorarchive-2016-IEEEtran-nourl.tex index a865032..bbb7501 100644 --- a/examples/brucker-authorarchive-2016-IEEEtran-nourl.tex +++ b/examples/brucker-authorarchive-2016-IEEEtran-nourl.tex @@ -1,6 +1,8 @@ \documentclass[conference]{IEEEtran} \usepackage[T1]{fontenc} -\usepackage[IEEE, +\usepackage{../authorarchive} +\authorsetup{ + IEEE, key=brucker-authorarchive-2016, year=2016, publication={Anonymous et al.\ (eds). Proceedings of the International @@ -8,7 +10,7 @@ startpage={42}, nourl, nocopyright - ]{../authorarchive} +} \usepackage{lipsum} diff --git a/examples/brucker-authorarchive-2016-IEEEtran.tex b/examples/brucker-authorarchive-2016-IEEEtran.tex index 8809fc9..2d0d3d2 100644 --- a/examples/brucker-authorarchive-2016-IEEEtran.tex +++ b/examples/brucker-authorarchive-2016-IEEEtran.tex @@ -1,6 +1,8 @@ \documentclass[conference]{IEEEtran} \usepackage[T1]{fontenc} -\usepackage[IEEE, +\usepackage{../authorarchive} +\authorsetup{ + IEEE, key=brucker-authorarchive-2016, year=2016, publication={Anonymous et al.\ (eds). Proceedings of the International @@ -9,7 +11,7 @@ doi={00/00_00}, doiText={0/00\_00}, nocopyright - ]{../authorarchive} +} \usepackage{lipsum} diff --git a/examples/brucker-authorarchive-2016-acmart.tex b/examples/brucker-authorarchive-2016-acmart.tex index 3c6da44..e94e33f 100644 --- a/examples/brucker-authorarchive-2016-acmart.tex +++ b/examples/brucker-authorarchive-2016-acmart.tex @@ -8,7 +8,9 @@ \acmDOI{10.1145/000000.000000} \acmISBN{000-0-0000-0000-0/00/00} -\usepackage[acmart, +\usepackage{../authorarchive} +\authorsetup{ + acmart, key=brucker-authorarchive-2016, year=2016, publication={Anonymous et al. (eds). Proceedings of the International @@ -16,7 +18,7 @@ startpage={42}, doi={00/0000}, nocopyright - ]{../authorarchive} +} \usepackage{lipsum} diff --git a/examples/brucker-authorarchive-2016-entcs.tex b/examples/brucker-authorarchive-2016-entcs.tex index 9095d79..ca97306 100644 --- a/examples/brucker-authorarchive-2016-entcs.tex +++ b/examples/brucker-authorarchive-2016-entcs.tex @@ -1,6 +1,8 @@ \documentclass{entcs} \usepackage[T1]{fontenc} -\usepackage[ENTCS, +\usepackage{../authorarchive} +\authorsetup{ + ENTCS, key=brucker-authorarchive-2016, year=2016, publication={Anonymous et al.\ (eds). Proceedings of the International @@ -9,7 +11,7 @@ doi={00/00_00}, doiText={0/00\_00}, nocopyright - ]{../authorarchive} +} \usepackage{lipsum} diff --git a/examples/brucker-authorarchive-2016-llncs-a4.tex b/examples/brucker-authorarchive-2016-llncs-a4.tex index 0f63fd4..ed1c6f4 100644 --- a/examples/brucker-authorarchive-2016-llncs-a4.tex +++ b/examples/brucker-authorarchive-2016-llncs-a4.tex @@ -1,6 +1,8 @@ \documentclass[final, runningheads, USenglish, a4paper]{llncs} \usepackage[T1]{fontenc} -\usepackage[LNCS, +\usepackage{../authorarchive} +\authorsetup{ + LNCS, key=brucker-authorarchive-2016, year=2016, publication={Anonymous et al.\ (eds). Proceedings of the International @@ -9,7 +11,7 @@ doi={00/00_00}, doiText={0/00\_00}, nocopyright - ]{../authorarchive} +} \usepackage{lipsum} diff --git a/examples/brucker-authorarchive-2016-llncs.tex b/examples/brucker-authorarchive-2016-llncs.tex index 2d24948..ef25d23 100644 --- a/examples/brucker-authorarchive-2016-llncs.tex +++ b/examples/brucker-authorarchive-2016-llncs.tex @@ -1,7 +1,9 @@ \documentclass[final, runningheads, USenglish]{llncs} \usepackage[T1]{fontenc} -\usepackage[LNCS, +\usepackage{../authorarchive} +\authorsetup{ + LNCS, key=brucker-authorarchive-2016, year=2016, publication={Anonymous et al.\ (eds). Proceedings of the International @@ -11,8 +13,12 @@ doiText={0/00\_00}, orcidicon, nocopyright - ]{../authorarchive} +} +\authorsetup{ + publication={Anonymous 6\textsuperscript{th} et al.\ (eds). Proceedings of the International + Conference on LaTeX-Hacks, LNCS~42. Some Publisher}, +} \usepackage{lipsum} \title{A Simple Example of the \texttt{authorarchive} Package for \LaTeX} diff --git a/examples/brucker-authorarchive-2016-lni.tex b/examples/brucker-authorarchive-2016-lni.tex index 00bff6b..78b54a8 100644 --- a/examples/brucker-authorarchive-2016-lni.tex +++ b/examples/brucker-authorarchive-2016-lni.tex @@ -1,7 +1,9 @@ \documentclass[english]{lni} \usepackage[T1]{fontenc} \AtEndPreamble{ - \usepackage[LNI, + \usepackage{../authorarchive} + \authorsetup{ + LNI, key=brucker-authorarchive-2016, year=2016, publication={Anonymous et al.\ (eds). Proceedings of the International @@ -10,7 +12,7 @@ doi={00/00_00}, doiText={0/00\_00}, nocopyright - ]{../authorarchive} + } } \usepackage{lipsum} diff --git a/examples/brucker-authorarchive-2016.tex b/examples/brucker-authorarchive-2016.tex index b6f2ea3..99f5cdb 100644 --- a/examples/brucker-authorarchive-2016.tex +++ b/examples/brucker-authorarchive-2016.tex @@ -1,6 +1,7 @@ \documentclass[a4paper]{article} -\usepackage[ +\usepackage{../authorarchive} +\authorsetup{ key=brucker-authorarchive-2016, year=2016, publication={Anonymous et al.\ (eds). Proceedings of the International @@ -8,7 +9,7 @@ startpage={42}, doi={00/0000}, nocopyright - ]{../authorarchive} +} \usepackage{lipsum}