【问题标题】:How do I change the amount of whitespace between sections in Latex?如何更改 Latex 中各部分之间的空白数量?
【发布时间】:2013-05-09 23:24:01
【问题描述】:

如何修改 Latex 文档中一个节的结尾和下一节的标题之间的距离?

【问题讨论】:

    标签: layout latex whitespace spacing


    【解决方案1】:

    您可以使用titlesec 包配置节标题的样式,包括间距。有一个“紧凑”选项可以简单地减少空间,或者您可以使用更高级的选项指定特定值(有关详细信息,请参阅链接页面上的文档)。

    【讨论】:

    • titlesec 看起来像一个很棒的包。
    【解决方案2】:

    titlesec 的替代方法是重新定义 section 命令,如下面的 sn-p。请注意, beforeskip 和 afterskip 是您感兴趣的变量。代码本身只是前几行。当我将整个内容从一个文档剪切并粘贴到另一个文档时,后面是一个冗长的注释来提醒我这些定义。顺便说一句,代码或多或少来自不可或缺的书,The LaTeX Companion, Second Edition

    \makeatletter
     \renewcommand\section{\@startsection {section}{1}{\z@}%
         {-2.5ex \@plus -1ex \@minus -.2ex}%
         {1.3ex \@plus.2ex}%
        {\centering\bfseries}}
    % \@startsection {NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE} 
    %            optional * [ALTHEADING]{HEADING}
    %    Generic command to start a section.  
    %    NAME       : e.g., 'subsection'
    %    LEVEL      : a number, denoting depth of section -- e.g., chapter=1,
    %                 section = 2, etc.  A section number will be printed if
    %                 and only if LEVEL gt or eq the value of the secnumdepth
    %                 counter.
    %    INDENT     : Indentation of heading from left margin
    %    BEFORESKIP : Absolute value = skip to leave above the heading.  
    %                 If negative, then paragraph indent of text following 
    %                 heading is suppressed.
    %    AFTERSKIP  : if positive, then skip to leave below heading,
    %                       else - skip to leave to right of run-in heading.
    %    STYLE      : commands to set style
    %  If '*' missing, then increments the counter.  If it is present, then
    %  there should be no [ALTHEADING] argument.  A sectioning command
    %  is normally defined to \@startsection + its first six arguments.
    \makeatother
    

    【讨论】:

      猜你喜欢
      • 2017-04-17
      • 2021-12-15
      • 1970-01-01
      • 2020-10-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多