Fehler beim Festlegen der richtigen Abmessungen für die Tabelle

Fehler beim Festlegen der richtigen Abmessungen für die Tabelle

Hier ist mein Versuch, diese Tabelle zu erstellen. Ich wollte wissen, warum ich einen Fehler erhalte. Der Fehler lautet „Sequenz nicht definiert“. Alternativ ist jedes bessere Format willkommen, um die folgenden Beispieldaten tabellarisch darzustellen.

\begin{table}
  \centering
  \captionsetup{width=10cm}
  \caption{Initial, post-etch and post SPM treatment heights.}
  \label{tab:2}
  \begin{tabular}{l *{3}{S[table-format=4.0]}}
    \toprule
           {Wafer \#} & {Initial height} & {Post-etch height}&{Post SPM treatment} &{SPM treatment}$ \\
            & \si{\mu m} & \si{\mu m} &\si{nm}\\
    \midrule
     $Length (mm)$  &       1.4725 &        1.5875 &        142.5 & 112\\
     $Width (mm)$     &      1.4725 &        1.575&        142.5& 113 \\
     $Thickness (mm)$   &       1.495 &        1.5925&        132.5& 145 \\
     $Young modulus (GPa))$  &       1.492 &        1.66 &        190& 456\\
     $Young modulus (GPa)$    &       1.465 &        1.63&        197.5& 5454 \\
     $TYoung modulus (GPa)$    &       1.2525 &        1.4625&        192.5 & 543\\
      $Young modulus (GPa)$    &       1.2525 &        1.4625&        192.5& 903 \\
       $Boundary conditions$    &       1.2525 &        1.4625&        192.5& 5353 \\
        $Applied load$    &       1.2525 &        1.4625&        192.5& 434 \\
         $Young modulus (GPa)$    &       1.2525 &        1.4625&        192.5& 5345 \\
    \bottomrule
  \end{tabular}
\end{table}

Antwort1

Dies funktioniert, beachten Sie die geladenen Pakete und die Änderungen an der Tabelle.

\documentclass{article}
\usepackage{siunitx,booktabs,caption}

\begin{document}

\begin{table}
\centering
\captionsetup{width=10cm}
\caption{Initial, post-etch and post SPM treatment heights.}
\label{tab:2}

\begin{tabular}{
  l 
  S[table-format=1.4]
  S[table-format=1.4]
  S[table-format=3.1]
  S[table-format=4.0]
}
\toprule
{Wafer \#} & {Initial} & {Post-etch} & {Post SPM}  & {SPM} \\
           & {height}  & {height}    & {treatment} & {treatment} \\
  & \si{\micro\meter}
  & \si{\micro\meter}
  & \si{\nano\meter} \\
\midrule
Length (\si{mm})          & 1.4725 & 1.5875 & 142.5 &  112 \\
Width (\si{mm})           & 1.4725 & 1.575  & 142.5 &  113 \\
Thickness (\si{mm})       & 1.495  & 1.5925 & 132.5 &  145 \\
Young modulus (\si{GPa})  & 1.492  & 1.66   & 190   &  456 \\
Young modulus (\si{GPa})  & 1.465  & 1.63   & 197.5 & 5454 \\
TYoung modulus (\si{GPa}) & 1.2525 & 1.4625 & 192.5 &  543 \\
Young modulus (\si{GPa})  & 1.2525 & 1.4625 & 192.5 &  903 \\
Boundary conditions       & 1.2525 & 1.4625 & 192.5 & 5353 \\
Applied load              & 1.2525 & 1.4625 & 192.5 &  434 \\
Young modulus (\si{GPa})  & 1.2525 & 1.4625 & 192.5 & 5345 \\
\bottomrule
\end{tabular}

\end{table}

\end{document}

Bildbeschreibung hier eingeben

Antwort2

Ich schlage Folgendes vor und verwende zusätzlich makecell:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[showframe]{geometry}
\usepackage{siunitx, booktabs, caption, makecell}
\DeclareSIUnit\micron{\micro\metre}
\renewcommand\theadfont{\normalsize\upshape}

\begin{document}

\begin{table}
  \centering
  \captionsetup{width=10cm}\setlength\extrarowheight{3pt}
  \caption{Initial, post-etch and post SPM treatment heights.}
  \label{tab:2}
  \begin{tabular}{ @{}>{\itshape}l *{2}{S[table-format=1.4]}S[table-format=3.1]S[table-format=4.0]}
    \toprule
           {\thead{Wafer \#\\ (\si{\micron})}} & {\thead{Initial height\\ (\si{\micron})}} & {\thead{Post-etch \\ height  (\si{\micron})}}
            & {\thead{Post SPM\\ treatment  (\si{\nm})}} & {\thead{SPM\\ treatment}} \\
    \midrule
     Length (mm) & 1.4725 & 1.5875 & 142.5 & 112\\
     Width (mm) & 1.4725 & 1.575& 142.5& 113 \\
     Thickness (mm) & 1.495 & 1.5925& 132.5& 145 \\
     Young modulus (GPa) & 1.492 & 1.66 & 190& 456\\
     Young modulus (GPa) & 1.465 & 1.63& 197.5& 5454 \\
    TYoung modulus (GPa) & 1.2525 & 1.4625& 192.5 & 543\\
     Young modulus (GPa) & 1.2525 & 1.4625& 192.5& 903 \\
     Boundary conditions & 1.2525 & 1.4625& 192.5& 5353 \\
     Applied load & 1.2525 & 1.4625& 192.5& 434 \\
     Young modulus (GPa) & 1.2525 & 1.4625& 192.5& 5345 \\
    \bottomrule
  \end{tabular}
\end{table}

    \end{document} 

Bildbeschreibung hier eingeben

verwandte Informationen