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 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.

share|improve this question
    
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
add comment

2 Answers

up vote 6 down vote accepted

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.

share|improve this answer
    
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
add comment

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?

See the titling package documentation for more info.

(Otherwise you’ll need to switch to a class that has its own mechanism for this, like memoir or KOMA script article.)

share|improve this answer
    
a vote up for referencing the 'titling' package which I didn't know about. –  wishihadabettername Aug 7 '10 at 17:42
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.