使用带有 apa6 类的 ctable 包

使用带有 apa6 类的 ctable 包

我正在尝试使用,因为它比它的所有附加包都ctable更容易使用,但我收到一条错误,指出“命令已定义”。threeparttable\tnote

我认为这与课程有关,apa6但我不知道如何改变它。

\documentclass[man]{apa6}
\usepackage{ctable}
\shorttitle{}

\begin{document}

\ctable[
caption = Some caption,
pos = h
]{ccc}{
}{\FL
A & B & C\ML
1 & 2 & 3\NN
4 & 5 & 6\LL
}

\end{document}

答案1

正如 Mike 在评论中提到的,apa6负载threeparttable定义了\tnote。因此,\tnote通过“取消定义”

\let\tnote\relax

解决之间的冲突ctablethreeparttable

在此处输入图片描述

\documentclass[jou]{apa6}% http://ctan.org/pkg/apa6
\let\tnote\relax% "Free up" \tnote for use in ctable
\usepackage{ctable}% http://ctan.org/pkg/ctable
\shorttitle{}
\begin{document}
\ctable[
    caption = Some caption,
    pos = h
  ]{ccc}{
  }{\FL
    A & B & C\ML
    1 & 2 & 3\NN
    4 & 5 & 6\LL
  }
\end{document}

或者,使用threeparttableMike 建议的格式。

答案2

根据您想要从 中得到什么ctable,最简单的方法可能是坚持使用threeparttable,因为apa6它会自动加载它。略作修改的示例包括脚注(就像 所做的那样ctable\tnote

\documentclass[jou]{apa6}
\begin{document}
\begin{table}[htbp]
\caption{A complex table}
\label{tab:ComplexTable}
\begin{tabular}{@{}lrrl@{}} \toprule
Distribution type & \multicolumn{2}{l}{Percentage of} & Total \\
& \multicolumn{2}{l}{targets with} & trials per \\
& \multicolumn{2}{l}{segment in} & participant \\
\cmidrule(r){2-3}
& Onset & Coda & \\
\midrule
Categorical -- onset\tabfnm{a} & 100 & 0 & 196 \\
Probabilistic & 80 & 20 & 200 \\
& 60 & 40 & 160 \\
Categorical -- coda & 0 & 100 & 196 \\
\bottomrule
\end{tabular} \\
\tabfnt{a}{A footnote about categorical -- onset}
\end{table}
\end{document}

在此处输入图片描述

相关内容