将超宽表格置于页面中央,尽管超出 \textwidth

将超宽表格置于页面中央,尽管超出 \textwidth

我目前正在写一份报告,表格过宽后出现了一些问题。我想让表格在页面上居中,但由于 \hbox 太满,表格总是偏左。我在让表格变窄方面取得了一些进展,但还不够。

我也看到了如何让太宽的表格居中?我如何使这个宽表格在 LaTeX 中居中?,但我无法实施所提出的解决方案。也许与我使用的某些软件包存在不兼容性。

我试图将我的问题的 MWE 放在下面,但是我插入了我使用的所有软件包,以防任何人看到不兼容的地方。

\documentclass[a4paper,12pt]{report} %EINSEITIG
\usepackage[a4paper , lmargin = {3cm} , rmargin = {3cm} , tmargin = {2.5cm} , bmargin = {2.5cm}, headheight=14.5pt]{geometry} %für PC Ansicht


\usepackage[ngerman, english]{babel} 
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{amsfonts} 
\usepackage{textcomp,gensymb} 
\usepackage{upgreek}
\usepackage{amsmath}
\usepackage{cite}
\usepackage[gen]{eurosym} 
\usepackage{wrapfig}
\usepackage{pdfpages}
\usepackage{nicefrac}
\usepackage[onehalfspacing]{setspace}

\usepackage[font=small,format=hang]{caption} 

\pagestyle{fancy}
\usepackage{booktabs} 
\usepackage{tabularx} 
\usepackage{subcaption} 
\usepackage{colortbl} 
\usepackage{rotating} 
\usepackage{multirow}
\usepackage{pifont} 
\usepackage{selectp} 
\usepackage[inline]{enumitem}
\usepackage[version=4]{mhchem} 


% SI-Unit
\usepackage[per-mode=symbol,exponent-product=\cdot]{siunitx}


% HyperRef Formatting
\usepackage[pdftex, colorlinks, linkcolor=black, frenchlinks, unicode]{hyperref} 
\hypersetup{citecolor=black}
\hypersetup{urlcolor=blue}


\usepackage{uarial}
\renewcommand{\familydefault}{\sfdefault}



\definecolor{light-gray}{gray}{0.75} %Definition der neuen Farbe Grau


    \usepackage{titlesec}
\titleformat{\chapter}{\bfseries\Huge}{\thechapter.\quad}{0em}{} 
\AtBeginDocument{\renewcommand{\chaptername}{}}



\setcounter{secnumdepth}{4}

\begin{document}
\chapter{Test}

%%PDF-Einstellungen

\fancyhead[L]{Version 1.4 - \today}
\fancyfoot[L]{}
\fancyfoot[C]{\thepage}
\fancyfoot[R]{}

\pagenumbering{roman} %Römische Ziffern

%%

%
A tabular listing with DIN standards and corresponding ASTM standards for the aforementioned testing methods is given in \autoref{Tab:test}.


\begin{table}[htbp]
\centering
\caption{DIN and ASTM Test Method Standards Comparison}
\begin{tabular}{llcc}
\toprule 
Field & Test & DIN-Standard & ASTM-Standard \\
\toprule
\multirow{3}{*}{Concrete} & Compressive strength (UCS) & EN~12390-3 & C39/C39M Bananenequark \\ 
& Young's modulus & EN 12390-13 &  C469/C469M \\
& Triaxial Tests & - & C801* \\
\bottomrule
\multicolumn{4}{l}{\begin{scriptsize}  * = standard withdrawn \end{scriptsize}} \\
\end{tabular}
\label{Tab:test}
\end{table}

\end{document}

我尝试了很多选项但仍然没有看到效果并且表格与文本左侧对齐。

有人能给我提供一个解决方案,让我能将表格置于页面中央而不是文本左对齐吗?

在此先非常感谢您的帮助!

答案1

tabular*通过使用表格环境并向左调整,您的表格可以适合文本宽度\colsep。使用\small字体大小使表格更加美观:

\documentclass[a4paper,12pt]{report} %EINSEITIG
\usepackage[hmargin = {3cm},
            vmargin = {2.5cm} ,
            headheight=14.5pt]{geometry} %für PC Ansicht
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{uarial}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[onehalfspacing]{setspace}

\usepackage[font=small,format=hang]{caption}

\usepackage{ragged2e}
\usepackage{booktabs, multirow}
\usepackage[colorlinks, frenchlinks, unicode]{hyperref}
\hypersetup{linkcolor=black, citecolor=black, urlcolor=blue}

%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
A tabular listing with DIN standards and corresponding ASTM standards for the aforementioned testing methods is given in \autoref{Tab:test}.

    \begin{table}[htbp]
