Latex 乳胶:多行的问题

Latex 乳胶:多行的问题,latex,multirow,Latex,Multirow,我正在用mulitrow创建一个表,但我遇到了一个问题。据我所知,这是多行的形式: \multirow{count}{alignment}{content} 其中count是要合并的行数,alignment是l、c、r或*,content是行的内容。我尝试了以下方法: \multirow{3}{*}{Framing} 但是我遇到了一个问题。我看到的不是单元格中的“Framing”一词,而是“3*Framing”,表示\multirow元素不起作用。有什么想法吗 另外,如何使单元格中的文本垂直


我正在用mulitrow创建一个表,但我遇到了一个问题。据我所知,这是多行的形式:

\multirow{count}{alignment}{content}
其中count是要合并的行数,alignment是l、c、r或*,content是行的内容。我尝试了以下方法:

\multirow{3}{*}{Framing}
但是我遇到了一个问题。我看到的不是单元格中的“Framing”一词,而是“3*Framing”,表示\multirow元素不起作用。有什么想法吗

另外,如何使单元格中的文本垂直对齐

更新: 我原以为\usepackage{multirow}可以解决这个问题,但我仍然看到一些问题: 首先,我不能进行垂直对齐。 其次,我在“框架”单元中发现了一些奇怪的东西。不是让“框架”向左对齐,而是得到一个包含字母“l”的虚拟行,然后在两个虚拟行之后得到单词“框架”!!是这样的:

______________
|     l       |
|             |
|     Framing |
|             |
|             |
|             |
|             |
______________
这是我为询问此事的人准备的桌子:

\begin{table*}\tiny
    \centering
    \begin{tabular}{|c|c|c|c|c|p{2in}|}
        \hline

        Rule & Factor & Best Value & \Delta_t & \Delta_{do} & Comments \\

        \hline

        % Diagonal Dominance Rule
        \multirow{3}{*}{Diagonal Dominance} & Line Angle & 45 & 15 & 30 & The angle between the prominent line of the object and
                                                                          the diagonal lines \\                                     % TODO: What object? Make sure it is clear.
                                            & Line Distance & 0 & 0.25 & 1 & The distance, in screen coordinates, from the
                                                                             prominent line of the object to the diagonal lines. \\ % TODO: Need to define screen coordinates
                                            & Corner Distances & 0 & 0.1 & 0.7 & The distance, in screen coordinates, from the
                                                                                 end of the prominent line of the object to the corners of the screen. \\

        \hline

        % Framing Rule
        \multirow{4}{l}{Framing} & Left Distance & 0 & ${Frame Width}*5\%$ & ${Frame Width}*25\%$ & The distance between the
        left side of the frame covering the object and the left or the right side of the intended frame, whichever closer. \\
                                & Right Distance & 0 & ${Frame Width}*5\%$ & ${Frame Width}*25\%$ & The distance between the
        right side of the frame covering the object and the left or the right side of the intended frame, whichever closer. \\
                                & Top Distance & 0 & ${Frame Height}*5\%$ & ${Frame Height}*25\%$ & The distance between the
        top side of the frame covering the object and the upper or the lower side of the intended frame, whichever closer. \\
                                & Bottom Distance & 0 & ${Frame Height}*5\%$ & ${Frame Height}*25\%$ & The distance between the
        bottom side of the frame covering the object and the upper or the lower side of the intended frame, whichever closer. \\

        \hline
    \end{tabular}
    \caption{The factors of each rule and their parameters.}
    \label{table:factors}
\end{table*}
问候,

Rafid胡乱猜测:您得到的是
未定义的控制序列:多行
,因为您在序言中缺少
\usepackage{multirow}

是的,您需要
多行

