文件开头
此开头指定了文档类型(为latex必备),article就不错,中英都很方便
\documentclass{article}
中文支持
latex默认不支持中文,需要引入此包,另将编译器设置为XeLaTeX即可完美支持中文,以下两个包择一即可,但推荐使用第一个
\usepackage {ctex}
or:
\usepackage{xeCJK}
标题、作者、日期
\title{标题}
\author{作者}
\date{日期}
仅设置以上还不能在文档中显示,还需要设置如下内容:
\begin{document}
\maketitle
\end{document}
正文
以下代表了latex文档的正文部分,所有正文均应在两者之间
\begin{document}
\end{document}
各级标题
此命令可设置各级标题
一级标题:
\section{一级标题}
二级标题:
\subsection{二级标题}
三级标题:
\subsubsection{三级标题}
以此类推
标题会自动设置编号,取消自动编号:
\section*{标题}
即可
取消段落缩进
\setlength{\parindent}{0pt}
空格
前文 \quad 后文
插入图片
\begin{figure}[h]
\centering
\includegraphics[width=1cm,height=1cm]{头像.jpg}
\caption{我的头像}
\end{figure}
页码
新起一页:
\newpage
指定本页页码起始编号:
\setcounter{page}{1}
本页不显示页码:
\thispagestyle{empty}
设置字体的三种方法
需要使用\usepackage{ctex}
- \textrm{目标文本}
- \songti 目标文本
- \CIJfamily命令 目标文本
设置字号
\zihao 目标文本
编号列表
\begin{itemize}
\item[1] a
\item[2] b
\end{itemize}