Text FormattingDate and Title on same line?

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Date and Title on same line?

Post by ghostanime2001 »

How can I put the date and the title on a single line but one centered and another flushright? I used the flushright environment to put the date aligned on the right margin as is shown in my code file.

Code: Select all

\documentclass[fleqn]{article}
\usepackage{fullpage}
\usepackage[margin=1in]{geometry}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage[version=3]{mhchem}
\usepackage[makeroom]{cancel}
\usepackage{siunitx}
\pagestyle{empty}
\sisetup{%
  output-decimal-marker={.},
  load-configurations=abbreviations,
  group-separator={,},
  per-mode=fraction,
  fraction-function=\sfrac}
\usepackage{fix-cm}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
\begin{document}
\sffamily
\begin{flushright}
Tuesday, April 16, 2007
\end{flushright}
\begin{list}{-}{}
\item very, very, very large number (\num{6.02e23}) in the same way that dozen is also a number (12); a fixed number
\item symbol for mol is ``n''
\item Molar mass is the weight (g) of an element as indicated on Periodic Table.
\item unit g/mol or \si{g$\cdot$mol^{-}} \\*
e.g Mg$\rightarrow$\SI{24.3}{g/mol^{-}}
\item Two decimal places for molar masses.
\end{list}
e.g Consider a 3.00 mol sample Zinc Chlorate|
\end{document}
Last edited by ghostanime2001 on Sun Jun 26, 2011 12:15 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Date and Title on same line?

Post by Stefan Kottwitz »

This line centers by \hfill and uses \llap to print a zero-width box, which results in a centered title and a right aligned date:

Code: Select all

\hfill Title\hfill\llap{Tuesday, April 16, 2007}\\
Stefan
LaTeX.org admin
Post Reply