LaTeX采用编译方式来生成排版文档,现有的专用于LaTeX的编辑器也有不少,但是我一个也不喜欢。我更喜欢使用Notepad++,特别是它的列编辑功能!!
一番研究之后,我搭建了一个简单的开发环境用于编辑+编译LaTeX源文件。
下面一步步介绍下,如何做到这一步:
必备软件
你必须已经安装好了texlive,附上HUST的镜像 http://mirrors.hust.edu.cn/CTAN/
安装个轻量级的pdf阅读器,https://www.sumatrapdfreader.org/download-free-pdf-viewer.html
我将这个pdf阅读器放在D盘根目录下,命名为SumatraPDF.exe
必须已经安装了Notepad++,并且添加Run Me和Auto Save两个插件。
设置tex默认打开软件
新建一个文本文件,重命名为pdftex_compile.bat
,向该文件中添加如下代码:
:: [path/to/this/bat/file] "$(CURRENT_DIRECTORY)" "$(NAME_PART)"
@echo off
:: uncomment to deleted the previous pdf and aux files.
:: del %~n1.pdf %~n1.aux
pdflatex -interaction=errorstopmode %1
if exist %~n1.aux (
bibtex %~n1
pdflatex -interaction=errorstopmode %1
)
::pdflatex -interaction=errorstopmode %1
start "" "D:\SumatraPDF" %~n1.pdf -reuse-instance
设置run me
设置run me插件的选项如下:
改变shell execute current file快捷键
快捷键配置如下(我设置的Ctrl+F5
):
写段代码,按下快捷键
使用Notepad++编译一个文件,随便起个名字,但是要以tex为后缀名。
我的代码如下:
\documentclass{
article}
\usepackage{
tikz<