我有以下 longtabu,它无法编译并给出错误。此示例比我的原始示例短,但我的表格继续包含更多列。
\documentclass{standalone}
\usepackage{amsthm,amsmath}
\RequirePackage{natbib}
\RequirePackage[authoryear]{natbib}% uncomment this for author-year bibliography
\RequirePackage{hyperref}
\usepackage[utf8]{inputenc} %unicode support
\urlstyle{same}
\usepackage[width=\textwidth]{caption}
\captionsetup{
labelsep = space,
justification = raggedright,
font = {footnotesize,singlespacing,sf},
labelfont = {footnotesize,bf,singlespacing,sf},
singlelinecheck=off,
skip=4pt,
position=top}
\usepackage{float}
\usepackage{pgfplots}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{longtable,tabu}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\usepackage{threeparttable}
\usepackage{pgfplotstable}
\usepackage[markup=nocolor,final]{changes} Annehmen der Änderungen
\usepackage[markup=nocolor]{changes}
\usepackage{longtable,tabu}
\begin{document}
\begin{longtabu} to \textwidth{XXXX}
\caption{Questions of online questionnaire}\\
\toprule
\multicolumn{1}{X}{Question Nr} & \multicolumn{1}{p{5cm}}{Questions} & \multicolumn{1}{X}{Answer choices (simplified)} & \multicolumn{1}{X}{Conditions}\\
\midrule
1 & \multicolumn{1}{p{5cm}}{Is your practice part of practice network consisting of practices at different places?} & Yes/No (Y/N) & Madatory for all \\
2 & \multicolumn{1}{p{5cm}}{How many doctors do work in your practice?} & Number & Madatory for all \\
\end{longtabu}
\end{document}
错误如下:
\tabu@ 的参数有一个额外的}
任何帮助都非常感谢!谢谢 :)
答案1
我建议对表格进行以下重新设计:设计是否没有多大意义,要有四个等宽的列(特别是不考虑第一列和第二列的内容),我已经l
为第一列使用了类型列。此外,我已将选项添加l
到所有X
列,以便允许在其中进行右对齐。我还添加了一些乘数(2
)和(0.75
)。为了让第二列更宽。最后,我添加了\tabulinesep
以调整间距:
\documentclass{article}
\usepackage{longtable}
\usepackage{tabu}
\usepackage{booktabs}
\setlength{\tabulinesep}{3pt}
\begin{document}
\begin{longtabu} to \textwidth {lX[2 l]X[l]X[0.75 l]}
\caption{Questions of online questionnaire}\\
\toprule
Nr & Questions & Answer choices (simplified) & Conditions\\
\midrule
1 & Is your practice part of practice network consisting of practices at different places? & Yes/No (Y/N) & Madatory for all \\
2 & How many doctors do work in your practice? & Number & Madatory for all \\
\end{longtabu}
\end{document}