Tabellen, Formatierung

Tabellen, Formatierung

Probleme mit dieser Tabelle, jede Hilfe ist willkommen. Vielen Dank

 \documentclass[a4paper,12pt]{report}
\usepackage{multirow}
\usepackage{siunitx,booktabs}%for table decimals number
\usepackage[export]{adjustbox} \begin{table}[!htbp]
\centering
\begin{tabular}{>{\bfseries}l 
               S[table-format=-1.2(2)] 
                S[table-format=table-format=1.1e1] } 
\toprule 
  {\textbf{Approach}} & $\boldsymbol{\beta}$ & $\boldsymbol{\chi^{2}}$ \\
   \midrule
1   &  -0.61(17)        & Inf. \\
2   &  -0.60(17)        & Inf. \\
3   &  -0.59(18)        & 3$\times$10$^6$\\ 
4   &  -0.56(20)        & Inf. \\
\bottomrule
\end{tabular}
\caption[]
 \label{}
\end{table}
\FloatBarrier

Antwort1

Ich würde in der Überschrift keinen Fettdruck verwenden: \bm{\beta}und \betasind zwei verschiedene mathematische Entitäten.

Auch muss die erste Spalte nicht fett gedruckt sein. Die dritte Spalte, die nur eine Zahl enthält, kann einfach aus c, wobei \numfür die Zahl steht, bestehen; wenn es sich nur um eine ungekürzte Version handelt, sollten Sie die nicht numerischen Einträge in Klammern setzen.

\documentclass[a4paper,12pt]{report}

\usepackage{amsmath,bm}
\usepackage{siunitx,booktabs}%for table decimals number


\begin{document}

\begin{table}[!htbp]
\centering

\begin{tabular}{
  >{\bfseries}l 
  S[table-format=-1.2(2)] 
  c
}
\toprule 
Approach & {$\bm{\beta}$} & $\bm{\chi^{2}}$ \\
\midrule
1   &  -0.61(17)        & Inf. \\
2   &  -0.60(17)        & Inf. \\
3   &  -0.59(18)        & \num{3e6} \\ 
4   &  -0.56(20)        & Inf. \\
\bottomrule
\end{tabular}
\caption{A caption}
\label{label}
\end{table}

\begin{table}[!htbp]
\centering

\begin{tabular}{
  l 
  S[table-format=-1.2(2)] 
  c
}
\toprule 
Approach & {$\beta$} & $\chi^{2}$ \\
\midrule
1   &  -0.61(17)        & Inf. \\
2   &  -0.60(17)        & Inf. \\
3   &  -0.59(18)        & \num{3e6} \\ 
4   &  -0.56(20)        & Inf. \\
\bottomrule
\end{tabular}
\caption{A caption}
\label{label2}
\end{table}

\begin{table}[!htbp]
\centering

\begin{tabular}{
  l 
  S[table-format=-1.2(2)] 
  S[table-format=1.0e1]
}
\toprule 
Approach & {$\beta$} & $\chi^{2}$ \\
\midrule
1   &  -0.61(17)        & {Inf.} \\
2   &  -0.60(17)        & {Inf.} \\
3   &  -0.59(18)        & 3e6 \\ 
4   &  -0.56(20)        & {Inf.} \\
\bottomrule
\end{tabular}
\caption{A caption}
\label{label3}
\end{table}

\end{document}

Bildbeschreibung hier eingeben

Antwort2

Dies sollte Ihre Tabelle sein und kompilierbar sein:

\documentclass[a4paper,12pt]{report}
\usepackage{multirow}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{amsmath}

\begin{document}
\begin{table}[!htbp]
\centering
\begin{tabular}{>{\bfseries}c % I think centred column looks better here
               S[table-format=-1.2(2)] 
                S[table-format=1.1e1] } 
\toprule 
  Approach & $\boldsymbol{\beta}$ & $\boldsymbol{\chi^{2}}$ \\
   \midrule
1   &  -0.61(17)        & {Inf.} \\
2   &  -0.60(17)        & {Inf.} \\
3   &  -0.59(18)        & 3e6 \\ 
3   &  -0.59(18)        & 3.0e6 \\ % for comparison
4   &  -0.56(20)        & {Inf.} \\
\bottomrule
\end{tabular}
\caption{test}
\label{tab:test}
\end{table}
\end{document}

Bildbeschreibung hier eingeben Ist etwas nicht so wie Du es möchtest?

Antwort3

Bildbeschreibung hier eingeben

\documentclass[a4paper,12pt]{report}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{siunitx}

\begin{document}
    \begin{table}[htbp]
    \centering
\caption[]{My nice table}
    \label{tab:mytable}
\begin{tabular}{>{\bfseries}l
                S[table-format=-1.2(2)]
                S[table-format= 1.0e1] }
    \toprule
Approach    & {$\boldsymbol{\beta}$}    & {$\boldsymbol{\chi^{2}}$}  \\
   \midrule
1           &  -0.61(17)                & {Inf.}                    \\
2           &  -0.60(17)                & {Inf.}                    \\
3           &  -0.59(18)                & 3e6                       \\
4           &  -0.56(20)                & {Inf.}                    \\
    \bottomrule
\end{tabular}
    \end{table}

or

    \begin{table}[htbp]
\sisetup{separate-uncertainty}%
    \centering
\caption[]{My nice table again}
    \label{tab:mytable}
\begin{tabular}{>{\bfseries}c
                S[table-format=-1.2(2)]
                S[table-format= 1.0e1] }
    \toprule
Approach    & {$\boldsymbol{\beta}$}    & {$\boldsymbol{\chi^{2}}$}  \\
   \midrule
1           &  -0.61(17)                & {Inf.}                    \\
2           &  -0.60(17)                & {Inf.}                    \\
3           &  -0.59(18)                & 3e6                       \\
4           &  -0.56(20)                & {Inf.}                    \\
    \bottomrule
\end{tabular}
    \end{table}
\end{document}

verwandte Informationen