01_LaTeX环境安装及配置

01_LaTeX环境安装及配置

1.1、安装及HelloWorld

1、下载编辑器

2、测试安装,自动更新

C:\Users\Shaw>tex -v
TeX 3.141592653 (TeX Live 2022)
kpathsea version 6.3.4
Copyright 2022 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.

C:\Users\Shaw>latex -v
pdfTeX 3.141592653-2.6-1.40.24 (TeX Live 2022)
kpathsea version 6.3.4
Copyright 2022 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.03

C:\Users\Shaw>xelatex -v
XeTeX 3.141592653-2.6-0.999994 (TeX Live 2022)
kpathsea version 6.3.4
Copyright 2022 SIL International, Jonathan Kew and Khaled Hosny.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the XeTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the XeTeX source.
Primary author of XeTeX: Jonathan Kew.
Compiled with ICU version 70.1; using 70.1
Compiled with zlib version 1.2.11; using 1.2.11
Compiled with FreeType2 version 2.11.1; using 2.11.1
Compiled with Graphite2 version 1.3.14; using 1.3.14
Compiled with HarfBuzz version 3.4.0; using 3.4.0
Compiled with libpng version 1.6.37; using 1.6.37
Compiled with pplib version v2.05 less toxic i hope
Compiled with fontconfig version 2.13.96; using 2.13.96

C:\Users\Shaw>tlmgr update -all
tlmgr.pl: package repository https://mirror.ctan.org/systems/texlive/tlnet (not verified: gpg unavailable)
===============================================================================
tlmgr itself needs to be updated.
Please do this via either
  tlmgr update --self
or by getting the latest updater for Unix-ish systems:
  https://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.sh
and/or Windows systems:
  https://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.exe
Then continue with other updates as usual.
===============================================================================
tlmgr.pl: An error has occurred. See above messages. Exiting.

C:\Users\Shaw>

3、编译Hello

test.tex中写入:

\documentclass{article}

\begin{document}

Hello \LaTeX.

\end{document}

编译latex test.tex,生成一系列文件*.aux,*.dvi,*.log

然后在编译成pdf文件dvipdfmx test.dvi,生成*.pdf

test.tex可直接使用xelatex test.tex快速编译得到pdf文件。

4、编写*.bat脚本

为了防止生成中间文件,使用脚本批处理执行:

新建build.bat,写入:

latex test.tex
dvipdfmx test.dvi
del *.aux *.dvi *.log

或者新建buildx.bat,写入:

xelatex test.tex
del *.aux *.dvi *.log

1.2、测试中文

修改test.tex如下:

\documentclass{article}

\begin{document}

你好,\LaTeX 。

\end{document}

编译执行发现不能正常显式中文。

因为缺失一些东西:

  • 保存编码格式必须是UTF-8
  • 引入宏包\usepackage{ctex}

如下:

在这里插入图片描述

1.3、安装配置texstudio

由于命令行+记事本操作复杂,使用texstudio软件方便操作。

参考视频

LaTeX

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值