10

I've bee writing my own class for meeting notes, and I want to have an fbox with everyone who has attended the meeting, preferably in a list (itemize or my own custom list). Is there a way to do this in the title, so that the list is always rendered with the command \maketitle? I've seen plenty of variables defined in making your own "title page" (in quotes, because it won't be a page on its own), but no environments/lists.

MWE of what I'm after:

\documentclass{article}

\begin{document}
\begin{minipage}{0.6\linewidth}
  {\Huge Meeting}\\
  \today\\
  Start time: XX:XX\\
  End time: XX:XX
\end{minipage}
\fbox{
\begin{minipage}{0.4\linewidth}
  \textbf{Attendees}
  \begin{itemize}
    \item Member one
    \item Member two
    \item etc.
  \end{itemize}
\end{minipage}
}
%% End of the stuff I want the \maketitle command to create.
\end{document}

I want to know if it's possible to get the Attendee's included the same way title usually is e.g.

\title{Meeting}
\begin{attendees}
\item Member one
\item Member two
\item etc.
\end{attendees}
\starttime{XX:XX}
\endtime{XX:XX}
\maketitle

Any other ways of achieving the same thing in a class are welcome!

2

1 Answer 1

11

Here's one possible solution:

\documentclass{article}

\makeatletter
\def\stime#1{\gdef\@stime{#1}}
\def\etime#1{\gdef\@etime{#1}}
\def\attlist#1{\gdef\@attlist{#1}}

\def\@stime{\@latex@error{No start time given}\@ehc}
\def\@etime{\@latex@error{No end time given}\@ehc}
\def\@attlist{\@latex@error{No attendees list given}\@ehc}

\renewcommand\@maketitle{%
\par\noindent\begin{minipage}[t]{0.6\linewidth}
  {\Huge\@title\par\smallskip}
  \@date\\
  \begin{tabular}{@{}ll@{}}
  Start time: & \@stime\\
  End time: & \@etime
  \end{tabular}
\end{minipage}%
\fbox{%
\begin{minipage}[t]{\dimexpr0.4\linewidth-2\fboxsep-2\fboxrule\relax}
  \textbf{Attendees}
  \begin{itemize}
  \@for\temp@a:=\@attlist\do
    {\item \temp@a}
  \end{itemize}
\end{minipage}}\par\bigskip%
}
\renewcommand\maketitle{%
\if@twocolumn
  \twocolumn[\@maketitle]%
\else
  \@maketitle%
\fi%
}
\makeatother

\stime{08:00}
\etime{10:00}
\attlist{Member one, Member two, Member three, Member four}
\title{Meeting}
\date{\today}

\begin{document}

\maketitle

\end{document}

enter image description here

You provide the information using \stime (for the start time), \etime (for the end time) and \attlist (a comma separated list of all the attendees) in a fasion similar to the standard \author, \title commands. If those commands are not provided an error is generated and an informative text is shown in the output console and written in the .log file. Support for a two-column document has been also provided.

The relevant code is between \makeatletter, \makeatother since the example is a .tex file; those commands are not to be used inside a .sty or .cls file.

5
  • 2
    This is nearly to the letter the same I had when I realized you already answered. One should maybe add support for a twocolumn document, though, too. (Although - that probably depends one the expected use case in the end...)
    – cgnieder
    Dec 14, 2012 at 20:37
  • @cgnieder great minds think alike? ;-) You're right; I'll add support for a two column document in some minutes. Dec 14, 2012 at 20:41
  • At least they both had had a look into latex.ltx and article.cls before and knew where to start :)
    – cgnieder
    Dec 14, 2012 at 20:42
  • 1
    @cgnieder support for two-column documents added. Dec 14, 2012 at 21:04
  • Fantastic! Better than I'd imagined. Dec 14, 2012 at 23:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .