LaTex(PART VIII)文档类和页面布局相关

文档类

在进行源文件处理之前,需要知道所处理的文件的类型,
此时documentclass命令派上了用场。
格式:

\documentclass[options]{class}

实例:

\documentclass[UTF8]{ctexart}

class

选项含义
ctexart支持中文的article
article排版科技期刊、短报告、程序文档、邀请函等。
report排版多章节的长报告、短篇的书籍、博士论文等。
book排版书籍。
slides排版幻灯片。其中使用了较大的sans serif 字体。也可以考虑使

options:

选项含义
10pt, 11pt, 12pt设置文档所使用的字体的大小。如果没有声明任何选项,缺省将使用10pt 字体。
a4paper, letterpaper, …定义纸张的大小,缺省的设置为letterpaper。此外,还可以使用a5paper,b5paper,executivepaper 和legalpaper。
fleqn设置该选项将使数学公式左对齐,而不是中间对齐。
leqno设置该选项将使数学公式的编号防置于左侧。
titlepage, notitlepage指定是否在文档标题(document title)后开始一新页。article 文档类缺省不开始新页,而book 文档类则相反。
onecolumn, twocolumn指定LATEX 以单列(one column)或双列(two column)方式排版文档。
twoside, oneside指定LATEX 排版的文档为双面或单面格式。article 和report 缺省使用单面格式,而book 则缺省使用双面格式。需要注意的是该选项仅作用于文档的式样。twoside选项不会通知你的打印机让以得到双面的打印输出。
openright, openany此选项决定新的章是仅仅在右边页(奇数页)还是在下一可用页开始。该选项对article 文档类不起作用,因为该类中并没有定义“章”(Chapter)。report 类中新的一章开始于下一可用页,而book 类中新的一章总是开始于右边页。
utf8支持中文的编码

页面样式:

LaTex支持三种预定的页面布局方式

style含义
plain页眉为空,页脚由居中的的页码组成。这是默认的页面式样。
headings页眉由当前的章节标题和页码组成,页脚为空。
empty设置页眉、页脚均为空

还有其他的方式,不过需要导包
比如fancy需要导包fancyhdr
代码如下:

\usepackage{fancyhdr}%设置页脚页眉需要的包
\pagestyle{fancy}

命令

\pagestyle{style}

设置页面布局样式
设置当前页面的布局样式

\thispagestyle{style}

完整的代码:

\documentclass[UTF8]{ctexart}
\usepackage{fancyhdr}%设置页脚页眉需要的包
\pagestyle{fancy}
\author{哈巴狗} 
\title{我的论文标题}
%这里是页眉
\lhead{西安电子科技大学}%左边
%\chead{中间}%中间
\rhead{硕士研究生毕业设计}%右边
%这里是页脚
%\lfoot{左边}%页脚左边
\cfoot{\thepage}%页脚中间
%\rfoot{右边}%页脚右边
\renewcommand{\headrulewidth}{0.4pt}%页眉
\renewcommand{\headwidth}{\textwidth}
\renewcommand{\footrulewidth}{0.4pt}
\newcommand{\enabstractname}{Abstract}
\newenvironment{enabstract}{%
    \par\small
    \noindent\mbox{}\hfill{\bfseries \enabstractname}\hfill\mbox{}\par
    \vskip 2.5ex}{\par\vskip 2.5ex}  
\begin{document}
  \maketitle%输出标题
  \newpage%另起一页
  \tableofcontents%命令输出论文目录
  \newpage
  \begin{enabstract}
    This is the abstract in English.    This is the abstract in English.    This is the abstract in English.    This is the abstract in English.    This is the abstract in English.    This is the abstract in English.    This is the abstract in English.    This is the abstract in English.    This is the abstract in English.    This is the abstract in English.    This is the abstract in English.    This is the abstract in English.    This is the abstract in English.    This is the abstract in English.    This is the abstract in English.    This is the abstract in English.    This is the abstract in English.    This is the abstract in English.    This is the abstract in English.

    \centering
    \textbf{Keywords:} Abstract, \LaTeXe, English
  \end{enabstract}

  \newpage%另起一页
  \begin{abstract}
这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,这是中文摘要,
  \newline%另起一行

  \centering%使得关键字居中
  \textbf{关键字:}摘要、\LaTeX、中文
  \end{abstract}
  \newpage%另起一页
 \thispagestyle{empty}
  \section{第一章,一级标题} 这是第一章
    \subsection{二级标题} 第一章二级标题标题
      \subsubsection{三级标题}
      \subsubsection{三级标题}
      \subsubsection{三级标题}
     \subsection{二级标题} 第一章二级标题标题
      \subsubsection{三级标题}
      \subsubsection{三级标题}
      \subsubsection{三级标题}
  \newpage

  \section{第二章,一级标题} 这是第一章
    \subsection{二级标题} 第二章二级标题标题
      \subsubsection{三级标题}
      \subsubsection{三级标题}
      \subsubsection{三级标题}
     \subsection{二级标题} 第二章二级标题标题
      \subsubsection{三级标题}
      \subsubsection{三级标题}
      \subsubsection{三级标题}
\end{document} 
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值