views:

206

answers:

2

Hi, I searched all morning to do this.

I want to insert in my custom title page the date , author , title setted with the following commands

\date{The date}
\author{Me \and Other}
\title{the document title}

I want to insert those in my document anywhere (and my custom title page)


Solution

\makeatletter
\@date
\@title
\makeatother

For the authors you put it in a tabular

\begin{tabular}[t]{c}\@author \end{tabular}
+1  A: 

I have been searching this today as well. Too bad now google points here. So I sucked it up ad partially resolved by doing:

\newcommand{\authorname}{Andrea Ratto}
\title{\authorname: Curriculum Vitae}
\author{\authorname}

... Curriculum vitae of \authorname ...

Does not work for dates using \today apparently.

Andrea R
This would work but i will try the way Aniko says, maybe mix it with yours
pastjean
+1  A: 

It is not quite clear what exactly do you want to do. Usually the title is created by using \maketitle at the point of the document where you want to insert it. However it will be formatted whichever way your documentclass defines it. Redefining it is, of course, possible: you have to define \@maketitle appropriately, in which you can refer to \@title, etc.

However if you are not writing your own class, there might not be much of a point doing this. If you just want a title page, you don't have to use the \title etc commands, just put in the title whichever way you want. There is also a \begin{titlepage} - \end{titlepage} environment for creating a custom titlepage, but again, it does not use the \title command.

EDIT:

Yet another indirect option (along the lines of Andrea R's solution): define your own \thedate, \thetitle, etc commands using \newcommand, and then just use it in the titlepage:

\newcommand{\thedate}{\today}
\newcommand{\thetitle}{Your title}
...
\begin{titlepage}
   \centering\textbf{\thetitle}
\end{titlepage}
Aniko
I'll try redefining maketitle like you say , what is the difference when there is a @ after the \
pastjean
See http://www.tex.ac.uk/cgi-bin/texfaq2html?label=atsigns and http://www.tex.ac.uk/cgi-bin/texfaq2html?label=ltxcmds
Aniko