latex 换行默认不分段,想分段需要再换行。

vscode+Latex

辅助写公式:<www.latexlive.com>

前期准备

安装texlive:https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Images/
vscode下载插件:latex workshop
完成上面两步,打开vscode按住ctrl+shift+p,输入json,选择“打开用户设置”进入settings.json文件,在settings.json文件中添加以下内容:
(注意,是删除大括号里面的内容,再替换)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
"latex-workshop.latex.recipes": [
{
"name": "XeLaTeX",
"tools": [
"xelatex"
]
},
{
"name": "PDFLaTeX",
"tools": [
"pdflatex"
]
},
{
"name": "xelatex -> bibtex -> xelatex*2",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
},
{
"name": "pdflatex ➞ bibtex ➞ pdflatex * 2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
}
],
"latex-workshop.latex.tools": [
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-shell-escape",
"%DOCFILE%"
],
"env": {}
},
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"-outdir=%OUTDIR%",
"%DOC%"
],
"env": {}
},
{
"name": "lualatexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-lualatex",
"-outdir=%OUTDIR%",
"%DOC%"
],
"env": {}
},
{
"name": "latexmk_rconly",
"command": "latexmk",
"args": [
"%DOC%"
],
"env": {}
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
],
"env": {}
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
],
"env": {}
},
{
"name": "rnw2tex",
"command": "Rscript",
"args": [
"-e",
"knitr::opts_knit$set(concordance = TRUE); knitr::knit('%DOCFILE_EXT%')"
],
"env": {}
},
{
"name": "jnw2tex",
"command": "julia",
"args": [
"-e",
"using Weave; weave(\"%DOC_EXT%\", doctype=\"tex\")"
],
"env": {}
},
{
"name": "jnw2texmintex",
"command": "julia",
"args": [
"-e",
"using Weave; weave(\"%DOC_EXT%\", doctype=\"texminted\")"
],
"env": {}
},
{
"name": "tectonic",
"command": "tectonic",
"args": [
"--synctex",
"--keep-logs",
"%DOC%.tex"
],
"env": {}
}
],

重启发现左下方出现了TEX图标,点击打开,可以看到latex的各种功能,对环境进行编译测试:

ctrl+alt+b编译
ctrl+alt+v查看pdf

模板下载

IEEE模板:https://www.ieee.org/conferences/publishing/templates.html
http://www.ieee.org/publications_standards/publications/authors/author_templates.html
通用模板: https://www.overleaf.com/

Latex运用

空格空多少都是空一行

1
2
3
4
5
&:位置对齐
$:数学公式
~:强制保留空格
#:编写宏包时使用
{}左右花括号表示将其中的内容作为一个整体对待

设定区域

正文各级标题

chapter
section
subsection
subsubsection

常用命令

\\(\newline、 \linebreak、\\[offset])换行
\newpage分页
\par分段
setlength{\parindent}{2em}设置段首缩进
\begin(equation)、\end(equation)在之间插入数学公式

希腊字母

alt text

上下标

1
2
x^2,x_i,x_{ij}
如果多于一个字符,则需要用{}括起来

关于斜体和直立体

英文字母只有在表示变量(或单一字符的函数名称,如f(x)),才使用斜体。其余情况都应使用直立体。

1
2
3
x_i
x_{\text i}
{\rm A}B

分式

速通IEEE模板