是否有人知道是否可以使用该包来制作多页表ctable
(我知道这是可能的longtable
)?
我的代码如下:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage[babel]{csquotes}
\usepackage{array}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{subfig}
\usepackage{rotating}
\usepackage{ctable}
\begin{document}
\ctable[
caption = Data Definitions and Sources,
label = data,
sideways
]
{>{\bfseries}l p{0.3\columnwidth} c c p{0.3\columnwidth}}
{
}
{ \FL
....
}
\end{document}
答案1
如果您想保留输入语法并轻松地在基于格式和基于格式ctable
之间切换,您可以执行类似以下的操作,向中添加一个键。tabularx
longtable
long
ctable
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage[babel]{csquotes}
\usepackage[backend=bibtex8, style=authoryear]{biblatex}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{enumitem}
\usepackage{array}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{subfig}
\usepackage{graphicx}
\usepackage{rotating}
\usepackage{ctable}
\usepackage{multirow}
\usepackage{pbox}
\usepackage{longtable}
\makeatletter
\newif\if@ctbl@long
\define@key{ctbl}{long}[]{\@ctbl@longtrue}
\long\def\foo#1\sbox#2!!{%
\long\expandafter\def\csname\string\ctable\endcsname[##1]##2##3##4{%
#1\if@ctbl@long\ctbl@long\fi\sbox#2}}
\expandafter\expandafter\expandafter\foo
\csname\string\ctable\endcsname[#1]{#2}{#3}{#4}!!
\def\ctbl@long\fi\sbox#1#2#3\@ctblend{\fi
\ctbl@@long#2%
}
\long\def\ctbl@@long#1#2#3#4#5#6{%
\ctbl@@@long#6%
}
\def\ctbl@@@long#1\begin#2#3#4\end#5{%
\def\@tempa{#5}%
\def\@tempb{tabular}%
\ifx\@tempa\@tempb\else\show\@tempa\ERROR\fi
\begin{longtable}{#3}%
\caption{\@ctblcaption\ifx\@ctbllabel\empty\else\label{\@ctbllabel}\fi}%
\endfirsthead
\caption*{\@ctblcaption\space(continued)}%
\endhead
#4\end{longtable}}
\makeatother
\begin{document}
\ctable[
caption = Data Definitions and Sources,
label = data,
long
]
{>{\bfseries}l p{0.3\columnwidth} c c p{0.3\columnwidth}}
{
}
{ \FL
a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\
a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\
a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\
a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\
a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\
a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\
}
\end{document}
答案2
抱歉,我刚刚找到了一个相关问题的答案,内容如下:
该软件包不提供这种可能性。该软件包使用 minipage,这使得更改内部代码变得很困难。不过我认为切换到 longtable 并不难。