Latex installation and use

Install Latex under Ubuntu; for convenience, I directly install texlive-full. If you have changed the source, the download is quite fast! Run the following command in the terminal:

sudo apt install texlive-full
sudo apt install texworks

It may take a long time, wait patiently for the installation to complete;

Xe clicks the following icon to start using Latex:

Copy the following content and save it; pay special attention to that the program is compiled with pdfTex by default, but using this compilation will report an error and should be replaced with XeLatex;

\documentclass[UTF8]{ctexart}
\begin{document}
Hello!

Thanks for using me!
\end{document}

             Replace with               

Next, click the "Player" button on the left of XeLatex to generate a pdf file; generally, a preview will be generated on the left. The successful results are as follows:

Ok, there is no problem in generating English pdf files here, but Chinese pdf files cannot be generated yet, because there are some fonts required by Chinese under Ubuntu; therefore, we need to copy Windows fonts, Windows fonts have been stored In the C: \\ WINDOWS \ fonts folder, enter the folder, use the shortcut key Ctrl + A to select all, use the shortcut key Ctrl + C to copy, and the system fonts under Ubuntu are stored in the / usr / share / fonts folder, You can create a new folder under this folder (for example, Win-Fonts), copy the fonts previously copied under Windows into this folder; then run the command fc-cache in the terminal

Let's see if we can now generate a pdf file containing Chinese; replace the following code with the previous code:

\documentclass[UTF8]{ctexart}
\begin{document}
Hello!

Thanks for using me!

你好!

谢谢你使用我!
\end{document}

Also pay attention to compile with XeLatex! There should be no problems, and the successful results are as follows:

At this point, Latex can be used normally.

Published 9 original articles · won 0 · 115 views

Guess you like

Origin blog.csdn.net/ckm1607011/article/details/105595439