Tell me more ×
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.

Hey guys I'm totally new to this and I guess I'm asking for something that kind of defeats the purpose of LaTeX, but maybe not..

Anyways, how can I make a title after I have used \hfill to make a header (like in regular MLA format papers written on Word). This is what I have so far:

\documentclass[11pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{fancyhdr}

\begin{document}

\hfill My Name

\hfill Name of Class I'm Taking

\hfill The Date

\hfill The Professor

\title{The Title of the Homework Assignment}

\end{document} 

Any way I could make the title centered and appear more title-like?

share|improve this question
Welcome to TeX.sx! No need to add thanks, simply upvote any good answers you may receive to credit the help. – Peter Jansson Feb 21 at 10:42

closed as too localized by Frank Mittelbach, Thorsten, lockstep, Stefan Kottwitz Apr 7 at 8:48

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

1 Answer

the \title command you're using doesn't actually typeset the title. I guess what you're looking for is \maketitle.

\documentclass{article}
\begin{document}
\title{The Title of the Homework Assignment}
\maketitle
\end{document} 

see also http://en.wikibooks.org/wiki/LaTeX/Title_Creation


edit

I realized you basically have two questions: (1) how to prevent the page break before \maketitle, and (2) how to give the title a more title-like look.

As for (1), I suggest you abandon \title, \maketitle altogether and use the titlepage environment instead. I've been using *TeX for 12 years now and never found a particular reason to use these.

As for (2), the answer depends on typographic taste to some degree. I, for one, would really disadvise against what you're trying to do -- for what you're trying to do is mix no less than three types of text alignment within one or two pages: left, center, right. For my money, the basis for a decent titlepage is something like this:

\documentclass[11pt]{article}

\begin{document}
\begin{titlepage}
\begin{raggedright}
My Name\\
Name of Class I'm Taking\\
The Date\\
The Professor\\[3\baselineskip]
\textsf{\textbf{The Title of the Homework Assignment}}\\
\textsf{Subtitle of the Homework Assignment}\\
\vfill
Some Additional information if desired
\end{raggedright}
\end{titlepage}
\end{document}

...but I'm a minimalist; other people might disagree and, e.g., increase the title's font size (\large). Some people might feel like giving their titlepage a 19th-century look, using \begin...end{center} instead of raggedright -- and center page numbers and headings in the rest of the document as well for consistency.

share|improve this answer
Thanks for the reply! I've tried including the \maketitle but it still won't show up after I've used the \hfill commands. Is there any way I could just center a line and make the font give it more a title look? – Joe M Feb 21 at 10:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.