\usepackage{multirow}
\begin{document}
\begin{table}
\centering
\begin{tabular}{l||c|r}
Header 1 & Header 2 & Header 3 \\
\multirow{2}{*}{Hello} & stuff & stuff \\
& Body 2 & Body 3
\end{tabular}
\end{table}
\end{document}
编辑后编辑问题:我有两个错误:

  • \multirow{4}{l}{Framing}
    。我改为
    \multirow{4}{*}{Framing}

  • Delta\u t
    更改为
    $Delta\u t$

  • 否则,一切似乎都很好。您可能也想问。

    1)您是否将
    \usepackage{multirow}
    放在文档的开头

    2) 可能有一些很好的例子可以效仿。我从未使用过这个软件包,但在很短的时间内(几秒钟)就可以通过谷歌找到它。下面的例子对你有帮助吗


    更新:在看到您的实际表格后,我不想这么说,但我认为您的间距问题是由于“注释”列中的多行溢出造成的。我截短了您的评论,得到了以下结果(第1列现在按需要垂直居中):

    关于{l}论点,我认为我最初发布的链接可能是错误的。当我尝试将
    \multirow
    参数的*替换为l时,LaTeX为我指出了一些错误。我在测试台上得到这个:

    ! Missing number, treated as zero.
    <to be read again> 
                       l
    l.12 \multirow{4}{l}{Batch}
                                & MM & Min-Min \\
    ! Illegal unit of measure (pt inserted).
    <to be read again> 
                       l
    l.12 \multirow{4}{l}{Batch}
                                & MM & Min-Min \\
    
    我们一直假设{cell width}实际上是{alignment},我认为前面的链接让人困惑。请参见LyX wiki上关于间距的注释;您可以在需要的地方使用以下工具进行投标:

    \renewcommand{\multirowsetup}{\centering}
    
    并在需要时用
    \raggedleft
    \raggedright
    替换
    \centralized
    。我仍然认为你们会因为多条线路而遇到麻烦。我至少已经证明了挖沟可以使间距按预期工作。。。恐怕我无法理解如何强迫他们以你默认的例子为中心。但也许现在你知道问题出在哪里了

    我想如果你真的,真的,真的想,你可以把你的句子分成几行,计算出它需要多少行,然后根据行数的增加相应地调整你的
    \multirow
    参数。尽管您可能还需要嵌套的多行结构:

    |                   | item 1, 2 rows | comment 1 line 1              |
    |  multirow, 4 rows |                | comment 1 line 2 (spill over) |
    |                   | item 2, 2 rows | comment 2 line 1              |
    |                   |                | comment 2 line 2 (spill over) |
    
    这有意义吗?第1列将跨越其部分的所有行,后续行将跨越拆分注释所需的行数,注释所需的每行(有些占3行或4行)将位于各自的单独行上,并且看起来是连续的。不过,我不确定句子的间距是否会显得奇怪

    闲聊。这是你的思想食粮


    最后一个更新:实现这一点的最后一个希望是使用TikZ表。基本上,你的节点就像“细胞”,然后把它们放在一起,使它看起来像一张桌子。也许这是一个糟糕的建议,但我向您保证,在单元格间距等方面,您将拥有所需的所有灵活性。一些想法:

    • 这可能会让您了解如何比前两个做得更好一些

    如何写出好的问题:请告诉我们您遇到了哪一个错误,而不是写“我遇到了一个错误”。这是在您引用的语句之后解释的:“我看到的不是单元格中的“Framing”一词,而是表示\multirow元素不起作用的“3*Framing”。“对不起,可能是“error”一词”这是不准确的。没有编译错误,只是输出中有错误。如果你愿意,可以称之为“问题”。啊,好的,谢谢你的澄清。顺便说一句:我强烈建议你就这个问题提问。并不是说编程性质的latex问题在这里是离题的,而是因为我怀疑您会在这里得到更快的答案……是的,这似乎是\usepackage的问题。我现在用它,它似乎工作得很好,但我仍然无法设法得到垂直对齐。我试了几次,会看到的。你能用一个样本表更新你的问题吗,这样我就可以准确地尝试你是什么了?这可能会帮助我们所有人。仅用一个
    \multirow{3}{*}{Framing}
    line@Rafid:我根据您的实际表格更新了我的答案。@Hendy:我看到了您的更新,非常感谢。知道multirow包在跨多行的单元格上有问题,真是太可怕了!我认为对我来说,更好的解决方案是简化表格并使用符号使其变小,然后在另一个表格中解释符号。@Rafid:要么这样,要么用TikZ作弊。请参阅我的更新以获取更多建议?
    \renewcommand{\multirowsetup}{\centering}
    
    |                   | item 1, 2 rows | comment 1 line 1              |
    |  multirow, 4 rows |                | comment 1 line 2 (spill over) |
    |                   | item 2, 2 rows | comment 2 line 1              |
    |                   |                | comment 2 line 2 (spill over) |