# How to right-align a title (without creating a complete custom title page)?

I suppose this is a simple matter, but I'm still finding my way around where to put things in LaTeX.

I would like to right-align (i.e. flush to right) the contents of an article's title page. By default it's centered. My preamble (leaving out other stuff) is basic:

\documentclass[12pt,titlepage]{article}
\title{My Title}
\author{This is me}
\date{Aug 2010}


I read in the LaTeX wikibook (wonderful resource) that one way to do that is to create a custom title within

\begin{titlepage} ...
\begin{flushright}
% title elements here
\end{flushright}
\end{titlepage}.


But this is a heavy-handed solution and I hope there is a simpler way.

Thank you.

-
I thought I had an answer for you, but it ran into trouble. You might want to look at any answers to the question I asked about it. –  vanden Aug 7 '10 at 4:33
I don't thing your solution is heavy-handed. The standard \maketitle macro was meant to provide a rather inflexible way to produce titles, and the titlepage environment is intended exactly for what you want to do. –  Joseph Wright Aug 7 '10 at 5:49

A dirty solution would be:

\begingroup
\let\center\flushright
\let\endcenter\endflushright
\maketitle
\endgroup


Then it would be right aligned, the author, as it is in a table, not quite. Here you can just define the author like this: \author{This is me\hspace*{-\tabcolsep}}.

But I personally would use the titling package, as frabjous already suggested.

-
Dirty hack, but indeed gets the job done! Although I wouldn't recommend going around and writing this for every new document, as a one-off hack I really like it! –  Juan A. Navarro Aug 7 '10 at 10:29
interesting hack, it works indeed :) –  wishihadabettername Aug 7 '10 at 17:42
I really like it as a hack; rather than rewriting the code for the titlepage you change its meaning. IMO this is dirty and clean at the same time (dirty because the original code has a different meaning than it'll seem to have, looking at it, but clean because you're not copy-pasting/rewriting its functionality). Kudos! –  Giel Aug 7 '10 at 18:32

I’m not sure this is really “easier”, but how about something like:

\usepackage{titling}
\pretitle{\begin{flushright}\LARGE}
\posttitle{\par\end{flushright}\vskip 0.5em}
\preauthor{\begin{flushright}\large \lineskip 0.5em}
\postauthor{\par\end{flushright}}
\predate{\begin{flushright}\large}
\postdate{\par\end{flushright}}


along with the regular \maketitle command?