LaTex 页面设置 Xiaoqiang Wu

同一文档多种页眉页脚风格

  有时候,对于同一个文档需要不同的页眉页脚,比如我工开题报告在目录页面中只要求有页眉,不要页脚。这样用\clearpagestyle将会失败,这里采用如下方式进行设置:

%%%%%%%%%%%%%%This is also work and clearer%%%%%%%%%%
\fancypagestyle{contentpagestyle}{
  \fancyhead[C]{\songti \zihao{-5} 哈尔滨工业大学(深圳)硕士学位论文开题报告}
  \fancyfoot[C]{\empty}
}
\thispagestyle{contentpagestyle}

%%%%%%%%%%%%%%This one is more elegant%%%%%%%%%%%%
\fancypagestyle{plain}{
  \fancyfoot{\empty}
  \newgeometry{text={160true mm,234true mm},left=25true mm,top=8mm,headsep=-2cm}
}

  这样只会清空该页面的页脚而保留页眉。正文中的设置如下:

\fancyhead[C]{\songti \zihao{-5} 哈尔滨工业大学(深圳)硕士学位论文开题报告}
\fancyfoot[C]{\zihao{-5} -~\thepage~-}
\renewcommand\bibsection{\section*{\centerline{\bibname}}
\markboth{哈尔滨工业大学(深圳)硕士学位论文开题报告}{\bibname}}

  另外,对于headsep参数是为了控制页眉底部到页主体顶部的距离,类似这样的参数还有:

  • texwidth, texheight 正文body的宽度和高度, 不包括页眉页脚
  • oddsidemargin, evensidemargin 奇数/偶数页, 纸张左边缘到页body左边缘的距离减去一英寸
  • topmargin 纸张上边缘到页眉或body(无页眉时)的距离减去一英寸
  • marginparwidth 页边注(marginnote)的宽度
  • marginparsep 正文边缘到页边注边缘的距离
  • headheight 页眉高度
  • headsep 页眉底部到页主体顶部的距离
  • footheight 页脚高度
  • footskip 页正文最后一行底到页脚底的距离

建议, 总把

  • 如果有页眉页脚
    • oddsizemargin(奇数页的左边界)
    • evensidemargin(偶数页的左边界)
    • topmargin(从上页边到页眉的距离)设为0cm;
  • 如果没用页眉, 将
    • headheight(页眉高度),
    • headsep(页眉基线到正文顶部的距离)设为0cm;
  • 如果没用页脚, 将
    • footheight(已过时latex2e中已被去掉),
    • footskip(正文底部到页脚底部的距离)

设为0cm,这样便于在输出时直接利用驱动程序的功能控制版心的位置.

  • columnsep 双栏article中, 左右栏间空白的距离
  • columnseprule 双栏article中, 左右栏间分隔线的宽度, 缺省为零, 即没有线

以下参数的修改可以在begin{document}的前面和后面:

  • parskip 段落之间除了空出正常行距外额外空出的距离
  • parindent 段首空白的长度
  • footnotesep 两个注脚之间的距离
  • baselineskip 正文中前一行底和第二行底的距离, 会因字号的改变自动改变.

  另外, 定义行距还有一个特殊的参数, 那是baselinestretch,它是用在begin{document}前的全局变量, 修改格式如renewcommandbaselinestretch{倍数},缺省时为1.0, 因此LaTeX中最小行距是baselineskip乘上baselinestretch得到的.

  还有,LaTex对标题与正文间距,标题与上下文距离调整

\usepackage{titlesec}

\titleformat{\chapter}[display]{\normalfont\huge\bfseries\center}{\chaptertitlename\ \thechapter}{10pt}{\Huge}
\titleformat{\section}{\normalfont\Large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}{\normalfont\large\bfseries}{\thesubsection}{1em}{}
\titleformat{\subsubsection}{\normalfont\normalsize\bfseries}{\thesubsubsection}{1em}{}
\titleformat{\paragraph}[runin]{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titleformat{\subparagraph}[runin]{\normalfont\normalsize\bfseries}{\thesubparagraph}{1em}{}

下面的命令用于调节标题与上下文,段落之间间距命令

\titlespacing*{\chapter} {0pt}{50pt}{40pt}
\titlespacing*{\section} {0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
\titlespacing*{\subsection} {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\titlespacing*{\subsubsection}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\titlespacing*{\paragraph} {0pt}{3.25ex plus 1ex minus .2ex}{1em}
\titlespacing*{\subparagraph} {\parindent}{3.25ex plus 1ex minus .2ex}{1em}

参数随便改,比如:我用\titlespacing*{\section}{0pt}{9pt}{0pt}来设置小的上下文与标题间距。

调节–目录–这两个字之间的间距

  通常无需对其进行设置,但有些用word的排版会做如此要求。

\renewcommand{\contentsname}{\xiaoer\heiti 目\quad 录}

这样通过renewcommand就可以对生成目录这两个字的命令进行重定义。