大型横向表格中的 \hbox 未满

大型横向表格中的 \hbox 未满

我在横向转换的大型表格中遇到了几个“段落中 \hbox 未满(不良程度 10000)”警告。不幸的是,我无法看到错误的具体位置,因此无法更正它们。任何帮助都非常感谢。

\documentclass[a4paper,oneside,abstracton]{scrartcl}


\usepackage[utf8]{inputenc}
%\usepackage[latin1]{inputenc}               %Zeichencodierung Text
\usepackage[T1]{fontenc}                     %Schriftsatz Dokument


%%Language settings
\usepackage[english]{babel}                  %ngerman for German
\usepackage{csquotes}                        %[babel,quotes=english]
%\usepackage{caption}
\addto\captionsenglish{\renewcommand{\contentsname}{Table of Contents}}
%\renewcommand{\contentsname}{Table of Contents}   % only works when not using babel


%%Math, astro, chemical packages and options
\usepackage{amsmath,amssymb,amsthm,amsfonts,amsbsy,latexsym}
\usepackage{wasysym}                        %astronomical symbols
%\usepackage[version=3]{mhchem}             %Chemie-Package
\providecommand{\e}[1]{\ensuremath{\times 10^{#1}}}

%\usepackage{dsfont}
%\usepackage{enumerate,url}


%%Paper adjustments
\usepackage{graphicx}
%\usepackage{a4wide}                         %obsolete and replaced by geometry
\usepackage[a4paper,bottom=3.1cm]{geometry}  %also with command \geometry{options}
\usepackage{titling}
\usepackage{booktabs}
\usepackage{lscape}
\usepackage{multirow}
%\usepackage{subfigure}                      %obsolete
\usepackage{subcaption}                      %cannot be used with subfigure
%\addto\captionsngerman{\renewcommand{\figurename}{Fig.}}
\usepackage{afterpage}
\usepackage{textcomp, gensymb}    %textcomp before gensymb gets rid of the warnings "not defining \micro and \perthousand
\usepackage{soul}
\usepackage{array}
\setcounter{secnumdepth}{4}                  %sets the section number depth
\setcounter{tocdepth}{4}                     %sets the ToC depth
%\usepackage{verbatim}               %for multiline comments using \begin{} or \end{comment}


%% Control the fonts and formatting used in the table of contents.
%\usepackage[titles]{tocloft}

%% Aesthetic spacing redefined
%\setlength{\cftbeforechapskip}{}
%\setlength{\cftbeforesecskip}{0.5ex}


%%Citations and Referencing
\usepackage[]{natbib}                        %replaced by biblatex (more flexible)
\bibpunct[, ]{(}{)}{;}{a}{,}{,}
\bibliographystyle{authordate1}              %interferes with {natbib}-style-options; other nice ones: astron,authordate1,3
\usepackage[nottoc,numbib]{tocbibind}        %numbering the reference section
\settocbibname{References}                   %References->Bibliography: changed back
\usepackage{hyperref}                        %load after bib(la)tex
\usepackage{doi}

\begin{document}


\begin{landscape}
\begin{table}
\centering
\caption{Impact data}
\label{Table:Impact data3}
\tiny
    \begin{tabular}{@{}p{0.08\textwidth}p{0.14\textwidth}p{0.06\textwidth}p{0.09\textwidth}p{0.08\textwidth}p{0.10\textwidth}p{0.14\textwidth}p{0.11\textwidth}p{0.12\textwidth}p{0.14\textwidth}p{0.14\textwidth}p{0.13\textwidth}@{}}
    \cmidrule{1-12} \morecmidrules \cmidrule{1-12}
    \scriptsize{Group} & \scriptsize{Quartz sand grain size [mm]} & \multicolumn{3}{c}{\scriptsize{Projectile}} & \scriptsize{Frequency [Hz]} & \scriptsize{Wheel circumference [mm]} & \scriptsize{Acceleration velocity of wheels [m/s]} & \scriptsize{Free fall time [s]} & \scriptsize{Impact velocity (computed) [m/s]} & \scriptsize{Impact velocity (light barriers) [m/s]} & \scriptsize{Kinetic energy [J]}} \\
    \cmidrule{3-5}
    & & \tiny{Material} & \tiny{Diameter [mm]} & \tiny{Weight [g]} & & & & & & & \\
    \midrule

    S & 0.1 - 0.45 & Glas & 5.5 $\pm$ 0.01 & 0.2 $\pm$ 0.1 & 50.1 $\pm$ 0.1 & 873 $\pm$ 4 & 43.7 $\pm$ 0.2 & 0.0244 $\pm$ 0.0004 & 44.0 $\pm$ 0.2 & 14.41 & 0.2 $\pm$ 0.1 \\

    \cmidrule{1-12} \morecmidrules \cmidrule{1-12}
\end{tabular}
\end{table}
\end{landscape} 

\end{document}

还有一个问题:这个表中有几十行的值变化很大,因此 $\pm$ 符号不美观地四处移动。上面的代码中需要什么命令才能使条目在列中居中?这样 $\pm$ 符号应该位于相应列的中间。谢谢

答案1

您实际上并不希望在如此狭窄的列中对齐文本,并且诸如\tiny和之类的大小命令\scriptsize不带参数:

\documentclass{article}

\usepackage{array,pdflscape,booktabs}
\begin{document}
\begin{landscape}
\begin{table}
\centering
\caption{Impact data}
\label{Table:Impact data3}
\tiny
    \begin{tabular}{@{}
>{\centering\arraybackslash}p{0.08\textwidth}
>{\centering\arraybackslash}p{0.14\textwidth}
>{\centering\arraybackslash}p{0.06\textwidth}
>{\centering\arraybackslash}p{0.09\textwidth}
>{\centering\arraybackslash}p{0.08\textwidth}
>{\centering\arraybackslash}p{0.10\textwidth}
>{\centering\arraybackslash}p{0.14\textwidth}
>{\centering\arraybackslash}p{0.11\textwidth}
>{\centering\arraybackslash}p{0.12\textwidth}
>{\centering\arraybackslash}p{0.14\textwidth}
>{\centering\arraybackslash}p{0.14\textwidth}
>{\centering\arraybackslash}p{0.13\textwidth}@{}}
    \cmidrule{1-12} \morecmidrules \cmidrule{1-12}

\scriptsize Group & 
\scriptsize Quartz sand grain size [mm] & 
\multicolumn{3}{c}{\scriptsize Projectile} & 
\scriptsize Frequency [Hz] & 
\scriptsize Wheel circumference [mm] & 
\scriptsize Acceleration velocity of wheels [m/s] & 
\scriptsize Free fall time [s] & 
\scriptsize Impact velocity (computed) [m/s] & 
\scriptsize Impact velocity (light barriers) [m/s] & 
\scriptsize Kinetic energy [J] \tabularnewline
    \cmidrule{3-5}
    & & 
\tiny Material & 
\tiny Diameter [mm]  & 
\tiny Weight [g]  & & & & & & & \\
    \midrule

    S & 0.1 - 0.45 & Glas & 5.5 $\pm$ 0.01 & 0.2 $\pm$ 0.1 & 50.1 $\pm$ 0.1 & 873 $\pm$ 4 & 43.7 $\pm$ 0.2 & 0.0244 $\pm$ 0.0004 & 44.0 $\pm$ 0.2 & 14.41 & 0.2 $\pm$ 0.1 \\

    \cmidrule{1-12} \morecmidrules \cmidrule{1-12}
\end{tabular}
\end{table}
\end{landscape} 

\end{document}

答案2

当我运行代码时,我收到以下警告

B: /Users/rudfaden/Desktop/test/test.tex:14 Underfull \hbox (badness 6775) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:14 Underfull \hbox (badness 10000) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:14 Overfull \hbox (1.0397pt too wide) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:14 Underfull \hbox (badness 10000) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:14 Underfull \hbox (badness 10000) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:14 Overfull \hbox (5.34167pt too wide) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:14 Underfull \hbox (badness 10000) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:14 Underfull \hbox (badness 10000) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:14 Underfull \hbox (badness 10000) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:14 Underfull \hbox (badness 10000) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:14 Underfull \hbox (badness 10000) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:14 Underfull \hbox (badness 10000) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:14 Underfull \hbox (badness 10000) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:14 Underfull \hbox (badness 10000) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:14 Underfull \hbox (badness 10000) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:16 Overfull \hbox (4.55118pt too wide) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:16 Underfull \hbox (badness 10000) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:16 Underfull \hbox (badness 10000) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:19 Underfull \hbox (badness 10000) in paragraph
B: /Users/rudfaden/Desktop/test/test.tex:12 Overfull \hbox (27.05295pt too wide) in paragraph

underfull \hbox警告 LaTeX 无法将行拉宽到足以容纳,而不会使间距大于其当前允许的最大值。这意味着overfull \hbox存在连字或对齐问题:将行上的最后一个单词移到下一行会使行中的空格比当前限制更宽

查看错误,它们是由第 14 行产生的,即我文档中的标题行。因此,问题在于您在标题中塞入了太多空间,而 latex 会就此发出警告。但请注意,这只是一个警告。如果您对结果感到满意,则没有理由更改它们。但是,我会将表格分成两部分。

相关内容