Windows install visual studio code and configure latex and write latex papers

0. Please install texlive in advance. Installation method: How to download and install latex on windows10
1. Visual studio code download address: https://code.visualstudio.com/
Insert picture description here

2. Select the windows version and download it.

Insert picture description here
And the internet here is inexplicable. Visiting foreign countries was relatively fast in the first half of the year. This year, many of them were basically very slow, or even impossible to visit at all.
In order to speed up, we modify the box in the box to: vscode.cdn.azure.cn
Insert picture description here
That is: I have become
https://vscode.cdn.azure.cn/stable/2b9aebd5354a3629c3aba0a5f5df49f43d6689f8/VSCodeUserSetup-x64-1.54.3.exe
URL enter this (you want Replace with yours), download and take off.
Insert picture description here
3. Click Install. The installation process is very simple, just check if you want.
Insert picture description here

4. Click Finish, and vscode will automatically open.
Insert picture description here
Click on the extension, search for latex, install latex workshop.

5. At this point, if you want to write a Chinese paper, continue to configure it as follows; if you only write English papers in the future, skip to step 6. However, it is also recommended to configure it because it is also very fast (I default you will configure it).
For the configuration steps, click the following one by one:
Insert picture description here
Click New Configuration.
Insert picture description here

Delete all the text in that configuration file, including the braces, and copy it in below.

{
    
    
    // Latex workshop
    "latex-workshop.latex.tools": [
          {
    
    
            "name": "latexmk",
            "command": "latexmk",
            "args": [
            "-synctex=1",
            "-interaction=nonstopmode",
            "-file-line-error",
            "-pdf",
            "%DOC%"
            ]
          },
          {
    
    
            "name": "xelatex",
            "command": "xelatex",
            "args": [
            "-synctex=1",
            "-interaction=nonstopmode",
            "-file-line-error",
            "%DOC%"
              ]
          },          
          {
    
    
            "name": "pdflatex",
            "command": "pdflatex",
            "args": [
            "-synctex=1",
            "-interaction=nonstopmode",
            "-file-line-error",
            "%DOC%"
            ]
          },
          {
    
    
            "name": "bibtex",
            "command": "bibtex",
            "args": [
            "%DOCFILE%"
            ]
          }
        ],
    "latex-workshop.latex.recipes": [
          {
    
    
            "name": "xelatex",
            "tools": [
            "xelatex"
                        ]
                  },
          {
    
    
            "name": "latexmk",
            "tools": [
            "latexmk"
                        ]
          },

          {
    
    
            "name": "pdflatex -> bibtex -> pdflatex*2",
            "tools": [
            "pdflatex",
            "bibtex",
            "pdflatex",
            "pdflatex"
                        ]
          }
        ],
    "latex-workshop.view.pdf.viewer": "tab",  
    "latex-workshop.latex.clean.fileTypes": [
        "*.aux",
        "*.bbl",
        "*.blg",
        "*.idx",
        "*.ind",
        "*.lof",
        "*.lot",
        "*.out",
        "*.toc",
        "*.acn",
        "*.acr",
        "*.alg",
        "*.glg",
        "*.glo",
        "*.gls",
        "*.ist",
        "*.fls",
        "*.log",
        "*.fdb_latexmk"
      ]
}

Insert picture description here
ctrl+sSave.

6. Open a folder where your papers are stored.
Insert picture description here
Click New Paper and
Insert picture description here
enter the name of your paper. Be sure to .texend with a suffix.
Insert picture description here
Then we found that there is an extra TEX at the bottom on the left.
Insert picture description here
Click in and you can find the following: The first default compiler xelatexsupports Chinese. If you don't have the configuration in step 5 above, it will be a different compiler, which only supports English. Now this configuration supports both Chinese and English.
Insert picture description here

7. Write a paper and see. Copy the paper as follows:

\documentclass[UTF8]{
    
    ctexart}

\begin{
    
    document}

你好,世界!

\end{
    
    document}

Then click compile.
Insert picture description here
Finally, click Preview.
Insert picture description here
as follows:
Insert picture description here

Or use a browser to preview, as
Insert picture description here
follows:
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_43391414/article/details/115013860