使用LaTex撰写实验报告

使用latex撰写实验报告

各位CQUPTers,是否还因为写实验报告而感到枯燥?还在为word排版而感到苦恼吗?快来试试用latex排版实验报告吧! 学会latex益处良多,大到毕业论文、竞赛论文,小到个人简历、日常作业笔记,都能轻松应对。学会使用latex不仅不需要担心格式问题,漂亮的格式也能让文章更加加分。

效果图

首先上结论。成果展示,有图有真相。

使用latex排版出来的报告公式精美,代码格式优雅,图片与正文交叉引用。

效果图

如果大家有需要的话,未来我也可以开源部分报告的latex源码,供大家参考学习。

需要具备哪些东西/能力?

  • step 1)Latex环境安装——texlive清华镜像源下载安装即可。

  • step 2) 舒适的latex开发环境——使用Vscode(Texstudio也可以,但是没有VScode那么丰富的插件库),下载安装LaTex Workshop插件。

  • step 3 ) 设置Vscode用户配置文件(User Settings(JSON))——网上的教程有很多坑,文末会附上我的配置文件供大家参考。我的配置文件是在我的电脑上完全能work,大家用的时候需要看清注释修改几个路径。

  • step 4 ) 从一个好用的模板开始学起latex基本语法——推荐从我编写的CQUPT_Courese_Report用起(王婆卖瓜)

​ ......

鉴于以上每一个步骤,根据关键词网上一搜就是一大把教程,我就不重复赘述了。所以还请大家自行搜索。

我更多的会关注具体使用过程中的小技巧,整理整理日后继续分享。

以上操作一天即可顺利入门latex用于撰写实验报告,接下来便是不断地尝试和探索更加丰富和优美的排版了。

推荐必备工具:公式编辑器(Axmath、Mathtype等)、表格转latex(excel2latex)、Vscode插件(easy snippet)、各路AI工具等。

VScode配置文件

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
137
138
139
{
"liveServer.settings.donotVerifyTags": true,
"liveServer.settings.donotShowInfoMsg": true,
"explorer.confirmDelete": false,
"files.autoSave": "afterDelay",
"explorer.confirmDragAndDrop": false,


"latex-workshop.showContextMenu": true,
"latex-workshop.intellisense.package.enabled": true,
"latex-workshop.message.error.show": false,
"latex-workshop.message.warning.show": false,
"latex-workshop.latex.tools": [
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"-outdir=%OUTDIR%",
"%DOCFILE%"
]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}
],
"latex-workshop.latex.recipes": [
{
"name": "XeLaTeX",
"tools": [
"xelatex"
]
},
{
"name": "XeLaTeX -> XeLaTeX",
"tools": [
"xelatex",
"xelatex"
]
},
{
"name": "PDFLaTeX",
"tools": [
"pdflatex"
]
},
{
"name": "BibTeX",
"tools": [
"bibtex"
]
},
{
"name": "LaTeXmk",
"tools": [
"latexmk"
]
},
{
"name": "xelatex -> bibtex -> xelatex*2",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
},
{
"name": "pdflatex -> bibtex -> pdflatex*2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
},
],


"workbench.colorTheme": "Default Light Modern",
"tabnine.experimentalAutoImports": true,
"files.autoSaveDelay": 30000,
"workbench.editorAssociations": {
"{git,gitlens}:/**/*.{md,csv,svg}": "default",
"file:/**/*.xlsx": "jupyter-data-wrangler",
"file:/**/*.csv": "jupyter-data-wrangler",
"*.pdf": "cweijan.officeViewer"
},
"vscode-office.editorTheme": "Light",
"jupyter.interactiveWindow.creationMode": "perFile",

// latex-workshop设置
"latex-workshop.latex.autoClean.run": "onBuilt", //删除中间过程文件
"latex-workshop.latex.autoBuild.run": "onSave",
"latex-workshop.view.pdf.ref.viewer":"external", //外部PDF设置
"latex-workshop.view.pdf.external.viewer.command": "C:/Program Files/SumatraPDF.exe",
"latex-workshop.view.pdf.external.viewer.args": ["%PDF%"],
"latex-workshop.view.pdf.external.synctex.command":"C:/Program Files/SumatraPDF.exe", //定位
"latex-workshop.view.pdf.external.synctex.args":[
"-forward-search",
"%TEX%",
"%LINE%",
"-reuse-instance",
"-inverse-search",
"code \"D:VScode/Microsoft VS Coderesources/app/out/cli.js\" -r -g \"%f:%l\"", // 注意修改路径
"%PDF%"
],

"editor.wordWrap": "on",
"python.createEnvironment.trigger": "off",

}

实验模板链接

Su-anAcid/CQUPT-Course-Report: CQUPT的实验报告(正文)latex模板 (github.com)

【免费】CQUPT-Course-Report资源-CSDN文库