Latex usage

Erestu 2019-12-17 PM 390℃ 0条

latex-template

Created by : Erestu Zhang.

2019 / 12 / 17 @Nanjing


How to use Latex on Ubuntu

check Ubuntu下Latex安装及中文配置

  1. Install Tex Live: Basic LaTex packages.
    • sudo apt-get install texlive-latex-base
  2. Installs all LaTex CJK packages.
    • sudo apt-get install latex-cjk-all
  3. Install some LaTeX supplementary packages
    If you need some other packages,run
    • apt-cache search lastpage,
      then you will see:
    • exlive-latex-extra - TeX Live: LaTeX supplementary packages
    • finally,just install it by running sudo apt-get install texlive-latex-extra
  4. Install a texmaker,it's a graphical user interface for editing.
    • sudo apt-get install texmaker
  5. For using xelatex for chinese using.
    • sudo apt-get install texlive-xetex
  6. support for cmd apt-cache show texlive-publishers
    • sudo apt-get install texlive-publishers
  7. open Texmaker
    • search->typeTexmaker
    • double click
    • you'll see the icons of new and open ,etc.
    • there are two right arrows on the top,and two select boxs,for the first select box,you can choose to build Latex or Bibtex ,etc. For the second select box,you can choose to check PDF or PS,etc.After chosing the function you want,click the first arrow,then click the second arrow.
    • texmaker
    • texmaker
    • texmaker
    • texmaker

How to use Latex on VSCode

  • After installing VSCode,

  • install extension LaTex Workshop

  • edit file->preferences->Settings->settings.json

    "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%"
                ]
            }* install extension `LaTex Workshop`
        ],
        "latex-workshop.latex.recipes": [
            {
                "name": "xelatex",
                "tools": [
                    "xelatex"
                ]
            },
            {
                "name": "pdflatex",
                "tools": [
                    "pdflatex"
                ]
            },
            {
                "name": "latexmk",
                "tools": [
                    "latexmk"
                ]
            },
            {
                "name": "pdflatex -> bibtex -> pdflatex*2",
                "tools": [
                    "pdflatex",
                    "bibtex",
                    "pdflatex",
                    "pdflatex"
                ]
            }
        ],
    
    
  • restart VSCode

  • choose your_tex_file.tex

  • ctrl + allt + B or click the icon on the left bar,click tex first and then recipe:xelatex->bibtex->xelatex*2 and View in VSCode tab

    tex

How to use Bibtex on Latex

  1. create Bibtex file and save as ref.bib.

  2. for example ,edit

     @article{goodfellow2014generative,
       title={Generative Adversarial Nets},
       author={Goodfellow, Ian and Pougetabadie, Jean and Mirza, Mehdi and Xu, Bing and Wardefarley, David and Ozair, Sherjil and Courville, Aaron and Bengio, Yoshua},
       pages={2672--2680},
       year={2014}}
    

    and save the file.

  3. add cite package in tex file
    add \usepackage{cite} behind \documentclass

  4. add citation setting,put

      \bibliographystyle{plain}
      \bibliography{ref}
    

    infront of \end{document}
    * \bibliography{ref} indicates the bib file created above.
    * \bibliographystyle{plain}specifies the presentation of references. There are 8 options for common preset styles, which are:

        1. plain, arranged in alphabetical order, the comparison order is author, year and title;
        2. unsrt, the style is the same as plain, but in order of reference;
        3. alpha, using the first letter of the author's name + the last two years as the label, sorted alphabetically;
        4. abbrv, similar to plain, changes the month to the abbreviation, which is more compact;
        5. ieeetr, journal style of the International Institute of Electrical and Electronics Engineers;
        6. acm, journal style of American Computer Society;
        7. Siam, Journal of the American Academy of Industrial and Applied Mathematics;
        8. apalike, journal style of the American Psychological Association;
    
  5. add citation

    • \cite{goodfellow2014generative}
    • ctrl + allt + B or click the icon on the left bar,click tex first and then recipe:xelatex->bibtex->xelatex*2 and View in VSCode tab
      tex
  6. export as PDF

    • or use the TexMaker,generate Bibtex first and then the PDF file.
    • texmaker
    • texmaker
    • texmaker

Examples

It is the project of recording daily used templates.


Reference

https://github.com/mrdrivingduck/svd-image-compression

https://www.jianshu.com/p/d185aad1f915

https://blog.csdn.net/m0_37041325/article/details/81171736

https://blog.csdn.net/npe_ml/article/details/82912570


标签: latex, ubuntu, texmaker

非特殊说明,本博所有文章均为博主原创。

评论啦~