\caption{Comparison of DIN and ASTM Test Method Standards}
\label{Tab:test}
    \setlength\tabcolsep{0pt}
    \small% works also with normal font size
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}llll}
    \toprule
Field & Test & DIN Standard & ASTM Standard \\
    \midrule
\multirow{3}{*}{Concrete} & Compressive strength (UCS)
& EN~12390-3 & C39/C39M Bananen\-equark \\
& Young's modulus & EN 12390-13 & C469/C469M \\
& Triaxial Tests  & --           & C801* \\
    \bottomrule
    \addlinespace
\multicolumn{4}{@{}l}{\scriptsize * = standard withdrawn}\\
\end{tabular*}
    \end{table}
\end{document}

在此处输入图片描述

答案2

由于您已经加载了tabularx包,因此您可以考虑使用tabularx环境而不是tabular环境。我建议对最后一列使用(修改后的)X列类型,并允许在该列中换行。

在此处输入图片描述

\documentclass[a4paper,12pt]{report} %EINSEITIG
\usepackage[hmargin = {3cm}, vmargin = {2.5cm} ,
    headheight=14.5pt]{geometry} %für PC Ansicht

\usepackage[ngerman, english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}

\usepackage{fancyhdr}
\pagestyle{fancy}

\usepackage{amsmath, amssymb}
\usepackage{textcomp,gensymb}
\usepackage[table]{xcolor}
%\definecolor{light-gray}{gray}{0.75} % neue Farbe Grau

\usepackage{upgreek}
\usepackage{cite}
\usepackage[gen]{eurosym}
\usepackage{wrapfig}
\usepackage{pdfpages}
\usepackage{nicefrac}
\usepackage[onehalfspacing]{setspace}

\usepackage[font=small,format=hang]{caption}

\usepackage{booktabs}
\usepackage{tabularx,ragged2e}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}
\usepackage{subcaption}

\usepackage{rotating}
\usepackage{multirow}
\usepackage{pifont}
\usepackage{selectp}
\usepackage[inline]{enumitem}
\usepackage[version=4]{mhchem}

% SI-Unit
\usepackage[per-mode=symbol,exponent-product=\cdot]{siunitx}

\usepackage{uarial}
\renewcommand{\familydefault}{\sfdefault}

\usepackage{titlesec}
\titleformat{\chapter}{\bfseries\Huge}{\thechapter.\quad}{0em}{}
\AtBeginDocument{\renewcommand{\chaptername}{}}

% HyperRef Formatting (load 'hyperref' package LAST)
\usepackage[colorlinks, frenchlinks, unicode]{hyperref}
\hypersetup{linkcolor=black, citecolor=black, urlcolor=blue}

\setcounter{secnumdepth}{4}
\pagenumbering{roman} % Römische Ziffern

%%PDF-Einstellungen
\fancyhead[L]{Version 1.4 -- \today}
\fancyfoot[L]{}
\fancyfoot[C]{\thepage}
\fancyfoot[R]{}


\begin{document}
\chapter{Test}

A tabular listing with DIN standards and corresponding ASTM standards for the aforementioned testing methods is given in \autoref{Tab:test}.

\begin{table}[htbp]
\caption{Comparison of DIN and ASTM Test Method Standards}
\label{Tab:test}

\begin{tabularx}{\textwidth}{@{}lllL@{}}
\toprule
Field & Test & DIN Standard & ASTM Standard \\
\midrule
\multirow{4}{*}{Concrete} & Compressive strength (UCS) 
& EN~12390-3 & C39/C39M Bananen\-equark \\
& Young's modulus & EN 12390-13 & C469/C469M \\
& Triaxial Tests  & --           & C801* \\
\bottomrule \addlinespace
\multicolumn{4}{@{}l}{\scriptsize * = standard withdrawn}\\
\end{tabularx}
\end{table}

\end{document} 

答案3

我知道这会引发一些评论,但你可以直接用\centerline它包裹你的桌子。这似乎就是你想要的。这是否是好的风格是另一个问题。

\centerline{\begin{tabular}{llcc}
\toprule 
Field & Test & DIN-Standard & ASTM-Standard \\
\toprule
\multirow{3}{*}{Concrete} & Compressive strength (UCS) & EN~12390-3 & C39/C39M Bananenequark \\ 
& Young's modulus & EN 12390-13 &  C469/C469M \\
& Triaxial Tests & - & C801* \\
\bottomrule
\multicolumn{4}{l}{\begin{scriptsize}  * = standard withdrawn \end{scriptsize}} \\
\end{tabular}}

相关内容