[Tex/LaTex] How to add a few additional lines to title (without using titlepage)

titles

I just want to add my class and professor information to title. I don't want to use a page break.

I want title like this and right aligned:

Anthony Sample

Intro to Expos

Prof. Selinsky

Summary: Draft

How to achieve this? Any help is appreciated.

\documentclass[12pt]{article}
\begin{document}

\title{}
\author{}
\date{}

\end{document}

Best Answer

Does this do what you want?

\documentclass[12pt]{article}
\title{\hfill Anthony Sample\\
\ \\
\hfill Intro to Expos\\
\ \\
\hfill Prof. Selinsky\\
\ \\
\hfill Summary: Draft}
\date{\hfill\today}
\begin{document}
\maketitle
\end{document}

The key ideas are:

  • You can put just about anything you want in \title{}.
  • Line breaks can be added with \\ (as in Werner's suggestion).
  • You need to put something on a line in order to add \\, so I use \ to add a hard space before \\ when I want to create a blank line.
  • \hfill tries to fill up as much space as possible. By putting it before the text on a line, it pushes the text all the way to the right.

The same points apply to \date{}, but \author{} seems to be less flexible.