# Why is my document entirely right-aligned?

I usually don't spend too much time on formatting of LaTeX documents, so this is probably easy and I apologize. I've changed my document from a twocolumn class to a onecolumn class, and all of a sudden my document is right-aligned, making many of the tables run off the page. As an example, this is a screenshot:

Why is it doing that? Here is my code at the top of my document:

\documentclass[times, 10pt,onecolumn]{article}
\usepackage{latex12}
\usepackage{times}
\usepackage{balance}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{verbatim}
\usepackage{graphicx}


Thanks for any help

Edit: The contents of latex12.sty:

\typeout{IEEE 8.5 x 11-Inch Proceedings Style latex8.sty'.}
\font\tenhv  = phvb7t at 10pt
\font\elvbf  = cmbx10 scaled 1100

\setlength{\textheight}{8.875in}
\setlength{\textwidth}{6.5in}
\setlength{\columnsep}{0.375in}
\setlength{\topmargin}{0in}
\setlength{\parindent}{1pc}

\def\@maketitle
{
\newpage
\null
\vskip .375in
\begin{center}
{\Large \bf \@title \par}
% additional two empty lines at the end of the title
\vspace*{24pt}
{
\large
\lineskip .5em
\begin{tabular}[t]{c}
\@author
\end{tabular}
\par
}
% additional small space at the end of the author name
\vskip .5em
{
\large
\begin{tabular}[t]{c}
\@affiliation
\end{tabular}
\par
\ifx \@empty \@email
\else
\begin{tabular}{r@{~}l}
E-mail: & {\tt \@email}
\end{tabular}
\par
\fi
}
% additional empty line at the end of the title block
\vspace*{12pt}
\end{center}
}

\def\abstract
{%
\centerline{\large\bf Abstract}%
\vspace*{12pt}%
\it%
}

\def\endabstract
{
% additional empty line at the end of the abstract
\vspace*{12pt}
}

\def\affiliation#1{\gdef\@affiliation{#1}} \gdef\@affiliation{}

\def\email#1{\gdef\@email{#1}}
\gdef\@email{}

\newlength{\@ctmp}
\newlength{\@figindent}
\setlength{\@figindent}{1pc}

\long\def\@makecaption#1#2{
\vskip 10pt
\setbox\@tempboxa\hbox{\tenhv\noindent #1.~#2}
\setlength{\@ctmp}{\hsize}
% IF longer than one indented paragraph line
\ifdim \wd\@tempboxa >\@ctmp
% THEN set as an indented paragraph
\begin{list}{}{\leftmargin\@figindent \rightmargin\leftmargin}
\item[]\tenhv #1.~#2\par
\end{list}
\else
% ELSE center
\hbox to\hsize{\hfil\box\@tempboxa\hfil}
\fi}

\def\section{\@startsection {section}{1}{\z@}
{14pt plus 2pt minus 2pt}{14pt plus 2pt minus 2pt} {\large\bf}}
\def\subsection{\@startsection {subsection}{2}{\z@}
{13pt plus 2pt minus 2pt}{13pt plus 2pt minus 2pt} {\fontsize{11}{\f@baselineskip}\bf}}%\elvbf}}

-
We need to see the contents of file latex12.sty; most probably it contains some declarations responsible for the mentioned layout. –  Gonzalo Medina Aug 11 '12 at 23:57
@GonzaloMedina Ah! Hadn't even thought of that... I'll add it now. Edit Added –  water Aug 12 '12 at 0:08
Please make a complete (small) document that shows the effect and remove all the packages that you can remove while still having the problem –  David Carlisle Aug 12 '12 at 0:13

This part of latex12.sty

\setlength{\textheight}{8.875in}
\setlength{\textwidth}{6.5in}
\setlength{\columnsep}{0.375in}
\setlength{\topmargin}{0in}


changes the default page layout, and in particular, the line

\setlength{\textwidth}{6.5in}


will produce the undesired layout. You can change the value 6.5in to a more convenient value or, better yet, load the geometry package and use its \geometry command to change the page layout according to your needs. As an example, you could say something like:

\usepackage{geometry}
\geometry{lmargin=2.5cm,rmargin=2cm}


or

\usepackage{geometry}
\geometry{textwidth=6.5in}


if you want to keep the original width for the text area. Make sure that the \geometry line appears after the latex12 package has been loaded, and refer to the documentation of the geometry package to see all the options it offers.

A little example using \geometry to override the latex12.sty settings:

\documentclass[10pt,onecolumn]{article}
\usepackage{latex12}
\usepackage{geometry}
\geometry{textwidth=6.5in}
\usepackage{lipsum}% just to generate text for the example

\begin{document}
\lipsum[1-8]
\end{document}


produces a two page document; the first page obtained (illustrating the resulting layout):

-
Got it, thanks! Didn't know about the geometry package, good resource –  water Aug 12 '12 at 0:38

It seems that latex12.sty is a modification of latex8.sty (which was a style to mimic IEEE conference paper specifications).

The layout specifications of latex8.sty contain

\setlength{\oddsidemargin}{-.304in}
\setlength{\evensidemargin}{-.304in}


which are not in latex12.sty.

An alternative package for IEEE conference papers is IEEEconf.cls`.

-