Paket-Array-Fehler: Ungültiges Präambel-Token (L): „c“ verwendet. \end{tabularx} in KDD-Vorlage – acmart

Paket-Array-Fehler: Ungültiges Präambel-Token (L): „c“ verwendet. \end{tabularx} in KDD-Vorlage – acmart

Hier sind das Paket, das ich verwende, und die Tabelle. Dasselbe gilt für andere Vorlagen. Nur wenn ich die KDD-Vorlage - acmart - verwende, erhalte ich den oben genannten Fehler.

Hier sind die Pakete, die ich verwende, und die Tabelle:

\documentclass[sigconf]{acmart}
\usepackage{booktabs,makecell,tabularx}
\renewcommand\theadfont{\small}
\usepackage{siunitx}
\usepackage{adjustbox}
\usepackage{array,booktabs}
\usepackage{graphicx}
\usepackage{epstopdf}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}

\begin{document}
\begin{table}
    \centering
    \setlength{\tabcolsep}{5pt}
    \small
    \begin{tabularx}{\columnwidth}{@{}c L S[table-format=7.0]*{2}{S[table-format=2.0]}@{}}
        \toprule
        \thead{ID}  &   \thead{DSA SDADD sdhjk} 
        &   {\thead{ABC \\M}}  
        &   {\thead{ABCD \\ minbucket }} 
        \\
        \midrule
        AB1 & ABCDE abcd                          & 30  & 250     \\
        AB2 & ABCD                                & 40  & 500     \\
        AB3 & ABCD ABCDE ABCDEFG  ABCDEFGH ASDGFF & 2   & 500     \\
        AB4 & ABC ABC 1000                        & 40  & 7       \\
        \bottomrule
    \end{tabularx}
    \caption{fsdjhkhsdk fhsdjkhdfsjkhkj fsdjhkhsdfk  hjsdfhk}
    \label{table:2}
\end{table}
\end{document}

Antwort1

Ich nehme an, dass Sie Ldie folgende Definition beabsichtigten, aber ich würdeniemalstabularxFür eine solche Tabelle verwenden Sie bitte die Version mit tabular.

tabularxdreht sich alles darum, den Zeilenumbruch innerhalb der Zellen so anzupassen, dass er in eine Tabelle passt. In einer solchen Tabelle möchten Sie jedoch keinen Zeilenumbruch, und wenn Sie die Tabelle auf die volle Breite ausdehnen, wird sie nur schwer lesbar.

Bildbeschreibung hier eingeben

\documentclass[sigconf]{acmart}
\usepackage{booktabs,makecell,tabularx}
\renewcommand\theadfont{\small}
\usepackage{siunitx}
\usepackage{adjustbox}
\usepackage{array,booktabs}
\usepackage{graphicx}
\usepackage{epstopdf}

%\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}

\begin{document}
\begin{table}
    \centering
    \setlength{\tabcolsep}{5pt}
    \small
    \begin{tabularx}{\columnwidth}{@{}c L S[table-format=7.0]*{2}{S[table-format=2.0]}@{}}
        \toprule
        \thead{ID}  &   \thead{DSA SDADD sdhjk} 
        &   {\thead{ABC \\M}}  
        &   {\thead{ABCD \\ minbucket }} 
        \\
        \midrule
        AB1 & ABCDE abcd                          & 30  & 250     \\
        AB2 & ABCD                                & 40  & 500     \\
        AB3 & ABCD ABCDE ABCDEFG  ABCDEFGH ASDGFF & 2   & 500     \\
        AB4 & ABC ABC 1000                        & 40  & 7       \\
        \bottomrule
    \end{tabularx}

\bigskip

    \begin{tabular}{@{}c l*{2}{S[table-format=2.0]}@{}}
        \toprule
        \thead{ID}  &   \thead{DSA SDADD sdhjk} 
        &   {\thead{ABC \\M}}  
        &   {\thead{ABCD \\ minbucket }} 
        \\
        \midrule
        AB1 & ABCDE abcd                          & 30  & 250     \\
        AB2 & ABCD                                & 40  & 500     \\
        AB3 & ABCD ABCDE ABCDEFG  ABCDEFGH ASDGFF & 2   & 500     \\
        AB4 & ABC ABC 1000                        & 40  & 7       \\
        \bottomrule
    \end{tabular}


    \caption{fsdjhkhsdk fhsdjkhdfsjkhkj fsdjhkhsdfk  hjsdfhk}
    \label{table:2}
\end{table}
\end{document}

verwandte Informationen