目录
一、Latex基础
1、架构
2、引用、脚注
3、单栏、双栏
4、常用快捷键
5、宏包
6、空格
7、换行、行间距
8、换段
9、下划线
10、引号
11、注释
12、字体
13、缩进
14、超链接
15、新页
Latex基础
1、架构
\documentclass{article} % article 文档
\usepackage[UTF8]{ctex} % 使用宏包(为了能够显示汉字)
% 设置页面的环境,a4纸张大小,左右上下边距信息
\usepackage[a4paper,left=10mm,right=10mm,top=15mm,bottom=15mm]{geometry}
\title{Latex基础} % 文章标题
\author{Haiyang liu} % 作者的名称
\date{\today} % 当天日期
% 正文开始
\begin{document}
\maketitle % 添加这一句才能够显示标题等信息
% 摘要开始部分
\begin{abstract}
该部分内容是放置摘要信息的。
\end{abstract}
% 生成目录设置
\renewcommand{\contentsname}{目录} %将content转为目录
\tableofcontents
% 标题开始
\section{一级标题1}
一级标题1第一段下的内容。 \par
一级标题1第二段下的内容。
\subsection{二级标题1.1}
二级标题下的内容。
\subsubsection{三级标题下的内容1.1.1}
三级标题下的内容。
\section{一级标题2}
一级标题2中的内容
% 正文结束
\end{document}

2、引用、脚注
需要添加脚注的文字\footnote{脚注内容}*****
\begin{quote}
引用内容
\end{quote}

3、单栏、双栏
文献有单栏和双栏两种,方法就是在\documentclass{article}中间加上[onecolumn](单栏)或[twocolumn](双栏):
-
单栏
\documentclass[onecolumn]{article}
-
双栏
\documentclass[twocolumn]{article}
4、常用快捷键
Ctrl+B:粗体
Ctrl+I:斜体
Ctrl+/:注释
Ctrl+Z:撤销
Ctrl+Y:重做
Ctrl+F:查找和替换
Ctrl+Home:到文档顶部
Ctrl+End:到文档底部
Ctrl+S:重新编译
Ctrl+Enter:重新编译
5、宏包
LaTex 的所有宏包文件都要写在 \documentclass 命令之后和 \begin{document} 之前。
\usepackage{宏包1, 宏包2}
-
常用的宏包:
ctex:中文支持
amsmath:latex数学公式支持
graphicx:插入图片
algorithm和algorithmic:算法排版
listings:插入代码块
6、空格
-
LaTeX支持
| 源代码 | 显示 | 宽度 |
|---|---|---|
a \quad b | a b | 1个中文字符的宽度 |
a \qquad b | a b | 2个中文字符的宽度 |
a\ b | a b | 1/3字符宽度 |
ab | ab | 正常宽度 |
a \quad ba \qquad ba\ bab

-
LaTeX数学公式支持
| 源代码 | 显示 | 宽度 |
|---|---|---|
$a\;b$ | 2/7字符宽度 | |
$a\,b$ | 1/6字符宽度 | |
$a\!b$ | 缩进1/6字符宽度 |
$a\;b$
$a\,b$
$a\!b$

7、换行、行间距
\\:换行,一般在一行的最后写。
\\[offset]:换行,并且与下一行的行间距为原来行间距+offset,offset单位一般是em或pt。
8、换段
sentence1 \par sentence2

9、下划线
a\_b
a\textunderscore b

10、引号
'English'
''English''

`English'
``English''

11、注释
-
单行
% 注释内容
-
多行
\iffalse
注释内容
\fi
12、字体
-
样式
{\songti 宋体}
{\heiti 黑体}
{\kaishu 楷书}
{\bf 粗体}
{\it 斜体}
{\sl 斜体}
\textbf{粗体}
\textit{斜体}
\textsl{斜体}

-
大小
{\tiny Hello} \\
{\scriptsize Hello} \\
{\footnotesize Hello} \\
{\small Hello} \\
{\normalsize Hello} \\
{\large Hello}

13、缩进
\noindent %取消缩进
14、超链接
\usepackage[colorlinks,linkcolor=black]{hyperref}:所需宏包
\href{}{}:第一个{}填链接,第二个{}填链接名称
\href{http://www.baidu.com}{Baidu}

15、新页
\newpage
Latex相关内容链接:
1、Latex学习笔记之基础入门篇
2、Latex学习笔记之图片篇
3、Latex学习笔记之表格篇
4、Latex学习笔记之数学公式篇
5、Latex学习笔记之伪代码、代码块篇
6、Latex学习笔记之参考文献篇
Latex学习笔记——总篇(入门、图片、表格、数学公式、伪代码、代码块、参考文献)

![[Overleaf] LaTeX中的斜体、加粗、下划线和简单指令](https://img-blog.csdnimg.cn/69c7232f7ae84960be2ce52fa1502209.png)

![[翻译] [Overleaf] LaTeX 中的粗体、斜体、下划线](https://img-blog.csdnimg.cn/20200525064532227.png#pic_center)













