GeneralUsing author's name multiple times

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
napbaioneta
Posts: 2
Joined: Fri Aug 24, 2012 1:01 pm

Using author's name multiple times

Post by napbaioneta »

Hi,

My question is the following:
is there a way(other than \maketitle to show the content of \author or \title?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Using author's name multiple times

Post by josephwright »

The standard classes save the authors as \@author and the title as \@title. These can be used before \maketitle, but are cleared by it (for historical reasons). Depending on what you want to do, you may need to redefine \author and \title to save the information somewhere that won't get cleared.
Joseph Wright
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Using author's name multiple times

Post by cgnieder »

Hi napbaioneta,

Welcome to the LaTeX community.

Here is an example of how a redefinition could look like:

Code: Select all

\documentclass{article}

\makeatletter
\def\author#1{\gdef\@author{#1}\gdef\showauthor{#1}}
\makeatother

\title{Some title}
\author{napbaioneta}

\begin{document}
\maketitle

Author is \showauthor

\end{document}
Regards
site moderator & package author
napbaioneta
Posts: 2
Joined: Fri Aug 24, 2012 1:01 pm

Re: Using author's name multiple times

Post by napbaioneta »

thank you, that worked just as I wanted it to work ;)
Post Reply