附录主要包含表格——浮点数和长表的问题

附录主要包含表格——浮点数和长表的问题

\chapter我正在用和对附录进行分段\section,有时我必须添加一些文本部分,然后放置下表下一页。我不知道如何防止这些表格放置。

问题 1

我的第二个问题是附录主要由长表 ( \longtable) 组成,当将一个长表放在另一个长表之后等时,行块会发生移动。我猜这是一些浮动问题。请参见此处的屏幕截图:

在此处输入图片描述

我收到警告:

Package longtable Warning: Column widths have changed (longtable) in table 2 on input line 257.

当我删除 \chapter 和 \section 部分时,表格排列得很好,但我需要一个结构化的附录。那里发生了什么?

平均能量损失

\documentclass[BCOR=5mm,paper=letter,11pt,title page,oneside,headinclude, footinclude=true,abstractoff,headings=optiontohead,cleardoublepage=empty]{scrbook}
\usepackage{classicthesis} % nochapters

\usepackage{lipsum}


\usepackage{longtable}
\usepackage{booktabs}

\usepackage{lscape}

\begin{document}

    \lipsum[3-6]

    \appendix

    \chapter{Data}
    \section{A section}
    \lipsum[3-8]

    \begin{landscape}
    \begin{center} %example from: http://users.sdsc.edu/~ssmallen/latex/longtable.html
    \begin{longtable}{|l|l|l|}
    \caption[Feasible triples for a highly variable Grid]{Feasible triples for 
    highly variable Grid, MLMMH.} \label{grid_mlmmh} \\

    \hline \multicolumn{1}{|c|}{\textbf{Time (s)}} & \multicolumn{1}{c|}{\textbf{Triple chosen}} & \multicolumn{1}{c|}{\textbf{Other feasible triples}} \\ \hline 
    \endfirsthead

    \multicolumn{3}{c}%
    {{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
    \hline \multicolumn{1}{|c|}{\textbf{Time (s)}} &
    \multicolumn{1}{c|}{\textbf{Triple chosen}} &
    \multicolumn{1}{c|}{\textbf{Other feasible triples}} \\ \hline 
    \endhead

    \hline \multicolumn{3}{|r|}{{Continued on next page}} \\ \hline
    \endfoot

    \hline \hline
    \endlastfoot

    0 & (1, 11, 13725) & (1, 12, 10980), (1, 13, 8235), (2, 2, 0), (3, 1, 0) \\
    2745 & (1, 12, 10980) & (1, 13, 8235), (2, 2, 0), (2, 3, 0), (3, 1, 0) \\
    5490 & (1, 12, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    8235 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    10980 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    13725 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    16470 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    19215 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    21960 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    24705 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    27450 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    30195 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\
    32940 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    35685 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    38430 & (1, 13, 10980) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    41175 & (1, 12, 13725) & (1, 13, 10980), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    43920 & (1, 13, 10980) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    46665 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\
    49410 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\
    52155 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    54900 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    57645 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    60390 & (1, 12, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    63135 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    65880 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    68625 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\
    71370 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    74115 & (1, 12, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    76860 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    79605 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    82350 & (1, 12, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    85095 & (1, 12, 13725) & (1, 13, 10980), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    87840 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    90585 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    93330 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    96075 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    98820 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    101565 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    104310 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    107055 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    109800 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    112545 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    115290 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    118035 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    120780 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    123525 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    126270 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    129015 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\
    131760 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\
    134505 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    137250 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    139995 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\
    142740 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\
    145485 & (1, 12, 16470) & (1, 13, 13725), (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    148230 & (2, 2, 2745) & (2, 3, 0), (3, 1, 0) \\
    150975 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    153720 & (1, 12, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    156465 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    159210 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    161955 & (1, 13, 16470) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    164700 & (1, 13, 13725) & (2, 2, 2745), (2, 3, 0), (3, 1, 0) \\
    \end{longtable}
    \end{center}
    \end{landscape}



    \end{document}

答案1

在 egreg 提示有关 soul 之后,在加载 classicthesis(或 soul)后在序言中添加以下内容可以使 longtable 稳定下来。

问题在于 classicthesis 将 chaptermark 定义为使用页眉中的字母间距,如果使用 soul 实现,框 1 会在 longtable 不合适的时间重置。可以说 longtable 应该可以保护自己免受这种情况的影响,但使用框 1 停止 soul 并使用新分配的框更容易。

\makeatletter
\newbox\zzzz
\def\SOUL@analyze{{%
    \setbox\z@\vbox{%
        \unvcopy\z@
        \unskip
        \unpenalty
        \global\setbox\zzzz=\lastbox}%
    \ifvoid\zzzz
    \else
        \setbox\zzzz\hbox{\unhbox\zzzz}%
        \SOUL@syllgoal=\wd\zzzz
        \advance\count@\@ne
        \SOUL@analyze
        \SOUL@syllwidth\z@
        \SOUL@syllable={}%
        \ifnum\count@>\z@
            \advance\SOUL@syllgoal-\SOUL@ttwidth
            \SOUL@dosyllable
            \SOUL@getkern{\the\SOUL@lasttoken}{\SOUL@hyphkern}%
                {\SOUL@sethyphenchar}%
            \SOUL@everyhyphen
        \else
            \SOUL@dosyllable
        \fi
    \fi
}}

如果有人想在格林威治标准时间 (GMT) 晚上处理这个问题,则无需回答。

更多的 M MWE 是

\documentclass{book}
\usepackage{classicthesis}

\makeatletter

\usepackage{longtable}

\usepackage{lscape}

\begin{document}

\chapter{Data}

\begin{landscape}


\begin{longtable}{|l|}
a\endfirsthead
b\endhead
cc\endfoot
d\endlastfoot
x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\
x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\
x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\
x\\x\\x\\x\\x\\x\\x\\x\\x\\x\\
\typeout{^^J^^JFINAL WIDTHS: \LT@save@row^^J^^J}
\end{longtable}

\end{landscape}

\end{document}

输出结果为

FINAL WIDTHS: 

列宽数据丢失。

如果你注释掉\usepackage{classicthesis}\chapter{Data}或中的任何一个,\begin{landscape} \end{landscape}那么它就会按预期工作,并且你会得到

FINAL WIDTHS: \omit \kern 20.8889pt\relax 

经典论文正在加载的某些内容正在干扰 longtable 的输出例程,但是现在太晚了,无法盯着\tracingall我自己的代码日志:-)

答案2

longtable不稳定的问题是由于与soul包的交互不好造成的;如果你使用该pdfspacing选项,它就会被修复,无论如何都建议这样做:

\usepackage[pdfspacing]{classicthesis}

对于另一个问题,信息不够充分。

相关内容