Latex with Vs code and Texlive安装方法

首页摘要:

Latex在本文中在本文中专指文本排版工具而非类似markdown这样的标记语言,主要介绍如何利用Vs code和Texlive对Latex进行配置,Texlive是Latex的内核而Vs code是IDE,因此重点是如何将两者连接。当然,也有其它优秀的工具可以使用,本文会稍微提一下。

Latex简介

LaTeX(LATEX,音译“拉泰赫”)是一种基于ΤΕΧ的排版系统,由美国计算机学家莱斯利·兰伯特(Leslie Lamport)在20世纪80年代初期开发,利用这种格式,即使使用者没有排版和程序设计的知识也可以充分发挥由TeX所提供的强大功能,能在几天,甚至几小时内生成很多具有书籍质量的印刷品。对于生成复杂表格和数学公式,这一点表现得尤为突出。因此它非常适用于生成高印刷质量的科技和数学类文档。这个系统同样适用于生成从简单的信件到完整书籍的所有其他种类的文档。

以上是知乎对Latex的定义,一言蔽之,Latex是利用规范语言且格式变换灵活地排版工具,但是无法所见所得;而word是用户界面,排版称得上是所见即所得。虽然还没有正式开始使用Latex,但是IEEE英文期刊绝大多数都提供了Latex模板使用,因此使用Latex比word在这种场景下排版的工作量会小很多。正常而言,要达到一般使用的水平,学习的有效时间1天足矣。

如何配置Vs code和Texlive

1.在清华镜像中下载Texlive2018(反正下最新版就是了),以管理员身份运行安装文件,默认安装即可,不默认容易出错啊。安装完毕之后最好把安装目录(bin文件夹路径)添加至环境变量。

2.安装Vs code,百度就可以找到官网下载,安装路径随意。这一步最重要的是安装插件Latex Workshop和Latex Preview,这里我要说的是不需要像网上各种修改json文件来让Vs code下支持Latex中文显示,只需要在Latex文档中文章开头加一句“\usepackage[UTF8]{ctex}”,就可以支持中文了,就是这么简单。

PS:其它的工具如Texstudio直接安装无需任何配置即可使用,只是颜值比较低。作为颜控,只有Vs code才能吸引我。下面给出Latex的经典入门模板,里面包含了指定中文显示的语句,注意一下。

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
\documentclass{article}
%\documentclass[journal]{IEEEtran}
%\documentclass{report}
%\documentclass{ActaOulu}

\usepackage[UTF8]{ctex}

\begin{document}

\title{Introduction to \LaTeX{}}
\author{Author's Name}

\maketitle

\begin{abstract}
This is abstract text: This simple document shows very basic features of \LaTeX{}.
\end{abstract}


%\chapter{First Chapter}

\section{Introduction}

Here is the text of your introduction. We use some Latin nonsense text to fill
the paragraphs. This way the resulting document will look more like an actual
scientific paper or so. Here is an equation:

\begin{equation}
\label{simple_equation}
\alpha = \sqrt{ \beta }
\end{equation}

Now you don't need to read the text any further because it's just Lorem ipsum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit
amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore
et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.


\subsection{Subsection Heading Here}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.




\section{Conclusion}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur.


\end{document}
#
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×