diff --git a/CHANGELOG.md b/CHANGELOG.md index bb92ea0d8f4c8877201a0274edd6de4878308f88..0223257f8b15885f469dc34572b18b0cf8a0fffd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. ## [Current] +### Breaking + +- Changed `\ifsingleauthor` to directly accept two arguments: `\ifsingleauthor{true}{false}` + This makes usage much easyser and ensures that spaces will not be gobbled up. + + Here is a regex to fix existing code: `(?<=\\ifsingleauthor)(\{.*?\})\\else(\{.*?\})\\fi(\\space)?` + which you can replace with `$1$2`. + ## [3.2] ### Fixed diff --git a/src/HsH-article.cls b/src/HsH-article.cls index dcbc0d87dc3daaf9cc3f9aed17fab8e7f455ec4d..a694c7f602373af42b130a83d472b25d8d1fb211 100644 --- a/src/HsH-article.cls +++ b/src/HsH-article.cls @@ -17,7 +17,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2022-06-01] \ProvidesClass{HsH-article} - [2024-04-26 3.01 HsH-class based on KOMA] + [2024-06-14 3.03.pre0 HsH-class based on KOMA] \let\HsHClassName\@currname \def\HsHClassName@ParrentClass{% scrartcl% @@ -358,15 +358,16 @@ }\par \endgroup } -\newif\ifsingleauthor +\newif\if@singleauthor \AtBeginDocument{ \begingroup \newcount\count@ \count@=\z@ \@for\tmp@:=\@author\do{\advance\count@\@ne} - \ifnum\count@>\@ne\global\singleauthorfalse\else\global\singleauthortrue\fi + \ifnum\count@>\@ne\global\@singleauthorfalse\else\global\@singleauthortrue\fi \endgroup } +\newcommand{\ifsingleauthor}[2]{\if@singleauthor#1\else#2\fi} \def\declarationAuthorship{% \ClassWarning{\HsHClassName}{% Command \string\declarationAuthorship\space is deprecate.\MessageBreak @@ -621,25 +622,23 @@ \newcaptionname{english}\decofauthname{Declaration of Authorship} \newcaptionname{german,ngerman}\decofauthname{Selbstst{\"a}ndigkeitserkl{\"a}rung} \newcaptionname{english}\decofauthtext{% - \ifsingleauthor{I}\else{We}\fi\space hereby certify that the work - \ifsingleauthor{I}\else{we}\fi\space \ifsingleauthor am\else are\fi - submitting is entirely of \ifsingleauthor{my}\else{our}\fi own making - except where otherwise indicated. \ifsingleauthor{I}\else{We}\fi - \ifsingleauthor{am}\else{are}\fi\space aware of regulations concerning - plagiarism, including disciplinary actions that may result from it. Any - use of the works of any other author, in any form, is properly - acknowledged at their point of use. + \ifsingleauthor{I}{We} hereby certify that the work \ifsingleauthor{I}{we} + \ifsingleauthor{am}{are} submitting is entirely of \ifsingleauthor{my}{our} + own making except where otherwise indicated. \ifsingleauthor{I}{We} + \ifsingleauthor{am}{are} aware of regulations concerning plagiarism, + including disciplinary actions that may result from it. Any use of the + works of any other author, in any form, is properly acknowledged at + their point of use. } \newcaptionname{german,ngerman}\decofauthtext{% - Hiermit best{\"a}tige\ifsingleauthor\else{n}\fi - \ifsingleauthor{ich}\else{wir}\fi, dass die folgende Arbeit eigenst{\"a}ndig - von \ifsingleauthor{mir}\else{uns}\fi\space allein erstellt und unter - Ber{\"u}cksichtigung der zur Verf{\"u}gung gestellten Aufgabenstellung sowie - dem Arbeitsmaterial unter Angabe aller verwendeten Quellen erarbeitet wurde. - Die Regelungen und Konsequenzen eines Plagiats, inklusive disziplinarischer - Ma{\ss}nahmen, sind \ifsingleauthor{mir}\else{uns}\fi\space bewusst. - Insbesondere wurden alle Zitate und gedanklichen {\"U}bernahmen als - solche kenntlich gemacht. + Hiermit best{\"a}tige\ifsingleauthor{}{n} \ifsingleauthor{ich}{wir}, + dass die folgende Arbeit eigenst{\"a}ndig von \ifsingleauthor{mir}{uns} + allein erstellt und unter Ber{\"u}cksichtigung der zur Verf{\"u}gung + gestellten Aufgabenstellung sowie dem Arbeitsmaterial unter Angabe aller + verwendeten Quellen erarbeitet wurde. Die Regelungen und Konsequenzen + eines Plagiats, inklusive disziplinarischer Ma{\ss}nahmen, sind + \ifsingleauthor{mir}{uns} bewusst. Insbesondere wurden alle Zitate und + gedanklichen {\"U}bernahmen als solche kenntlich gemacht. } \newcaptionname{english}\keywordsname{Keywords} \newcaptionname{german,ngerman}\keywordsname{Schl{\"u}sselw{\"o}rter} diff --git a/src/HsH-classes.dtx b/src/HsH-classes.dtx index 2359eb9a32c85321b941300cf14a69bc66948073..6d1a34ef51b40a3ed0e29a19887a1e2a80412f44 100644 --- a/src/HsH-classes.dtx +++ b/src/HsH-classes.dtx @@ -74,7 +74,7 @@ http://www.latex-project.org/lppl.txt %<report>\ProvidesClass{HsH-report} %<standalone>\ProvidesClass{HsH-standalone} %<*article|report|standalone> - [2024-05-02 3.02 HsH-class based on KOMA] + [2024-06-14 3.03.pre0 HsH-class based on KOMA] %</article|report|standalone> %<*driver> ^^A ---------- documentation driver ----------------------------------------- \documentclass{ltxdoc} @@ -395,6 +395,16 @@ http://www.latex-project.org/lppl.txt % |\maketitle|\oarg{align}. You can pass \opt{l\OR c\OR r} to get \emph{left}, % \emph{center} or \emph{right} alignment. % +% \subsection{Micalanious commands} +% The following commands are mostly for internal use, but are parte of the interface +% and might be usefull in some cases. +% \medskip +% +% \DescribeMacro{\ifsingleauthor} +% This allows you to check if |\author| holds one or multiple entries. Using this +% allows the user to display differernt things for these cases, for example switch +% words to pural, like this: +% |\ifsingleauthor{one}{multiple} person\ifsingleauthor{}{s}| % %\section{Package laoding} % The classes load some packges for internal use as well as loading and configuring @@ -1269,23 +1279,31 @@ http://www.latex-project.org/lppl.txt % \end{macrocode} % \end{macro} % -% \begin{macro}{\ifsingleauthor} +% \begin{macro}{\if@singleauthor} % To ensure |\decofauthtext| is preperly spelled for one or multiple authors, we % define a conditional that holds this information. Additionally we check the % number of authors |\AtBeginDocument| and store it. % \begin{macrocode} -\newif\ifsingleauthor +\newif\if@singleauthor \AtBeginDocument{ \begingroup \newcount\count@ \count@=\z@ \@for\tmp@:=\@author\do{\advance\count@\@ne} - \ifnum\count@>\@ne\global\singleauthorfalse\else\global\singleauthortrue\fi + \ifnum\count@>\@ne\global\@singleauthorfalse\else\global\@singleauthortrue\fi \endgroup } % \end{macrocode} % \end{macro} % +% \begin{macro}{\ifsingleauthor} +% A macro to simply act on this condition is also provided. It will be used in +% text-definitions later on. +% \begin{macrocode} +\newcommand{\ifsingleauthor}[2]{\if@singleauthor#1\else#2\fi} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\declarationAuthorship} % \begin{macrocode} \def\declarationAuthorship{% @@ -1820,25 +1838,23 @@ http://www.latex-project.org/lppl.txt % Define the german translations for the command. % \begin{macrocode} \newcaptionname{english}\decofauthtext{% - \ifsingleauthor{I}\else{We}\fi\space hereby certify that the work - \ifsingleauthor{I}\else{we}\fi\space \ifsingleauthor am\else are\fi - submitting is entirely of \ifsingleauthor{my}\else{our}\fi own making - except where otherwise indicated. \ifsingleauthor{I}\else{We}\fi - \ifsingleauthor{am}\else{are}\fi\space aware of regulations concerning - plagiarism, including disciplinary actions that may result from it. Any - use of the works of any other author, in any form, is properly - acknowledged at their point of use. + \ifsingleauthor{I}{We} hereby certify that the work \ifsingleauthor{I}{we} + \ifsingleauthor{am}{are} submitting is entirely of \ifsingleauthor{my}{our} + own making except where otherwise indicated. \ifsingleauthor{I}{We} + \ifsingleauthor{am}{are} aware of regulations concerning plagiarism, + including disciplinary actions that may result from it. Any use of the + works of any other author, in any form, is properly acknowledged at + their point of use. } \newcaptionname{german,ngerman}\decofauthtext{% - Hiermit best{\"a}tige\ifsingleauthor\else{n}\fi - \ifsingleauthor{ich}\else{wir}\fi, dass die folgende Arbeit eigenst{\"a}ndig - von \ifsingleauthor{mir}\else{uns}\fi\space allein erstellt und unter - Ber{\"u}cksichtigung der zur Verf{\"u}gung gestellten Aufgabenstellung sowie - dem Arbeitsmaterial unter Angabe aller verwendeten Quellen erarbeitet wurde. - Die Regelungen und Konsequenzen eines Plagiats, inklusive disziplinarischer - Ma{\ss}nahmen, sind \ifsingleauthor{mir}\else{uns}\fi\space bewusst. - Insbesondere wurden alle Zitate und gedanklichen {\"U}bernahmen als - solche kenntlich gemacht. + Hiermit best{\"a}tige\ifsingleauthor{}{n} \ifsingleauthor{ich}{wir}, + dass die folgende Arbeit eigenst{\"a}ndig von \ifsingleauthor{mir}{uns} + allein erstellt und unter Ber{\"u}cksichtigung der zur Verf{\"u}gung + gestellten Aufgabenstellung sowie dem Arbeitsmaterial unter Angabe aller + verwendeten Quellen erarbeitet wurde. Die Regelungen und Konsequenzen + eines Plagiats, inklusive disziplinarischer Ma{\ss}nahmen, sind + \ifsingleauthor{mir}{uns} bewusst. Insbesondere wurden alle Zitate und + gedanklichen {\"U}bernahmen als solche kenntlich gemacht. } % \end{macrocode} % \end{macro} diff --git a/src/HsH-classes.pdf b/src/HsH-classes.pdf index e838e9f960a402c12a0ecf35b8f40292a8cbe3c9..01b6cceaf874b69fe340bc9458e3c58e52f3e320 100644 --- a/src/HsH-classes.pdf +++ b/src/HsH-classes.pdf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fb61ed5a06123e4c93a0d6e2cc52c0db4cb3bacbf4ac7dcd32ec0f789a613b68 -size 312304 +oid sha256:46d26e61a39a7109757c570977c1019156b479faab5ad405ca842a0b4d455fff +size 313899 diff --git a/src/HsH-report.cls b/src/HsH-report.cls index 9e54599942512ccd966c6d8d1bc0d80f14830273..82b5dc439c1c6c93d9398ea80290d651ff1d13b3 100644 --- a/src/HsH-report.cls +++ b/src/HsH-report.cls @@ -17,7 +17,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2022-06-01] \ProvidesClass{HsH-report} - [2024-04-26 3.01 HsH-class based on KOMA] + [2024-06-14 3.03.pre0 HsH-class based on KOMA] \let\HsHClassName\@currname \def\HsHClassName@ParrentClass{% scrreprt% @@ -371,15 +371,16 @@ }\par \endgroup } -\newif\ifsingleauthor +\newif\if@singleauthor \AtBeginDocument{ \begingroup \newcount\count@ \count@=\z@ \@for\tmp@:=\@author\do{\advance\count@\@ne} - \ifnum\count@>\@ne\global\singleauthorfalse\else\global\singleauthortrue\fi + \ifnum\count@>\@ne\global\@singleauthorfalse\else\global\@singleauthortrue\fi \endgroup } +\newcommand{\ifsingleauthor}[2]{\if@singleauthor#1\else#2\fi} \def\declarationAuthorship{% \ClassWarning{\HsHClassName}{% Command \string\declarationAuthorship\space is deprecate.\MessageBreak @@ -691,25 +692,23 @@ \newcaptionname{english}\decofauthname{Declaration of Authorship} \newcaptionname{german,ngerman}\decofauthname{Selbstst{\"a}ndigkeitserkl{\"a}rung} \newcaptionname{english}\decofauthtext{% - \ifsingleauthor{I}\else{We}\fi\space hereby certify that the work - \ifsingleauthor{I}\else{we}\fi\space \ifsingleauthor am\else are\fi - submitting is entirely of \ifsingleauthor{my}\else{our}\fi own making - except where otherwise indicated. \ifsingleauthor{I}\else{We}\fi - \ifsingleauthor{am}\else{are}\fi\space aware of regulations concerning - plagiarism, including disciplinary actions that may result from it. Any - use of the works of any other author, in any form, is properly - acknowledged at their point of use. + \ifsingleauthor{I}{We} hereby certify that the work \ifsingleauthor{I}{we} + \ifsingleauthor{am}{are} submitting is entirely of \ifsingleauthor{my}{our} + own making except where otherwise indicated. \ifsingleauthor{I}{We} + \ifsingleauthor{am}{are} aware of regulations concerning plagiarism, + including disciplinary actions that may result from it. Any use of the + works of any other author, in any form, is properly acknowledged at + their point of use. } \newcaptionname{german,ngerman}\decofauthtext{% - Hiermit best{\"a}tige\ifsingleauthor\else{n}\fi - \ifsingleauthor{ich}\else{wir}\fi, dass die folgende Arbeit eigenst{\"a}ndig - von \ifsingleauthor{mir}\else{uns}\fi\space allein erstellt und unter - Ber{\"u}cksichtigung der zur Verf{\"u}gung gestellten Aufgabenstellung sowie - dem Arbeitsmaterial unter Angabe aller verwendeten Quellen erarbeitet wurde. - Die Regelungen und Konsequenzen eines Plagiats, inklusive disziplinarischer - Ma{\ss}nahmen, sind \ifsingleauthor{mir}\else{uns}\fi\space bewusst. - Insbesondere wurden alle Zitate und gedanklichen {\"U}bernahmen als - solche kenntlich gemacht. + Hiermit best{\"a}tige\ifsingleauthor{}{n} \ifsingleauthor{ich}{wir}, + dass die folgende Arbeit eigenst{\"a}ndig von \ifsingleauthor{mir}{uns} + allein erstellt und unter Ber{\"u}cksichtigung der zur Verf{\"u}gung + gestellten Aufgabenstellung sowie dem Arbeitsmaterial unter Angabe aller + verwendeten Quellen erarbeitet wurde. Die Regelungen und Konsequenzen + eines Plagiats, inklusive disziplinarischer Ma{\ss}nahmen, sind + \ifsingleauthor{mir}{uns} bewusst. Insbesondere wurden alle Zitate und + gedanklichen {\"U}bernahmen als solche kenntlich gemacht. } \newcaptionname{english}\keywordsname{Keywords} \newcaptionname{german,ngerman}\keywordsname{Schl{\"u}sselw{\"o}rter} diff --git a/src/HsH-standalone.cls b/src/HsH-standalone.cls index d7b88ee86bafaec4e360facd60c3322ba1ba710e..b2a001913dddd0d67b8fd981d522a4964a02b948 100644 --- a/src/HsH-standalone.cls +++ b/src/HsH-standalone.cls @@ -17,7 +17,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2022-06-01] \ProvidesClass{HsH-standalone} - [2024-04-26 3.01 HsH-class based on KOMA] + [2024-06-14 3.03.pre0 HsH-class based on KOMA] \let\HsHClassName\@currname \def\HsHClassName@ParrentClass{% standalone% @@ -194,15 +194,16 @@ }\par \endgroup } -\newif\ifsingleauthor +\newif\if@singleauthor \AtBeginDocument{ \begingroup \newcount\count@ \count@=\z@ \@for\tmp@:=\@author\do{\advance\count@\@ne} - \ifnum\count@>\@ne\global\singleauthorfalse\else\global\singleauthortrue\fi + \ifnum\count@>\@ne\global\@singleauthorfalse\else\global\@singleauthortrue\fi \endgroup } +\newcommand{\ifsingleauthor}[2]{\if@singleauthor#1\else#2\fi} \def\declarationAuthorship{% \ClassWarning{\HsHClassName}{% Command \string\declarationAuthorship\space is deprecate.\MessageBreak @@ -243,25 +244,23 @@ \newcaptionname{english}\decofauthname{Declaration of Authorship} \newcaptionname{german,ngerman}\decofauthname{Selbstst{\"a}ndigkeitserkl{\"a}rung} \newcaptionname{english}\decofauthtext{% - \ifsingleauthor{I}\else{We}\fi\space hereby certify that the work - \ifsingleauthor{I}\else{we}\fi\space \ifsingleauthor am\else are\fi - submitting is entirely of \ifsingleauthor{my}\else{our}\fi own making - except where otherwise indicated. \ifsingleauthor{I}\else{We}\fi - \ifsingleauthor{am}\else{are}\fi\space aware of regulations concerning - plagiarism, including disciplinary actions that may result from it. Any - use of the works of any other author, in any form, is properly - acknowledged at their point of use. + \ifsingleauthor{I}{We} hereby certify that the work \ifsingleauthor{I}{we} + \ifsingleauthor{am}{are} submitting is entirely of \ifsingleauthor{my}{our} + own making except where otherwise indicated. \ifsingleauthor{I}{We} + \ifsingleauthor{am}{are} aware of regulations concerning plagiarism, + including disciplinary actions that may result from it. Any use of the + works of any other author, in any form, is properly acknowledged at + their point of use. } \newcaptionname{german,ngerman}\decofauthtext{% - Hiermit best{\"a}tige\ifsingleauthor\else{n}\fi - \ifsingleauthor{ich}\else{wir}\fi, dass die folgende Arbeit eigenst{\"a}ndig - von \ifsingleauthor{mir}\else{uns}\fi\space allein erstellt und unter - Ber{\"u}cksichtigung der zur Verf{\"u}gung gestellten Aufgabenstellung sowie - dem Arbeitsmaterial unter Angabe aller verwendeten Quellen erarbeitet wurde. - Die Regelungen und Konsequenzen eines Plagiats, inklusive disziplinarischer - Ma{\ss}nahmen, sind \ifsingleauthor{mir}\else{uns}\fi\space bewusst. - Insbesondere wurden alle Zitate und gedanklichen {\"U}bernahmen als - solche kenntlich gemacht. + Hiermit best{\"a}tige\ifsingleauthor{}{n} \ifsingleauthor{ich}{wir}, + dass die folgende Arbeit eigenst{\"a}ndig von \ifsingleauthor{mir}{uns} + allein erstellt und unter Ber{\"u}cksichtigung der zur Verf{\"u}gung + gestellten Aufgabenstellung sowie dem Arbeitsmaterial unter Angabe aller + verwendeten Quellen erarbeitet wurde. Die Regelungen und Konsequenzen + eines Plagiats, inklusive disziplinarischer Ma{\ss}nahmen, sind + \ifsingleauthor{mir}{uns} bewusst. Insbesondere wurden alle Zitate und + gedanklichen {\"U}bernahmen als solche kenntlich gemacht. } \newcaptionname{english}\keywordsname{Keywords} \newcaptionname{german,ngerman}\keywordsname{Schl{\"u}sselw{\"o}rter} diff --git a/test.pdf b/test.pdf index a115d653465d36cee6f5cba9081fa20cbc5db416..57c05de98e42c7f8670db75e596e34550426db09 100644 --- a/test.pdf +++ b/test.pdf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fda71a675427ab94927a6d89d295f3b24ef41c2196653f1d63e903304b616962 -size 238691 +oid sha256:9b6b7de03c45c0bbfb574163244db23a16043865028914163b61f57542abb078 +size 239184 diff --git a/test.tex b/test.tex index 9d2cc068156bcec9f57be89c6731dd17a909d2b8..e1e985090f3e0a77c49274083beae60dbff76396 100644 --- a/test.tex +++ b/test.tex @@ -37,6 +37,9 @@ Hällo\todo{drop the Ä?} "Welt", ist daß nicht schön? $3.1$ oder $3,2$ + This paper was written by \ifsingleauthor{one}{many} person\ifsingleauthor{}{s}. + Isn't it great that \ifsingleauthor{he}{they} did that? + \begin{equation} A_1 = \sum_{i=0}^{10} B_i + \abs{\frac{x}{2}} \end{equation}