我正在使用 APA 文档类。我的文档有一些表格:
\documentclass[jou]{apa}
\usepackage{tabularx}
\title{This is the title}
\author{This is the author}
\begin{document}
\maketitle
This is some text so that you can see how wide each of the columns is in the document.
\noindent\begin{tabularx}{\textwidth}{|X|X|}
1 & 2 \\
\end{tabularx}
\end{document}
当我编译它时,宽度太宽,与列宽不匹配。我尝试用 替换\textwidth
,\linewidth
但这也不起作用。
- 如何设置表格以匹配 APA 文档类中的列宽?
答案1
APA 课程\tabular
以一种彻底令人困惑的方式重新定义tabularx
。
这里有一个解决方法:在中我们恢复和apatabularx
的原始含义。\tabular
\endtabular
\documentclass[jou]{apa}
\usepackage{tabularx,lipsum}
\title{This is the title}
\author{This is the author}
\makeatletter
\newenvironment{apatabularx}
{\let\tabular\old@tabular\let\endtabular\orig@endtabular\tabularx}
{\endtabularx}
\makeatother
\begin{document}
\maketitle
\lipsum[1-2]
\medskip
\noindent\begin{apatabularx}{\columnwidth}{|X|X|}
This is some text so that you can see how wide each of the columns is in the document.
&
This is some text so that you can see how wide each of the columns is in the document.
\\
\end{apatabularx}
\medskip
\lipsum[3-6]
\end{document}