Latex installation
LaTeX is based on TeX, and its main purpose is to facilitate typography. Academic papers, especially in mathematics and computer science, are written in LaTeX because it is very nice to write mathematical formulas.
LaTex uses two main installations
-
Select a TeX distribution based on the platform for installation. It is recommended to select the version with the most features.
The TeX distribution concept is equivalent to Linux and its distributions. There is only one Linux kernel, but there are many Linux distributions with different features based on the kernel, Ubuntu, Fedora, and so on.
-
Choose an appropriate LaTex editor
Once a LaTeX environment is installed, there is usually a built-in editor, such as CTex’s WinEdt or MacTeX’s TeXShop, but it is not as powerful as Windows Notepad, which only has some basic text editing functions.
Texlive + TeXstudio +JabRef
Where Texlive is chosen for the TeX distribution; TeXstudio is a LaTex editor, free of charge; JabRef manages the literature, making it easy to write references.
download
Texlive can be downloaded from Tsinghua Open Source Mirror to download the ISO image file
Double-click the ISO to go to the virtual CD-ROM and double-click the install-tl-advanced.bat file.
Modifying an Installation Directory
After the installation is complete, you can open CMD in Windows and enter tex-version. If the version number is displayed
TeX 3.14159265 (TeX Live 2019/W32TeX)
The installation is successful.
Texstudio installation
About texstudio download, need in the official website to download: texstudio.sourceforge.net/
Select the installation path and then do some simple configuration
Set Chinese interface
After the installation, the opening interface is in English at the beginning, here we can switch to Chinese.
Options — > Configure Texstudio — > General — > Language — > zh_CN
Add a line number
Add a paragraph line number. This makes it easy to see where a sentence in a paragraph is, especially if an error is reported.
Set up the compiler and encoding
In order to output Chinese normally, we need to change the compiler to xelatex, utF-8 encoding if it is for writing English papers, then the first picture below should not be changed to “xelatex”, English papers should use “pdflatex”.
demo
% introduction area
\documentclass{article}
% Import Chinese macros
\usepackage{ctex}
% build command, take alias, use degree instead of ^ circ
\newcommand\degree{^\circ}
\title{\heitiOn the Pythagorean Theorem\author{\kaishuZhang Yigen}\date{\today}
% the text area
\begin{document}
\maketitlehello world! The Pythagorean theorem can be described in modern language as follows: The square of the hypotenuse of a right triangle is equal to the sum of the square laws of the two waists. It can be described in symbolic language as: Suppose right triangles$\angle C=90\degree $There are:$$
AB^2 = BC^2 + AC^2
$$That's the Pythagorean theorem\end{document}
Copy the code
After creating a new.tex file, copy and paste the above code into it, then click on the build shown in the image below and look at it
reference
LaTeX learning: Installation and use of Texlive 2019 and TeX Studio