1、查看系统安装的中文字体命令:fc-list :lang=zh-cn
2、去掉maketitle产生的标题中的日期
在TeX里,你定义\title{}、\author{},然后再用\maketitle生成标题,默认的情况下,会生成一个写作日期在标题下,此代码类似于: \title{机器学习—人工智能技术的基础} \author{Water Lin} \maketitle 如果不需要日期,可以用在\maketitle前加上一个空的\date{},即用类似于如下的代码: \title{机器学习—人工智能技术的基础} \author{Water Lin} \date{} \maketitle 这样生成的文章标题就不会有日期。
3、文章标题加粗
\title{\textbf 文章的标题} %%用 \textbf命令将文章标题加粗。
4、将正文字体设置为Times New Roman的方法。
在导言区使用指令 \setromanfont{Times New Roman} 或者 \setmainfont{Times New Roman}。
另外,正文内还可以使用 \fontspec{Times New Roman}
5、在一篇article中加入另一篇article(
How to include a document into another document?)
方法一:加入另一篇文章的pdf文件。
\usepackage{pdfpages}
\includepdf[pages={1-2}]{pdffilename}
方法一:\usepackage{standalone}
方法三:
Cut the content (the part between \begin{document}...\end{document}
of B.tex
into a new file B-content.tex
.
Change B.tex
to be:
\documentclass{...}
% your preamble here
\begin{document}
\include{B-content}
\end{document}
Then put
\include{B-content}
into
A.tex
.
具体情况见:http://tex.stackexchange.com/questions/11311/how-to-include-a-document-into-another-document
6、Paragraph Setting 段落设置
- 字间距
- 只适用于CJK和xeCJK
- \renewcommand{\CJKglue}{\hskip 宽度}
- 比如: \renewcommand{\CJKglue}{\hskip 1pt plus 0.08\baselineskip}
- 行间距
- \linespread{因子} 或者 \renewcommand{\baselinestretch}{因子}
- 比如: \linespread{1.5} 或者 \renewcommand{\baselinestretch}{1.5}
- 段间距
- 设置\parskip的值,
- 比如 \setlength{\parskip}{0.5\baselineskip}
- 首行缩进
- 如果默认首行不缩进,则使用indentfirst宏包
- \usepackage{indentfirst}
- 指定某段首行缩进,在段首加 \indent
- 指定某段首行不缩进,在段首加\noindent
- 如果默认首行不缩进,则使用indentfirst宏包
- 设置缩进量
- \setlength\parindent{2em}
- 悬挂缩进
- 在要悬挂缩进的段落前加上
- \noindent
- \hangafter=1
- \setlength{\hangindent}{2em}
- 分别是: 1. 取消首行缩进;2. 设置从第1行之后开始悬挂缩进;3. 设置悬挂缩进量
- 在要悬挂缩进的段落前加上
- 居中、左对齐、右对齐
- 分别有两种形式,一种是环境形式 center, flushleft, flushright,一种是命令形式 centering, raggedright, raggedleft。与命令形式不同,环境形式会插入新段落,如果不希望插入新段落,就得使用命令形式。命令形式通常配合环境使用,限制有效范围在环境 内。还要注意的是,与flushleft 对应的是 raggedright,与 flushright 对应的是 raggedleft,不要搞反了。
- 例子
- \begin{center}
- 居中文字 **** 居中文字
- \end{center}
- 例子
- \noindent
- \begin{minipage}{\linewidth}
- \centering
- 居中文字 **** 居中文字
- \end{minipage}
- 例子
- \begin{flushleft}
- 左对齐文字 **** 左对齐文字
- \end{flushleft}
- 例子
- \noindent
- \begin{minipage}{\linewidth}
- \raggedright
- 左对齐文字 **** 左对齐文字
- \end{minipage}
- 例子
- \begin{flushright}
- 右对齐文字 **** 右对齐文字
- \end{flushright}
- 例子
- \noindent
- \begin{minipage}{\linewidth}
- \raggedleft
- 右对齐文字 **** 右对齐文字
- \end{minipage}
- 例子
- 分别有两种形式,一种是环境形式 center, flushleft, flushright,一种是命令形式 centering, raggedright, raggedleft。与命令形式不同,环境形式会插入新段落,如果不希望插入新段落,就得使用命令形式。命令形式通常配合环境使用,限制有效范围在环境 内。还要注意的是,与flushleft 对应的是 raggedright,与 flushright 对应的是 raggedleft,不要搞反了。
7、设置文本的页边距
\usepackage[top=1in, bottom=1in, left=1.25in, right=1.25in]{geometry}
8、减少标题与正文的间距
\setlength{\parskip}{-1.5\baselineskip}
9、取消第一页的页码
thispagestyle{empty}要紧跟在\maketitle后面
10、空格
- in - 英寸(inch)
- mm - 毫米(millimeters)
- cm - 厘米(centimeters)
- pt - points (大约 1/72 inch)
- em - 接近当前字体的字符 "M"的宽度(approximately the width of an "M" in the current font)
- ex - 接近当前字体的字符 "x"的高度approximately the height of an "x" in the current font
11、使sum符号的上标和下标在正上方和正下方
\sum\limits_{i=1}^{n}
12、绝对值符号和范数符号
绝对值号: | 或者 \vert
范数符号: \| 或者 \Vert
在需要的时候,请使用\left\right 或者 “手动”调整大小。
注意:直接用两竖 || 得不到范数符号
13、为algorithmicx定义新命令
\algnewcommand\algorithmicoutput{\textbf{Output:}}
\algnewcommand\Output{\item[\algorithmicoutput]}
然后就可以直接使用 \Output 命令了。
14、表格设置
(1)设置为与文本宽度一致
\begin{tabularx}{\textwidth}{XXXXXX}
(2)单元格内容在指定位置换行
\pbox[c]{0.5\textwidth}{Number \\of slices}