Adding text before the document title

5,123 views
Skip to first unread message

Harsh Pathak

unread,
May 8, 2012, 9:00:41 AM5/8/12
to LaTeX Users Group
I want to add some text before the document title. Here is an example
from the document i am creating

\documentclass[10pt](article)
\title{ This is a sample}
\date{}

\begin{document}
\maketitle

<some text and paragraphs here>

\end{document}

Now I want to add a right aligned text before the title and keep it on
the same page. I tried using \hfill{} but the \maketitle command by
defualt creates the title on new page

What i want is:

<some text>
This is a
sample


Can anyone please help me out?

Bruno Lopes

unread,
May 8, 2012, 9:04:30 AM5/8/12
to latexus...@googlegroups.com
Hello!

Just put your text between \begin{flushright} \end{flushright}.

Cheers,

Bruno.


--
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To post to this group, send email to latexus...@googlegroups.com.
To unsubscribe from this group, send email to latexusersgro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/latexusersgroup?hl=en.




--
Bruno Lopes
www.tecmf.inf.puc-rio.br/BrunoLopes
--
"Never express yourself more clearly than you are able to think."
(Niels Bohr)

Werner Grundlingh

unread,
May 8, 2012, 11:46:43 AM5/8/12
to latexus...@googlegroups.com
In the article document class, \maketitle merely sets the contents of \@author, \@title and \@date (created by \author, \title and \date) in a neat way. You can place anything before it without it affecting \maketitle. Therefore, use Bruno's suggestion, but you also need to remove the \newpage issued by \maketitle. The easiest way to do so is to use grouping, which allows for a temporary change to some macro (\newpage in this case):

\begin{flushright}
  <your content goes here>
\end{flushright}

\begingroup
\let\newpage\relax% Void the actions of \newpage
\maketitle
\endgroup

Peter Flynn

unread,
May 8, 2012, 1:41:12 PM5/8/12
to latexus...@googlegroups.com

If you want the text in every page, it's called a "running header" and  you do it with the fancyhdr package.

It is very rare to put this on a title page, but perfectly possible.

P

Reply all
Reply to author
Forward
0 new messages