Latex 将比文本列宽的表格居中

Latex 将比文本列宽的表格居中,latex,center,Latex,Center,我在LaTeX文档中包含了一个表格,如果表格宽度不超过其上方的文本列,则居中效果很好,但当表格更宽时,表格的左侧会粘在文本列的左侧,表格的附加宽度位于页面的右侧,如何将表格居中?是否使用多栏文档?因此,考虑表*/COD>变型环境。 在单列环境中,您的选项运行到: 增加文本宽度。但是默认的边距是出于良好的人体工程学原因而选择的,因此除了最小的调整之外,这是不鼓励的 减少表格中的文本大小(即\small或甚至\footnotesize在表格环境中)。同样,这不是最优的 按照中的建议使用。在我的论文

我在LaTeX文档中包含了一个表格,如果表格宽度不超过其上方的文本列,则居中效果很好,但当表格更宽时,表格的左侧会粘在文本列的左侧,表格的附加宽度位于页面的右侧,如何将表格居中?

是否使用多栏文档?因此,考虑<代码>表*/COD>变型环境。 在单列环境中,您的选项运行到:

  • 增加
    文本宽度
    。但是默认的边距是出于良好的人体工程学原因而选择的,因此除了最小的调整之外,这是不鼓励的
  • 减少表格中的文本大小(即
    \small
    或甚至
    \footnotesize
    表格
    环境中)。同样,这不是最优的
  • 按照中的建议使用。在我的论文中,我将其用于几个非常大的表(只有
    p
    定位选项),结果非常好
    • 我建议您试试这个软件包

      chngpage
      包的文档位于
      chngpage.sty
      文件的底部。我已取出
      adjustwidth
      环境的文档:

      在可调整宽度的环境中 左右边距可以是 调整。环境就是其中之一 可选参数和两个必填项 长度参数:

      \begin{adjustwidth}[]{leftmargin}{righMargin}

      A positive length value will increase the relevant margin
      
      (缩短文本行)而 负长度值将减小 边距(加长文本行)。 空长度参数表示否 更改到页边空白处。在…的结尾 页边距恢复到的环境 它们的原始价值

      例如,扩展文本 在右边空白处:

      \begin{adjustwidth}{}{-8em}

      可选的任何外观 参数(即使只是
      []
      )也会导致 要切换的边距值 在奇数页和偶数页之间

      如果正在设置文档 从两方面来看,这可能有利于 有没有更宽泛的文字延伸到 外缘。这可以通过 可选参数,如下所示:

      \begin{adjustwidth}[]{}{-8em}

      调整文本 水平居中 任何周围的文字,边距 应进行同等调整:

      \begin{adjustwidth}{-4em}{-4em}


      如果使用的是\table浮点,则\begin{adjustwidth}\end{adjustwidth}必须包含在其中。

      在图形中,图形环境必须包含
      adjustwidth
      env。。此外,
      标题
      应留在该环境之外,以与整个图形的宽度对齐:

      \begin{figure}[h]
        \begin{adjustwidth}{-1in}{-1in}% adjust the L and R margins by 1 inch
          \centering
          \includegraphics[scale=0.44]{res/sth.png}
        \end{adjustwidth}
        \caption{sth}
        \label{fig:sth}
      \end{figure}
      

      乳胶:定心台大于textwidth

      通常,您可以使用\center将表格居中。但当表格长度超过\text宽度时,它将与左侧边距对齐。您可以临时调整文本宽度

      % allows for temporary adjustment of side margins
      \usepackage{chngpage}
      
      \begin{table}
          \begin{adjustwidth}{-.5in}{-.5in}  
              \begin{center}
              \begin{tabular}{|c|}
                  \hline
      And here comes a very long line. And here comes a very long line. And here comes a very long line.  \\
                  \hline
              \end{tabular} 
      
              \caption{This Table is longer than the text width. And its caption is really long, too. This Table is longer than the text width. And its caption is really long, too. This Table is longer than the text width. And its caption is really long, too. This Table is longer than the text width. }
              \label{myTable}
              \end{center}
          \end{adjustwidth}
      \end{table}
      

      回答得很好。一个警告:最好使用更新的“changepage”包,它几乎相同,但使用与memori类相同的接口。都是同一个作者,威尔,没错。但是由于
      changepage
      包是如此的新,我在这里使用了
      chngpage
      包,因为它与所有的LaTeX发行版一起提供。对泽库吉来说,
      adjustwidth
      环境的语法在
      chngpage
      changepage
      包之间稍有不同。在堆栈溢出问题上,请在此处包含对文档完整的源的外部引用,但在回答中包含来自外部源的最重要/相关的片段非常重要并给出如何回答问题的上下文,因为如果该链接失效(服务器宕机等),那么您的答案将变得毫无用处。
      % allows for temporary adjustment of side margins
      \usepackage{chngpage}
      
      \begin{table}
          \begin{adjustwidth}{-.5in}{-.5in}  
              \begin{center}
              \begin{tabular}{|c|}
                  \hline
      And here comes a very long line. And here comes a very long line. And here comes a very long line.  \\
                  \hline
              \end{tabular} 
      
              \caption{This Table is longer than the text width. And its caption is really long, too. This Table is longer than the text width. And its caption is really long, too. This Table is longer than the text width. And its caption is really long, too. This Table is longer than the text width. }
              \label{myTable}
              \end{center}
          \end{adjustwidth}
      \end{table}