Based on texlive, use sublime Text 3 to write Latex

Source: Internet
Author: User
Tags sublime text


Reference
Http://www.360doc.com/content/14/0517/19/9206388_378573988.shtml
Http://jingyan.baidu.com/article/066074d6492e38c3c21cb0f5.html
http://www.zhihu.com/question/36038602?sort=created




    • Preparatory work
    • Installing Latextools
      • Install the package Control
      • Installing the Latextools Plugin
    • Configure Sumatrapdf
    • Test




Preparatory work


First we need to install and download something:



texlive(a cross-platform LaTeX toolkit that can be used in Linux, Windows, and Mac OS, including TeX and related programs.) In addition, the Documention page of the official website has a tutorial (multi-lingual support). )
subline Text 3(a powerful, easy-to-use text editor priced at $4 for free to get all the updates before the sublime text. If it is used frequently and has sufficient financial resources, it is recommended to buy. If no money is not related, the official version can be unlimited trial, but occasionally pop-up notice. )
Latextools (there will be installation instructions later, it is recommended to use the package Control installation, which also provides an offline installation pack address,)
Sumatra PDF(Latextools uses it to preview the generated PDF by default)


Install Latextools Install the package Control


First we need to install the package Control in sublime Text 3, the official website has detailed installation instructions, but in English.



The steps are as follows:
1. Start the console by combiningCTRL + `the keys or by using the menu commandsView -> Show Console, then enter the code below and press ENTER.



Sublime Text 3:


Import Urllib.request,os,hashlib; h =' 2915d1851351e5ee549c20394736b442 '+' 8bc59f460fa1548d1514676163dafc88 '; PF =' Package control.sublime-package '; IPP = Sublime.installed_packages_path (); Urllib.request.install_opener (Urllib.request.build_opener (Urllib.request.ProxyHandler ())); by= Urllib.request.urlopen (' http://packagecontrol.io/'+ PF.Replace("','%20 ')).Read(); DH = hashlib.sha256 ( by). Hexdigest (); Print' Error validating download (got%s instead of%s), please try manual install '% (DH, h))ifDH! = hElse Open(Os.path.join (IPP, PF),' WB ').Write( by)


Sublime Text 2:


Import Urllib2,os,hashlib; h =' 2915d1851351e5ee549c20394736b442 '+' 8bc59f460fa1548d1514676163dafc88 '; PF =' Package control.sublime-package '; IPP = Sublime.installed_packages_path (); Os.makedirs (IPP)if notOs.path.exists (IPP)ElseNone; Urllib2.install_opener (Urllib2.build_opener (urllib2. Proxyhandler ())); by= Urllib2.urlopen (' http://packagecontrol.io/'+ PF.Replace("','%20 ')).Read(); DH = hashlib.sha256 ( by). Hexdigest ();Open(Os.path.join (IPP, PF),' WB ').Write( by)ifDH = = hElseNone; Print' Error validating download (got%s instead of%s), please try manual install '% (DH, h)ifDH! = hElse ' Restart Sublime Text to finish installation ')


2. Restart Sublime Text
After you have installed it, see the following options:Preference->Package Control


Installing the Latextools Plugin


1. Installation
After installing the package Control by pressing the key combinationCtrl+Shift+Por clickingPreference->Package Control, and then entering install, select the packages control:install.



Enter latex and select Latextools to install. (Since I have installed latextools, and I have not shown latextools)



2. Configuration
SelectPreferences -> Browse Packages, select and enter the Latextools folder, use Sublime Text 3 to open the latextools.sublime-settings file, and navigate to line 106. The content might look like this:

Modify themtexpathand modify them forsumatrayour installation pathdistrotexlive.



Then navigate to 179 rows or so. The content might look like this:

will bebuilderchanged tosimple.



You can exit after saving.


Configure Sumatrapdf

When we compile a LaTeX file, we often need to use reverse search , which is to jump from the contents of the PDF to the contents of the code. sumatrapdf is the preview tool that latextools uses by default, because the option configuration for Sumatrapdf reverse lookup is hidden, so we need to configure Sumatrapdf to support reverse lookup.


1. Modify the environment variable path
Add the Sumatrapdf main program directory to the environment variable path, which is important, otherwise the next step will not be possible.
Right-click on My Computer , select Properties , click Advanced System Settings on the left, and then click Environment Variables below. Double-click the environment variable PATHto join on the last side;C:\Program Files\SumatraPDF. Click OK to exit. ( When you do, replace the path with the directory where SumatraPDF.exe is located, where the semicolon is the semicolon in English )


Win10 simplifies the settings, double-click the environment variable PATH, click New, enterC:\Program Files\SumatraPDF, click OK. ( When you do, replace the path with the directory where the SumatraPDF.exe is located )


2. Configure Sumatrapdf Reverse Search
Open a command prompt and execute the following command: (replace the installation path with your actual installation path)


sumatrapdf.exe -inverse-search "\"C:\Program Files\Sublime Text 3\sublime_text.exe\"\"%f:%l\"

 Test 


Create the Test.tex file and edit the following:

%! TEX program = xelatex% uses ctexart documents, UTF-8 encoding \ documentclass [UTF8] {ctexart} \ begin {document} article. This is all the content of the article \ end {document}

 


Now Ctrl+s, then ctrl+b. Sublime Text will automatically call the Latextools build system to compile, and if the compilation succeeds, it will automatically open sumatrapdf for preview. Now that the configuration is complete, you can edit the content you want.



Based on texlive, use sublime Text 3 to write Latex


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.