Tabularx 添加不必要的页面

Tabularx 添加不必要的页面

我的文档正在 tabularx 表前创建一个{空白其余页面 + 空白页面}。

已检查此主题没有骰子-我无法用典型的图形/表格放置控制来解决。

这是我的代码:

\chapter{List of Symbols} 
\label{ch:AE}
\begin{tabularx}{1\textwidth}{>{\hsize=.2\hsize$}l<{{}$}>{\hsize=28\hsize}X}[H]
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\ 
...
\end{tabularx}

结果图片如下 - 您可以在第三张图片中看到 [H] 最终被读作第一列的一部分。

我不太熟悉 tabularx,有什么想法吗?

谢谢你的帮助-DR

在此处输入图片描述

在此处输入图片描述

在此处输入图片描述

答案1

如果您不想更改太多代码,只需使用longtable而不是tabularx

梅威瑟:

\documentclass{book}

\usepackage{array,longtable}

\begin{document}

\appendix
\chapter{List of Symbols}
\label{ch:AE}

\begin{longtable}[l]{@{}>{$}p{0.1\hsize}<{$}@{}p{0.9\hsize}@{}}
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\
a & Semi-major axis of Earth \\
Ant_k & Antenna number \emph{k} \\
\end{longtable}

\end{document} 

输出:

在此处输入图片描述

答案2

以防您不知道,有专门的软件包可以打印此类列表。它们还增加了在整个文档中引用符号的可能性。

其中之一是glossaries。下面是一个例子:

\documentclass{book}

\usepackage[acronym,nonumberlist,numberedsection]{glossaries}

\renewcommand{\acronymname}{List of Symbols}
\newglossarystyle{mystyle}{%
  \setglossarystyle{long}%
  \renewenvironment{theglossary}%
     {\begin{longtable}[l]{@{}p{0.1\hsize}p{0.8\hsize}}}%
     {\end{longtable}}%
}


\newacronym{HA}{$[H]a$}{Semi-major axis of Earth}
\newacronym{ANT}{$Ant_k$}{Antenna number $k$}

\makeglossaries

\begin{document}

The symbol \acrshort{HA}

\glsaddall

\appendix
\printglossary[style=mystyle,type=\acronymtype]

\end{document} 

输出:

在此处输入图片描述

要获得输出,您必须运行

pdflatex 我的文件

makeglossaries myfile

pdflatex 我的文件

pdflatex 我的文件

如果你没有安装 Perl,请将第二步替换为

makeindex.exe -s myfile.ist -t myfile.alg -o myfile.acr myfile.acn

答案3

问题在于表格太大,甚至无法包含在一页中,因此首先 LaTeX 将其推送到下一页,因为它无法包含在章节标题中。

然后它尝试将其设置在下一页,但下一页再次没有空间,因此它将它推送到下一页,最后放弃。

你根本就不需要tabularx

\documentclass{book}
\usepackage{setspace}

\newcommand{\sym}[2]{%
  \noindent
  \makebox[4em][l]{$#1$}% <---- adjust to suit
  #2\par
}

\onehalfspacing % you seem to be using this (avoid it, if you can)

\begin{document}

\appendix
\chapter{List of Symbols} 
\label{ch:AE}

\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}

\end{document}

在此处输入图片描述

如果您的描述很长并且可能超过一行,您可以修改的定义\sym以确保描述不会跨页面拆分:

\documentclass{book}
\usepackage{setspace}

\newcommand{\sym}[2]{%
  \noindent
  \makebox[4em][l]{$#1$}% <---- adjust to suit
  \begin{minipage}[t]{\dimexpr\textwidth-4em\relax}
  #2\par\xdef\theprevdepth{\the\prevdepth}
  \end{minipage}\par\prevdepth\theprevdepth
}

\onehalfspacing % you seem to be using this (avoid it, if you can)

\begin{document}

\appendix
\chapter{List of Symbols} 
\label{ch:AE}

\sym{a}{1 Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{2 Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{3 Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{4 Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{5 Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{6 Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{7 Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{8 Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{9 Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{10 Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{11 Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{12 Semi-major axis of Earth Semi-major axis of Earth Semi-major axis of Earth 
  Semi-major axis of Earth Semi-major axis of Earth Semi-major axis of Earth
  Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}
\sym{a}{Semi-major axis of Earth}
\sym{Ant_k}{Antenna number $k$}

\end{document}

在此处输入图片描述

相关内容