为什么我的文档完全右对齐?

为什么我的文档完全右对齐?

我通常不会花太多时间在 LaTeX 文档的格式上,所以这可能很容易,我很抱歉。我将文档从两列类更改为单列类,突然我的文档右对齐,导致许多表格超出页面。例如,这是屏幕截图:

截屏

为什么会这样?下面是我文档顶部的代码:

\documentclass[times, 10pt,onecolumn]{article}
\usepackage{latex12}
\usepackage{times}
\usepackage{balance}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{verbatim}
\usepackage{graphicx}
\usepackage[pagebackref=true,breaklinks=true,letterpaper=true,colorlinks,bookmarks=false]{hyperref}

谢谢你的帮助

编辑: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{\headheight}{0in}
\setlength{\headsep}{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}
   \addtolength{\@ctmp}{-\@figindent}\addtolength{\@ctmp}{-\@figindent}
   % 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}}

答案1

这部分latex12.sty

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

更改默认页面布局,特别是以下行

\setlength{\textwidth}{6.5in}

将产生不想要的布局。您可以将该值更改6.5in为更方便的值,或者更好的是,加载包geometry并使用其\geometry命令根据您的需要更改页面布局。例如,您可以这样说:

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

或者

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

如果你想保持文本区域的原始宽度。确保该\geometry线显示latex12包已加载,并参阅该包的文档geometry来查看它提供的所有选项。

\geometry用于覆盖设置的一个小示例latex12.sty

\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}

生成一份两页的文档;获得的第一页(说明最终的布局):

在此处输入图片描述

答案2

这似乎latex12.sty是一种修改latex8.sty(这是一种模仿 IEEE 会议论文规范的风格)。

布局规范latex8.sty包含

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

不在 中latex12.sty

IEEE 会议论文的另一个软件包是IEEEconf.cls

相关内容