LaTeX排版(一):字体、页眉页脚、页边距、行距的设置 | 您所在的位置:网站首页 › ps文字怎么排版调行距和行距一样 › LaTeX排版(一):字体、页眉页脚、页边距、行距的设置 |
目录
字体设置布局设置页眉页脚设置行距的设置其他
字体设置
字体设置需要用到宏包fontspec,需要在导言区添加如下指令: \usepackage{fontspec}中英文字体都可以分为如下3种: 正文字体族无衬线字体族打字机字体族设置中英文正文字体的命令如下(另外两种后面需要用到时再来补上): %设置英文正文字体 \setmainfont{Times New Roman} %设置中文正文字体 \setCJKmainfont{SimSun}注意: 设置中文字体前,必须在导言区加入: \usepackage[slantfont, boldfont]{xeCJK}上面方括号中的参数开启中文下的斜体与粗体,即使命令\textit{}和\textbf{}对中文也有效。 在指定正文字体时,还可以设置其颜色,如下: %设置英文正文字体为红色 \setmainfont[Color={ff0000}]{Times New Roman} %设置中文正文字体为绿色 \setCJKmainfont[Color={00ff00}]{SimSun} 布局设置geometry包可以用来设置页面的布局,如页边距等,导入geometry包: \usepackage{geometry}设置页边距(上下左右边距) \geometry{left=25mm,right=20mm,top=25mm,bottom=25mm} 页眉页脚设置使用fancyhdr包来进行页眉页脚的设置: \usepackage{fancyhdr} %导入包 \pagestyle{fancy} %指定pagestyle %clears the header and footer, %otherwise the elements of the %default "plain" page style will appear. \fancyhf{}可以设置页眉页脚各自左中右共6个位置的内容 \lhead{} \chead{} \rhead{} \cfoot{\thepage} \rfoot{} \lfoot{}关于页码的显示:\thepage 若要用到总页数,则需要导入包lastpage: \usepackage{lastpage}此时可以设置页码为如x/x的格式: \cfoot{\thepage / \pageref{LastPage}}若要设置页眉页脚线宽,使用如下命令: \renewcommand{\headrulewidth}{0.1mm} \renewcommand{\footrulewidth}{0.1mm} % 设为0时,不显示相应的线注意: 命令\geometry{}必须放在\pagestyle{fancy}之前首页\maketitle后需要加上\thispagestyle{fancy} 行距的设置需要用到包setspace: \usepackage{setspace}设置为20磅行间距: \setlength{\baselineskip}{20pt}上面这行命令必须放在\begin{document}之后才能生效 其他 不显示日期\date{}标题斜体\title{\textit{ 你的标题 }}添加邮箱信息(在作者姓名正下方),纯文本形式:\author{D. Trump \\ [email protected]} 效果如下:![]() ![]() |
CopyRight 2018-2019 实验室设备网 版权所有 |