当前位置:网站首页>基于Pandoc与VSCode的 LaTeX环境配置
基于Pandoc与VSCode的 LaTeX环境配置
2022-07-17 01:32:00 【张某文的博客_Lambda】
今天本来想计划学习Latex,于是在知乎,CSDN流连了许久,发现Latex和word展现方式上还有很大的差别。
- 对于word来说,每次修改所见即所得,能够及时反映修改的效果
- 对于latex来说,每次修改都需要编译才可以呈现改动之处
这一点对于我来说, 还是很不习惯的。本身我十分熟悉word,所见即所得的呈现方式能够让我快速的修改掉不合理的小瑕疵(改格式的时候总会有点吹毛求疵的小毛病),Latex在这个点上有点劝退我。然而,Latex强制而优美的文档格式还是让我眼前一亮,也有一些期刊仅接受Latex文档格式的文件。于是自己合理的结合了2个软件,可以方便大家用最小时间成本和学习成本来使用Latex。
一、具体思路
使用 Pandoc 将 word 转化成 latex文件,之后在转换后的文件进行编辑即可,大大降低了学习成本和时间成本。
二、Pandoc安装与使用
Pandoc 是一款免费且开源的文档格式转化工具,支持众多文本类型之间的转化,而且转化效果相当优秀。对于经常使用markdown的同学也十分友好。
1. 安装网址
2. 使用方法
在 Windows 下打开命令窗口并进入到要转化的 .tex 目标文件的目录。
之后使用命令将 input.docx 转化成 output.tex。 input 是输入的文件名, output 是输出的文件名.命令如下:
pandoc -i input.docx -o output.tex
通过在命令行cmd使用这个命令实现使用Pandoc 在word定稿后将word文档转Latex格式,完成了初步将文档在latex的排版。转换方法
三、Latex安装与使用
1. 安装网址
我们使用基于Visual Studio Code的 LaTeX环境配置,推荐这个博主讲的方法: 传送门,利用Texlive,vscode软件和Latex拓展的方式编写,查看代码和书写上会更为顺畅。
如下图为安装成功的效果图。如果没有显示,应该是vscode认定它为不受信任的拓展:解决方法
2.使用方法
在获得了Latex文件后,我们有了可以编辑的Latex的文档,为我们节省了一定的排版时间。
(1)将转换后的文档所在的文件夹导入到vscode的工作区中,防止在编译时出现无法查找文件的错误。
导入后效果图:
问题1:报错提示无法找到这个.tex源文件:
BUILD command invoked及Cannot find LaTex root file。
解决方法,关闭编译调试窗口:参考博客
问题2:报错提示:
recipe terminated with fatal error
解决方法,配置环境变量:参考博客
(2)点击拓展栏中的预览按钮,预览编译后的PDF文件。
- 问题3:提示无法找到这个PDF文件:
Cannot find PDF file
- 解决方法,在拓展商店搜索vscode-pdf并安装,设置它为受信任的拓展。

(3)一切工作准备就绪,记得补充latex语句,并运行。
\documentclass[]{article}
\usepackage[utf8]{ctex}
\begin{document}
(这个放置转换的文档内容)
\end{document}

四、总结
Pandoc转换并不一定是完美的,有用户反映转换时会使双排文档转换为单排的文档。因此,还需要我们掌握一定的latex排版技巧,修改转换并不如意的地方。
通过Pandoc+Latex这两款软件的结合,可以为我们省下过多的排版时间。不仅可以获得可编辑的Latex文档,而且在排版过程中,享受所见即所得的编辑体验。
边栏推荐
- MYSQL主从搭建
- 2002 - Can‘t connect to server on ‘127.0.0.1‘ (36)
- 2.9.2 Ext JS的数字类型处理及便捷方法
- module_ Basic principle of init function
- web语义化(强调标签-em-斜体)(重点强调标签-strong-粗体)(自定义列表:dl、dt、dd)
- Chengxin University envi_ The second week of IDL experiment content: extract aod+ in all MODIS aerosol products for detailed analysis
- 支持工业级瘦设备4G接入,润和软件DAYU120通过OpenHarmony兼容性测评
- Through openharmony compatibility evaluation, the big brother development board and rich teaching and training resources have been ready
- 模块(block、module)的介绍
- 374. Guess the size of numbers (must be able to get started)
猜你喜欢

laravel的问题
![Theoretical basis of doubledqn and its code implementation [pytoch + pendulum-v0]](/img/f2/4a3cc8e5173789111080915aceb9fd.png)
Theoretical basis of doubledqn and its code implementation [pytoch + pendulum-v0]

Rtx3090 installing pytorch3d

web语义化(强调标签-em-斜体)(重点强调标签-strong-粗体)(自定义列表:dl、dt、dd)

Browser cannot open tensorboard

The third day of the three questions of Luogu daily (make up on the fourth day)

options has an unknown property ‘before‘

Vscode+ros2 environment configuration
![[MySQL] MHA high availability](/img/d3/d9830f3c331193fd40b8f00ebe35fa.png)
[MySQL] MHA high availability

IEEE754 standard floating point format
随机推荐
ES6學習筆記——B站小馬哥
leetcode:50. Pow(x, n)
基于MFC如何实现单个文档的文件读写
Rhce8 Learning Guide Chapter 1 installing rhel8.4
通过Dao投票STI的销毁,SeekTiger真正做到由社区驱动
Oracle queries the maximum partition of non self growing partition
Net SNMP related commands
Unity解决同材质物体重叠产生Z-Fighting的问题
论文阅读:U-Net++: Redesigning Skip Connections to Exploit Multiscale Features in Image Segmentation
Note: light source selection and Application
Solve the error of 0x00000709 when win10 connects to the shared printer
Chengxin University envi_ IDL first week experiment test: simple operation of array + detailed analysis
Paper reading: u-net++: redesigning skip connections to exploit multiscale features in image segmentation
Vscode+ros2 environment configuration
374. 猜数字大小(入门 必会)
XX市高中网络拓扑整体规划配置
Automatic assembly & set injection
Cmake common commands
ES6 learning notes - brother Ma at station B
Shell script receives and returns parameters