使用TeXLive+VSCode实现Windows系统本地读写、编译LaTeX文件

诸神缄默不语-个人CSDN博文目录

本文介绍如何使用TeXLive+VSCode实现Windows系统上可以本地实现对LaTeX文件的操作,包括阅读、编写和编译等。
本文基本使用默认普遍使用的选项进行安装,可能会根据作者对相关功能的理解进行后续更新。

1. 作者使用的系统环境和软件版本

操作系统:Windows10
TeXLive:直接使用Easy install来安装
VSCode插件:LaTeX Workshop v8.26.0

2. 安装过程

安装TeXLive:
TeXLive官网:TeX Live - TeX Users Group
Windows用户选择install on Windows选项,跳转至:Windows - TeX Live - TeX Users Group
选择Easy install:Easy install
下载安装包:https://mirror.ctan.org/systems/texlive/tlnet/install-tl-windows.exe
直接点击该安装包,基本选择默认安装(安装路径可以选择为自己的路径)。需要安装很久,5个多小时吧。
Easy install可以默认直接操作系统PATH变量等,就不再需要手动操作。

常见错误:

*** PLEASE READ THIS WARNING ***********************************

The following (inessential) packages failed to install properly:

  asymptote.windows

You can fix this by running this command:
  tlmgr update --all --reinstall-forcibly-removed
to complete the installation.

However, if the problem was a failure to download (by far the
most common cause), check that you can connect to the chosen mirror
in a browser; you may need to specify a mirror explicitly.
******************************************************************

这个是由于安装过程中断网了导致下载失败,只要按照它说的在cmd中重新运行一遍tlmgr update --all --reinstall-forcibly-removed就可以:

C:\Users\Administrator>tlmgr update --all --reinstall-forcibly-removed
tlmgr.pl: package repository https://mirrors.sjtug.sjtu.edu.cn/ctan/systems/texlive/tlnet (not verified: gpg unavailable)
tlmgr.pl: saving backups to D:/texlive/2023/tlpkg/backups
[1/1, ??:??/??:??] auto-install: asymptote.windows (65920) [7368k] ... done
tlmgr.pl: package log updated: D:/texlive/2023/texmf-var/web2c/tlmgr.log

安装LaTeX Workshop:在VSCode插件商店直接选择该插件,点击install,即可安装:
在这里插入图片描述

3. 测试是否安装成功的操作

本文使用一个简单的例子,来自overleaf官方文档(具体在这一部分:Chinese - Overleaf, Online LaTeX-redigeringsprogram)。

新建文本文件latex_example.tex,文件内容为:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Welcome to Overleaf --- just edit your LaTeX on the left,
% and we'll compile it for you on the right. If you open the
% 'Share' menu, you can invite other users to edit at the same
% time. See www.overleaf.com/learn for more info. Enjoy!
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
\usepackage{CJKutf8}
\begin{document}
\begin{CJK*}{UTF8}{gbsn}

\section{前言}

\section{关于数学部分}
数学、中英文皆可以混排。You can intersperse math, Chinese and English (Latin script) without adding extra environments.

\end{CJK*}

\bigskip  %% Just some white space

You can also insert Latin text in your document

\bigskip  %% Just some white space

\begin{CJK*}{UTF8}{bsmi}
這是繁體中文。
\end{CJK*}
\end{document}

点击VSCode左侧工具栏的TEX:
在这里插入图片描述
可以构建LaTeX项目:
在这里插入图片描述
观看渲染后的效果:
在这里插入图片描述
可以用VSCode编辑器直接打开一个新的tab来查看渲染效果:
在这里插入图片描述


在overleaf上渲染的效果是:
在这里插入图片描述
可以看出我们使用TeXLive和VSCode插件已经成功在Windows系统电脑的本地实现了LaTeX文件的编译和读写功能!

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

诸神缄默不语

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值