我想要下表,并在末尾添加注释 ,我可以使用 ctable 包获得
\documentclass[]{article}
\usepackage{ctable}
\begin{document}
\ctable[nosuper
]{p{1cm}p{6cm}p{1cm}p{2cm}p{2cm}}{
\tnote[a)]{My notes can be very long so then won't fit nicely
inside the table}
\tnote[b)]{note 2}
}{\FL
Item & Designation & Qty & Price & Comment \ML
IT10 & Item1 & 2 & xxx & a) \NN
IT20 & Item2 & 1 & xxx & b) \ML
& Total price & & xxx & \LL
}
\end{document}
但是有没有办法让注释内联在单元格中,并自动增加计数器?我在 Excel 中使用宏来创建此表,将注释放在可以换行的单元格中会更容易,而不是编写代码以插入表格参数,
就像是 :
IT10 & Item1 & 2 & xxx & \tnote{this is my note} \NN
答案1
请比较您的原始表格和建议的解决方案。需要进行一些调整,但我认为这是您所期望的。
\documentclass[]{article}
\usepackage{ctable}
\begin{document}
\ctable[nosuper
]{p{1cm}p{6cm}p{1cm}p{2cm}p{2cm}}{
\tnote[a)]{My notes can be very long so then won't fit nicely
inside the table}
\tnote[b)]{note 2}
}{\FL
Item & Designation & Qty & Price & Comment \ML
IT10 & Item1 & 2 & xxx & a) \NN
IT20 & Item2 & 1 & xxx & b) \ML
& Total price & & xxx & \LL
}
\newcounter{ttnote}
\setcounter{ttnote}{0}
\def\ttnote#1{\stepcounter{ttnote} \alph{ttnote}) {#1}}
\ctable[nosuper
]{p{1cm}p{6cm}p{1cm}p{2cm}p{2cm}}{
%\tnote[a)]{My notes can be very long so then won't fit nicely inside the table}
%\tnote[b)]{note 2}
}{\FL
Item & Designation & Qty & Price & Comment \ML
IT10 & Item1 & 2 & xxx & \ttnote{My notes can be very long so then won't fit nicely
inside the table} \NN
IT20 & Item2 & 1 & xxx & \ttnote{note 2} \ML
& Total price & & xxx & \LL
}
\end{document}