Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I searched all morning to do this.

I want to insert in my custom title page the date, author, title set 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}
share|improve this question

migrated from stackoverflow.com Sep 27 '12 at 14:25

This question came from our site for professional and enthusiast programmers.

    
Does your title page already with these commands? –  Jonno_FTW Jun 29 '10 at 13:43
    
A default title pages contains that , but not a custom one with \begin{titlepage} –  pastjean Jun 29 '10 at 17:40
    
Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Sep 27 '12 at 14:45
add comment

3 Answers 3

up vote 5 down vote accepted

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}
share|improve this answer
    
I'll try redefining maketitle like you say , what is the difference when there is a @ after the \ –  pastjean Jun 29 '10 at 17:41
1  
add comment

Implementation with datetime

If you are not using todays date, it is often wished to use the package datetime which provides many features concerning dates and their formats:

\documentclass{article}
\usepackage{datetime}
\newdate{date}{06}{09}{2012}
\date{\displaydate{date}}

\begin{document}
\maketitle
We discussed in the question session on \displaydate{date} unimportant stuff.
\end{document}

I hope the provided code helps people for their desired aim.

share|improve this answer
add comment

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.

share|improve this answer
    
This would work but i will try the way Aniko says, maybe mix it with yours –  pastjean Jun 29 '10 at 17:42
    
Welcome to TeX.sx! Your answer was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or edit your answer. –  Werner Sep 27 '12 at 14:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.