如何使用非标准文档类在 LaTeX 中左对齐表格

如何使用非标准文档类在 LaTeX 中左对齐表格

我需要将表格与页面的左边距对齐。该adjustbox软件包看起来是解决方案,但我很难实现它。我意识到我的问题可能与这个问题重复,如何在 LaTeX 中左对齐表格,但我仍然不确定如何执行此操作。

梅威瑟:

\documentclass[doc,12pt,floatsintext,longtable,natbib]{apa6}
\usepackage[doublespacing]{setspace}  %automatically makes figure/table captions single space.
\usepackage{adjustbox} % Potential solution?
\usepackage{showframe}
\usepackage{lipsum} % dummy text only

\geometry{reset, letterpaper, height=9in, width=6in, hmarginratio=1:1, vmarginratio=1:1, marginparsep=0pt, marginparwidth=0pt, headheight=15pt}

\begin{document}
\thispagestyle{empty}
\section{LIST OF ABBREVIATIONS}  
\vspace{0.5in}

\begin{adjustbox}{left=-0.25cm}
\begin{tabular}{ l l } 
AUC & Area under the curve \\
AOU & American Ornithologists' Union \\ 
AR5 & Fifth Assessment Report \\ 
BRT & Boosted regression trees \\
cAUC & Calibrated area under the curve \\ 
CMIP5 & Coupled Model Intercomparison Project Phase 5 \\
GAM & Generalized additive model \\
GBIF & Global Biodiversity Information Facility \\
GCM & General circulation model \\
GIS & Geographic information systems \\
IPCC & International Panel on Climate Change \\ 
MaxEnt & Maximum entropy \\
PRISM & Parameter-Elevation Relationships on Independent Slopes Model \\
RF & Random forest regression trees \\ 
RCP & Representative concentration pathway \\
SDM & Species distribution model \\
\end{tabular}
\end{adjustbox}

\vspace{0.25in}
\lipsum
\end{document}

正如您在包中看到的showframetabular环境没有像文本一样完全左对齐。我希望tabular环境的位置与文本一样。

答案1

无需使用adjustbox包的功能;而是使用,并将的结构\noindent设置为。tabular\begin{tabular}{@{} l l }

顺便说一句,这apa6是一个相当知名的文档类;我不会称其为“非标准”。

顺便说一句,如果您需要表格中的材料为单倍行距,我会将环境包含tabulartable环境中,如下所示:

\begin{table}[h!]
\begin{tabular}{@{}ll}
...
\end{tabular}
\end{table}

如果您选择这条路线,则\noindent不需要该指令。

在此处输入图片描述

\documentclass[doc,12pt,floatsintext,longtable,natbib]{apa6}
\usepackage[doublespacing]{setspace}  %automatically makes figure/table captions single space.
\usepackage{adjustbox} % Potential solution?
\usepackage{lipsum} % dummy text only

\geometry{reset, letterpaper, height=9in, width=6in, hmarginratio=1:1, vmarginratio=1:1, marginparsep=0pt, marginparwidth=0pt, headheight=15pt, showframe}
\shorttitle{}
\begin{document}
\thispagestyle{empty}
\section{LIST OF ABBREVIATIONS}  
\vspace{0.5in}

\noindent   % <----
\begin{tabular}{@{} l l } % <----
AUC & Area under the curve \\
AOU & American Ornithologists' Union \\ 
AR5 & Fifth Assessment Report \\ 
BRT & Boosted regression trees \\
cAUC & Calibrated area under the curve \\ 
CMIP5 & Coupled Model Intercomparison Project Phase 5 \\
GAM & Generalized additive model \\
GBIF & Global Biodiversity Information Facility \\
GCM & General circulation model \\
GIS & Geographic information systems \\
IPCC & International Panel on Climate Change \\ 
MaxEnt & Maximum entropy \\
PRISM & Parameter-Elevation Relationships on Independent Slopes Model \\
RF & Random forest regression trees \\ 
RCP & Representative concentration pathway \\
SDM & Species distribution model \\
\end{tabular}


\vspace{0.25in}
\lipsum
\end{document}

答案2

\documentclass{article}
\begin{document}

\section{LIST OF ABBREVIATIONS}  



\begin{tabular}{ l l } \\
AUC & Area under the curve \\
AOU & American Ornithologists' Union \\ 
AR5 & Fifth Assessment Report \\ 
BRT & Boosted regression trees \\
cAUC & Calibrated area under the curve \\ 
CMIP5 & Coupled Model Intercomparison Project Phase 5 \\
GAM & Generalized additive model \\
GBIF & Global Biodiversity Information Facility \\
GCM & General circulation model \\
GIS & Geographic information systems \\
IPCC & International Panel on Climate Change \\ 
MaxEnt & Maximum entropy \\
PRISM & Parameter-Elevation Relationships on Independent Slopes Model \\
RF & Random forest regression trees \\ 
RCP & Representative concentration pathway \\
SDM & Species distribution model \\
\end{tabular}


\end{document}

我不明白你的困难。但我删除了所有包并编译了它。它以页面形式出现。

相关内容