Tex安装教程:专业规范的学术论文、毕业论文排版工具,你值得拥有

软件千万个,Word首选着
论文不规范,毕业两行泪
你还在用Word进行论文的排版吗
那也太low
今天给大家介绍一款专业的排版工具Tex

先给大家看一下效果Tex安装教程:专业规范的学术论文、毕业论文排版工具,你值得拥有Tex安装教程:专业规范的学术论文、毕业论文排版工具,你值得拥有
本教程介绍的安装环境是Win10+Texlive2018,编辑器的话由读者自行选择,下文中会提到。

(部分资源地址:链接https://pan.baidu.com/s/1xLh9fgaD-7cfE5O2_xBn-g 提取码:b58i

具体安装步骤如下:

一.安装 Tex Live

首先用户下载 Tex Live 的 镜像文件(扩展名为.iso格式的文件),下载完成后,右键单击将镜像文件(.iso)加载至虚拟光驱(我使用2345压缩软件添加的虚拟光驱,读者也可以使用其他加载虚拟光驱的软件)。加载后,打开计算机(我的电脑),会形成一个CD驱动器,假设为CD驱动器(W:)(具体看新加了哪一个驱动器)。

1.接下来,用户打开 cmd 窗口(Win+R),执行以下代码: echo %path%
2. 查看环境变量,若 C:\Windows\system32 没有出现在结果中,则需要在 cmd 中继续执行:path=C:\Windows\system32;%path%
:执行代码后,读者可再执行第一步代码检查是否成功,省得到时麻烦。若不成功,也可以通过可视化操作解决,返回桌面,右键单击计算机->属性->高级系统设置->环境变量->用户变量->新建(名称:path,路径:C:\Windows\system32)——这一步是为了将 C:\Windows\system32 添加到环境变量中
3. 接下来,在关闭了国内第三方安全软件的前提下,在 cmd窗口中执行:cd /d W:
(切换路径到CD驱动器W)
4.接下来执行:install-tl-windows.bat --no-gui 即可进入安装流程
此安装教程采用命令形式操作,读者可以看到以下界面

安装 TEX LIVE命令窗口界面:

======================> TeX Live installation procedure <=====================

======>   Letters/digits in <angle brackets> indicate   <=======

======>   menu items for actions or customizations      <=======

 Detected platform: Windows

 <B> set binary platforms: 1 out of 8

 <S> set installation scheme: scheme-full

 <C> set installation collections:

     41 collections out of 41, disk space required: 5541 MB

 <D> set directories:

   TEXDIR (the main TeX directory):

     C:/texlive/2018

   TEXMFLOCAL (directory for site-wide local files):

     C:/texlive/texmf-local

   TEXMFSYSVAR (directory for variable and automatically generated data):

     C:/texlive/2018/texmf-var

   TEXMFSYSCONFIG (directory for local config):

     C:/texlive/2018/texmf-config

   TEXMFVAR (personal directory for variable and automatically generated data):

     ~/.texlive2018/texmf-var

   TEXMFCONFIG (personal directory for local config):

     ~/.texlive2018/texmf-config

   TEXMFHOME (directory for user-specific files):

     ~/texmf

 <O> options:

   [ ] use letter size instead of A4 by default

   [X] allow execution of restricted list of programs via \write18

   [X] create all format files

   [X] install macro/font doc tree

   [X] install macro/font source tree

   [X] adjust search path

   [1] add menu items, shortcuts, etc.

   [1] update file associations

   [X] install TeXworks front end

   [X] after install, use tlnet on CTAN for package updates

 <V> set up for portable installation

Actions:

 <I> start installation to hard disk

 <P> save installation profile to 'texlive.profile' and exit

 <H> help

 <Q> quit

Enter command:

这时,读者可先执行 D 来更改安装路径,也可直接执行 I 在默认路径中安装 TEX Live**(建议大家还是默认安装位置较好,省得后面出问题)**,执行 D 后,读者可看到:

Directories customization:

<1> TEXDIR: C:/ texlive /2018

 support tree: C:/ texlive /2018/ texmf -dist

 <2> TEXMFLOCAL: C:/ texlive/texmf -local

<3> TEXMFSYSVAR: C:/ texlive /2018/ texmf -var

<4> TEXMFSYSCONFIG: C:/ texlive /2018/ texmf -config

 <5> TEXMFVAR: ~/. texlive2018/texmf -var

<6> TEXMFCONFIG: ~/. texlive2018/texmf -config

 <7> TEXMFHOME: ~/ texmf

 Note: ~ will expand to %USERPROFILE%

Actions:

<R> return to main menu

 <Q> quit

Enter command:

这时执行数字 1,将看到:

New value for TEXDIR [C:/ texlive /2018]:

即可更改路径,如 D:/texlive/2018。接下来,执行 R 即可回到初始的安装界面。其他操作读者可通过阅读英文自行执行,这里不再赘述。至此,读者只需耐心等待安装完成。安装完成后,执行 exit退出命令行,再打开(Win+R),执行:tex -v

以验证安装是否成功,结果显示为:


TeX 3.14159265 (TeX Live 2018/ W32TeX)

kpathsea version 6.3.0

Copyright 2018 D.E. Knuth.

There is NO warranty. Redistribution of this software is

covered by the terms of both the TeX copyright and

the Lesser GNU General Public License.

For more information about these matters , see the file

named COPYING and the TeX source.

Primary author of TeX: D.E. Knuth.

即可认为安装顺利完成

二.卸载 TEX Live

有些时候,如跨版本升级 TEX Live,用户需要卸载 TEX Live,相较于安装,卸载稍容易一些。读者找卸载批命令文件,如 C:\texlive\2018\tlpkg\installer\uninst.bat。双击或在 cmd 中运行均可。

三.升级宏包

安装完成后,读者可以升级宏包以获得更好的使用体验。下面将介绍使用命令行升级宏包的方法。打开 cmd 窗口,首先执行下面命令指定升级使用的镜像源。ctan 表示系统在升级时将自动寻求最近的源进行下载。
tlmgr option repository ctan
读者同样可以指定其他的镜像源,比如清华大学的镜像源:tlmgr option repository http ????/ mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet

或者中国科技大学的镜像源: tlmgr option repository https ????/ mirrors.ustc.edu.cn/CTAN/systems/texlive/tlnet/

接下来,用户执行命令:tlmgr update --list

可查看目前源上可升级的宏包都有哪些。高级用户可以根据自己的需求选择升级特定宏包,而初级用户建议直接升级全部宏包。读者只需执行:tlmgr update --self --all同时升级tlmgr 本身和全部宏包。

碰到升级不成功的情况,用以下解决办法:

1.tlmgr 本身无法成功升级

遇到这种情况时,读者需自行下载 update-tlmgr-latest.exe(文章开头链接中有),然后再执行升级命。

2.升级到一半停止

这种情况下,读者需要执行另外一个命令继续升级
tlmgr update −−reinstall−forcibly−removed --all

四.安装宏包

在默认状态下,读者将完整安装 TEX Live,因此读者极少碰到需要手动安装宏包的情形。同时,在lshort-zh-ch 中也明确提到,如非万不得已,尽量不要手动安装宏包。因此在这里我只介绍从源处安装宏包的命令。假设读者想安装 mcmthesis 宏包,只需在 cmd 窗口执行:tlmgr install mcmthesis
需要注意的是,读者一定要清楚所要安装的宏包名称,并且在安装宏包前先确保镜像源设置正确。

五.编译文档

升级宏包完成后,读者可以编译文档。首先,读者需要在指定位置建立一个 tex 文件:(以C盘为例,由于计算机自带的记事本默认在C盘)

mkdir C:\work_latex

cd /d C:\work_latex

notepad main.tex

第 1 行表示创建一个工作路径 C:\work_latex,第 2 行表示进入工作路径,第 3 行表示用记事本打开
main.tex 文件,若文件不存在,系统将询问读者是否创建该文件,在打开的记事本中输入一个最小实例。

\documentclass{article}

\begin{document}

Hello \LaTeX{} World!

\end{document}

保存并退出,接下来在命令窗口继续执行:pdfLaTeX main

等待系统完成编译过程,待编译完成后,我们即可看到在 C:\work_latex 中出现了 main.pdf 文件和其他同名的辅助文件 main.auxmain.log

六.使用编辑器编辑代码

  1. TeXworks:和TEXLive 一同发行的轻量级编辑器LATEX 编辑器,非常适合入门级用户使用,和大多数国产软件不同,TeXworks 不会自动在桌面生成快捷方式,新人往往不知道如何打开它,实际上 TeXworks 在 TEX Live 安装路径的 \bin\win32 中,可在 cmd 中执行 texworks 打开,也可直接在 Windows 搜索栏里搜 texworks 打开
  2. TeXStudio:功能更加丰富;
    Tex安装教程:专业规范的学术论文、毕业论文排版工具,你值得拥有
  3. Winedt:我使用的是目前最新版本Winedt10.3

Tex安装教程:专业规范的学术论文、毕业论文排版工具,你值得拥有

  1. 其他编辑器如 VScodeSublime Text,感兴趣的读者可自行了解它们的使用方法,因Up主能力有限,无法一一列举,还请自己在网上寻求更多帮助。

七.补充说明

由于Up主也还是初级使用者,很多地方难免出错,将此教程分享给大家,希望能帮助到需要的朋友,希望会了TeX排版,你的毕业论文排版也会棒棒哒!大家可以到该网站下载模板使用:http://www.latexstudio.net/archives/category/tex-tips/tex-mathmode
(注意:tex文件必须用英文命名,拼音也是完全OK的,否则会出错,来自Up主血淋淋的教训!)
PS:另外,网盘里还有能识别数学公式,将其直接转化为TeX代码的小工具,用到的朋友记得下载哦!
好了,本次分享的旅程就到这里啦,剩下的就靠屏幕前的你去慢慢探索与玩耍啦!