Skip to content
Snippets Groups Projects
Commit 2e3297c9 authored by Jan Wille's avatar Jan Wille
Browse files

allow for `\and` to be used

IN typical LaTeX, the `\and` command is used inside `\author` to separate multiple authors, this allows for that.
parent ebf2dc32
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,10 @@ All notable changes to this project will be documented in this file.
Here is a regex to fix existing code: `(?<=\\ifsingleauthor)(\{.*?\})\\else(\{.*?\})\\fi(\\space)?`
which you can replace with `$1$2`.
### Added
- Using the `\and` command inside `\author` or `\matrikelnr` now works as expected (#21)
## [3.2]
### Fixed
......
No preview for this file type
......@@ -312,13 +312,15 @@
}
}
}
\let\@author\@empty
\renewcommand{\title}[2][]{
\gdef\@title{#2}
\gdef\@shorttitle{#1}
}
\def\@shorttitle{\@empty}
\newcommand{\matrikelnr}[1]{\gdef\@matrikelnr{#1}}
\def\gdef@with@and@as@comma#1#2{{\def\and{,}\xdef#1{#2}}}
\renewcommand{\author}[1]{\gdef@with@and@as@comma\@author{#1}}
\let\@author\@empty
\newcommand{\matrikelnr}[1]{\gdef@with@and@as@comma\@matrikelnr{#1}}
\def\@matrikelnr{\@empty}
\newcommand{\professor}[1]{\gdef\@professor{#1}}
\def\@professor{\@empty}
......
......@@ -1160,12 +1160,6 @@ http://www.latex-project.org/lppl.txt
% how the user can define the differnt datafields.
% \smallskip
%
% First the |\@author| macro is set to |\@empty|, this makes it easyer to handle it
% later.
% \begin{macrocode}
\let\@author\@empty
% \end{macrocode}
%
% \begin{macro}{\title}
% We redefine the |\title| command to take a optional argument. This is stored in
% the additional |\@shorttitle| macro.
......@@ -1185,11 +1179,33 @@ http://www.latex-project.org/lppl.txt
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\gdef@with@and@as@comma}
% First we define a helpermacro that will fill a given macro while treating the
% |\and| command as a comma. This is needed for |\author| and |\matrikelnr| where
% we later treat them as comma-seperated lists when the titlepage gets constructed.
% \begin{macrocode}
\def\gdef@with@and@as@comma#1#2{{\def\and{,}\xdef#1{#2}}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\author}
% We redefine the |\author| command so that it sets |\@author|, but allowing for both
% comma and |\and| to be used as a seperator.
% \begin{macrocode}
\renewcommand{\author}[1]{\gdef@with@and@as@comma\@author{#1}}
% \end{macrocode}
% The |\@author| macro is also set to |\@empty|, this makes it easier to handle it
% later.
% \begin{macrocode}
\let\@author\@empty
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\matrikelnr,\@matrikelnr}
% These macros set and store the matrikel-number (or set of numbers), which will
% be printed on the titlepage.
% \begin{macrocode}
\newcommand{\matrikelnr}[1]{\gdef\@matrikelnr{#1}}
\newcommand{\matrikelnr}[1]{\gdef@with@and@as@comma\@matrikelnr{#1}}
\def\@matrikelnr{\@empty}
% \end{macrocode}
% \end{macro}
......
No preview for this file type
......@@ -325,13 +325,15 @@
}
}
}
\let\@author\@empty
\renewcommand{\title}[2][]{
\gdef\@title{#2}
\gdef\@shorttitle{#1}
}
\def\@shorttitle{\@empty}
\newcommand{\matrikelnr}[1]{\gdef\@matrikelnr{#1}}
\def\gdef@with@and@as@comma#1#2{{\def\and{,}\xdef#1{#2}}}
\renewcommand{\author}[1]{\gdef@with@and@as@comma\@author{#1}}
\let\@author\@empty
\newcommand{\matrikelnr}[1]{\gdef@with@and@as@comma\@matrikelnr{#1}}
\def\@matrikelnr{\@empty}
\newcommand{\professor}[1]{\gdef\@professor{#1}}
\def\@professor{\@empty}
......
No preview for this file type
......@@ -6,9 +6,13 @@
%% documents personal data:
\author{
Max Mustermann,
Max Mustermann \and
Mira Musterfrau
}
\matrikelnr{
12345678,
12345
}
\titlehead{titlehead}
\subject{Subject}
\title{long and elaborate title that just goes on and on without stopping}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment