LaTeX (MikTeX+TeXstudio) 在win10上的配置教程

前言

这个暑假想学习一下LaTeX。

所以在此记录我在windows 10 上配置LaTeX环境和编辑器的过程。

一、LaTeX简介

(官网 [1])[https://www.latex-project.org/]对LaTeX的介绍:

LaTeX – A document preparation system
LaTeX is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation. LaTeX is the de facto standard for the communication and publication of scientific documents. LaTeX is available as free software.

另外,

LaTeX (spelled Lay-tek), is a markup level text editing tool that separates the word formatting from the content entry task. Quite similar to HTML in its formatting, LaTeX is one of the most commonly used text editor in the academia. For people having to deal with scientific papers and publishing, with a lot of mathematical equations thrown into the mix, LaTeX text editors are quite the industry standards. [3]

同时,官网明确了LaTex的读音:
LaTeX is pronounced «Lah-tech» or «Lay-tech» (to rhyme with «blech» or «Bertolt Brecht»). [2]

二、LaTeX编辑器

现在市面上很多款编辑器,Beebom推荐了8款好用的LaTeX编辑器[3]:
1)TeXmaker
开源,跨平台支持,拼写检查,自动补全。

2)Texstudio
开源,跨平台支持,拼写检查,自动补全。
这个工具是在TeXmaker的源代码上开发的,所以是前者的扩展(比如:统计文档字数,词频分析)。

还可以拖拽图片到文档中,感觉很酷诶…

3)TeXworks
开源,跨平台支持。
是基于TeXshop的源代码开发的。

4)ShareLaTex 5)Overleaf 6)Authorea
无需安装,在线编辑。

7)Vim with LaTeX-suite
跨平台支持。

8)TeXlipse plugin for Eclipse IDE
在eclipse编辑器上可以写LaTeX


此外,wiki百科还给出了各种LaTeX编辑器的比较 [4]。

三、选择并配置编辑器

大概看了下,我最后决定选TeXstudio,感觉功能要全一些。

现在开始配置TeXstudio [5]:

1)下载TeXstudio

下载地址:http://texstudio.sourceforge.net/

这里写图片描述
图一 TeXstudio下载主页

2)找到TeXstudio的user manual

用户手册地址:
http://texstudio.sourceforge.net/manual/current/usermanual_en.html

3)安装MikTeX

TeXstudio只是编辑器,不包含LaTeX的环境,所以需要先下载MikTeX并安装 (安装教程在这个链接中)[6]。

4)安装TeXstudio

打开之前的下载的TeXstudio安装包“texstudio-2.12.10-win-qt5.exe”,基本上默认安装就行。

这里写图片描述
图二 安装完成之后,win10左下角菜单栏会显示对应图标

5)实例演示

安装好MikTeX和TeXstudio之后,新建一个test.tex文件。

输入:

\documentclass{article} 
    \title{A Test for TeXstudio} 
    \author{Dale无双} 
\begin{document} 
	\maketitle
	\tableofcontents 
	\section{Hello China} China is in East Asia. 
	\subsection{Hello Beijing} Beijing is the capital of China. 
	\subsubsection{Hello Dongcheng District} 
	\paragraph{Hello Tian'anmen Square}is in the center of Beijing 
	\subparagraph{Hello Chairman Mao} is in the center of Tian'anmen Square 
\end{document} 

点击“F5”或者上方菜单栏的双箭头即可显示代码对应的文档。

这里写图片描述
图三 编译,执行代码

6)对中文的支持

细心的人可以看到5)中的中文是没法显示的。要显示中文,有两种办法(我倾向于第一种)

1.首先,在上方菜单栏options-configure TeXstudio-build。把Default compiler改成XeLaTeX。
然后,在tex文件的代码中插入\usepackage{xeCJK}
最后,点F5,即可看到中文成功显示。

(注意:我在第一遍F5编译执行的时候,报错了,信息是“expl3.sty is not found”.我查了下也没查到结果,最后我重新编译执行了一遍,又没有问题了。)

这里写图片描述
图四 方法一

2.首先,在上方菜单栏options-configure TeXstudio-build。把Default compiler改成XeLaTeX。
然后,在tex文件的代码中插入\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{KaiTi}

最后,点F5,即可看到中文成功显示。

这里写图片描述
图五 方法二

四、总结&未来工作

到现在为止,就已经配置好LaTeX和TeXstudio并能够成功使用了。

接来下的日子,打算认真学习一下用LaTeX写学术论文。

参考文献

[1] The LaTex project. https://www.latex-project.org/
[2] An introduction to LaTeX. https://www.latex-project.org/about/
[3] 8 Best LaTeX Editors. https://beebom.com/best-latex-editors/
[4] Comparison of TeX editors. https://en.wikipedia.org/wiki/Comparison_of_TeX_editors
[5] TeXstudio: LaTeX made comfortable. http://texstudio.sourceforge.net/
[6] Installing LaTeX + TeXstudio. https://gist.github.com/canton7/1139135

  • 21
    点赞
  • 90
    收藏
    觉得还不错? 一键收藏
  • 8
    评论
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值