包 tabularx(错误:缺少数字,视为零。)

包 tabularx(错误:缺少数字,视为零。)


我有以下内容并且我的编译器给了我这个错误消息:

! Missing number, treated as zero.
! Illegal unit of measure (pt inserted). 
! Package calc Error: `c' invalid at this point.
! Package array Error: Illegal pream-token (V): `c' used.
! Extra alignment tab has been changed to \cr.

以下是代码:

\usepackage{tabularx}           %for nicer tables


\begin{document}
...

\begin{table}[H]
\caption{Berechnete Konzentrationen der Proteinprobe.}
\label{tab:Protein}
\begin{tabularx}{cccccc}
Verd. & $\upsigma$\textsubscript{korr.} & $\upbeta$ / $\upmu$g/ml & +/- & $\Delta$ $\upbeta$ / $\upmu$g/ml & rel. Fehler / \%\tabularnewline
\hline 
1:20 & 0.0182 & 958.79 & +/- & 113.39 & 11.83\tabularnewline
1:50 & 0.0038 & 1151.56 & +/- & 153.83 & 13.36\tabularnewline
1:100 & 0.0113 & 1405.68 & +/- & 331.68 & 23.60\tabularnewline
1:250 & 0.0581 & 2323.72 & +/- & 2727.75 & 117.39\tabularnewline
\end{tabularx}
\end{table}

\end{document}

整个事情与“表格”一起工作,但我想要整个带宽。

有任何想法吗?

这是我使用的所有包

\documentclass[a4paper,12pt]{article} %scrartcl
\usepackage{geometry}
\geometry{
  left=2.5cm,
  right=2.5cm,
  top=2.5cm,
  bottom=4cm}

\usepackage{tabularx}
%%CHEM%%
\usepackage[version=4]{mhchem} 
\usepackage{siunitx}
\usepackage{chemgreek}
\usepackage{upgreek}
\usepackage[greek=upgreek]{chemmacros}
 %griech alph
\usepackage{pdftexcmds}
\DeclareChemParticle\alphaparticle{\chemalpha}
%%MATH%%
\usepackage{amsmath}
\usepackage{amsthm}             %for theorems http://en.wikibooks.org/wiki/LaTeX/Theorems
\usepackage{braket}             %for Dirac bra-ket notation
\usepackage{bm}             %for bold math like vectors
\usepackage{nicefrac}           %for nice fractions
\usepackage{esdiff}         %for partial differtiation diffp
%%FONT%%
\usepackage{bbold}          %unity matrix symbol
\usepackage[ngerman]{babel}
%\usepackage{datetime}
%%FIGURES, DIAGRAMS, TABLES%%
\usepackage{tikz}               %DIA diagrams
\usepackage{color}          %for colors in text
\usepackage{graphicx}           %for including graphics
\usepackage{caption}
\usepackage{subcaption}         %more figures in one float
\usepackage{floatrow}
\usepackage{rotating}           %for rotated big figures
\usepackage{caption,booktabs}           %better tables
\usepackage{tabularx}           %for nicer tables
\usepackage[hang]{footmisc}
%%EXTRA FUNCTIONALITY%%
\usepackage[printonlyused]{acronym} %for acronyms
    %for hyperrefs, backref to show page number in references
%   \renewcommand*{\backref}[1]{}
%   \renewcommand*{\backrefalt}[4]{
%           \ifcase #1 (Not cited.)
%           \or        (Cited on page~#2.)
%           \else      (Cited on pages~#2.)
%       \fi}
%\usepackage[bottom]{footmisc}      %to have footnotes at bottom
%%BUG FIXES%%
    %otherwise warnings

%%DOCUMENT SETTINGS%%

\usepackage[utf8x]{inputenc}        %utf-8 encoding
\usepackage[onehalfspacing]{setspace}   %Zeilenabstand im Fließtext

\setlength{\parindent}{0pt}         %Zeileneinzug bei neuem Absatz
\setlength{\parskip}{7pt}       %Abstand zwischen Absätzen

\newcolumntype{b}{X}
\newcolumntype{s}{>{\hsize=.5\hsize}X}

\usepackage[square,numbers,sort&compress,comma]{natbib}
\renewcommand{\listfigurename}{List of Figures}

答案1

您缺少有关表格宽度的信息:

\begin{tabularx}{\textwidth}{XXXXXX}

我用来\textwidth定义宽度 - 您也可以使用80mm例如或0.75\textwidth

\documentclass{article}
\usepackage{tabularx}
\usepackage[showframe=true]{geometry}
\usepackage{float}

\begin{document}

\begin{table}[H]
\caption{Some Caption in German}
\label{tab:Protein}
\begin{tabularx}{\textwidth}{XXXXXX}
Verd. & $\sigma$\textsubscript{korr.} & $\beta$ / $\mu$g/ml & +/- & $\Delta$ $\beta$ / $\mu$g/ml & rel. Fehler / \%\tabularnewline
\hline 
1:20 & 0.0182 & 958.79 & +/- & 113.39 & 11.83\tabularnewline
1:50 & 0.0038 & 1151.56 & +/- & 153.83 & 13.36\tabularnewline
1:100 & 0.0113 & 1405.68 & +/- & 331.68 & 23.60\tabularnewline
1:250 & 0.0581 & 2323.72 & +/- & 2727.75 & 117.39\tabularnewline
\end{tabularx}
\end{table}

\end{document}

enter image description here

  • 您的代码缺少文档类。
  • 您的代码使用了[H]选项但没有提供float包(导致错误)。
  • 您的代码使用了一些\up...代码中使用的包不支持的数学命令(导致错误)。
  • 我添加了geometry带有showframe=true选项的包,以便显示表使用了整个\textwidth

相关内容