LaTeX的版面设计

1.纸张大小的设置

%导入版面设置的宏包
\usepackage{geometry}

使用命令:\geometry{papersize={宽, 高}}

如:\geometry{papersize={20cm, 15cm}}

 

2.边距的设置

%导入版面设置的宏包
\usepackage{geometry}

使用命令:\geometry{left=左边距,right=右边距,top=上边距,bottom=下边距}

如:\geometry{left=5cm,right=5cm,top=5cm,bottom=5cm}

3.页眉页脚的设置

%导入页眉页脚需要的宏包
\usepackage{fancyhdr}
\pagestyle{fancy}

  1. %设置页眉
    \lhead{页眉左}
    \chead{页眉中}
    \rhead{页眉右}
  2. %设置页眉
    \lfoot{左页脚}
    \cfoot{中页脚}
    \rfoot{右页脚}
  3. 如下:
    %设置页首
    \lhead{张一根}
    \chead{理工大学}
    \rhead{\today}
    %设置页眉
    \lfoot{左页脚}
    \cfoot{\thepage}
    \rfoot{右页脚}

4.横分割线的设置

命令如下:

\renewcommand{\headrulewidth}{上分割线的宽度}
\renewcommand{\headwidth}{\textwidth}
\renewcommand{\footrulewidth}{下分割线的宽度}

例子如下:

\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\headwidth}{\textwidth}
\renewcommand{\footrulewidth}{0.4pt}

扫描二维码关注公众号,回复: 9890826 查看本文章

5.行间距与段间距

%行间距所用的包
\usepackage{setspace}

  1. 命令:设置行间距,1.5倍
    \onehalfspacing

  2. 设置段落间距
    \addtolength{\parskip}{宽度}

  3. 实例如:

    \addtolength{\parskip}{0.4em}

示例:

代码:

%导言区
\documentclass{ctexart}

%导入版面设置的宏包
\usepackage{geometry}
%导入页眉页脚需要的宏包
\usepackage{fancyhdr}
\pagestyle{fancy}
%行间距所用的包
\usepackage{setspace}

%设置纸张的大小
\geometry{papersize={20cm, 15cm}}
%设置边距
\geometry{left=2cm,right=5cm,top=5cm,bottom=5cm}
%设置页首
\lhead{陆某某}
\chead{理工大学}
\rhead{\today}
%设置页眉
\lfoot{左页脚}
\cfoot{\thepage}
\rfoot{右页脚}
%设置横线分割的宽度
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\headwidth}{\textwidth}
\renewcommand{\footrulewidth}{0.4pt}
%设置行间距,1.5倍
\onehalfspacing
%设置段落间距
\addtolength{\parskip}{0.4em}

%正文区
\begin{document}
    秋风用时光的旋律,用桂花的芬芳、苹果的馨香、菊花的灿烂、牵牛花的奔放、一串红的艳丽,把一望无际的田野乡村,演绎得在自然中沉醉,渲染得天地间空旷而又阳刚。
    
    酷热的夏天刚刚过去,秋风吹来,秋牵着一个个节气的手,舞动着长袖,用婀娜多姿的舞姿,用变幻神奇的旋律,动听的音符,把蓝天吹得一会白云飘飘,一会云蒸霞蔚,一会仙女舞袖,一会又涌来千顷碧波。更让那成千上万得雀鸟,不顾辛苦劳顿,路途遥远,赶赴银汉,为牛郎织女架起一座相会的鹊桥,就为这对生离死别的鸳鸯说上一晚悄悄话。
\end{document}

运行效果:

发布了118 篇原创文章 · 获赞 63 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/qq_42185999/article/details/104275141