Latex newbie tutorial, 30 minutes from completely unfamiliar to basic entry

Source: Internet
Author: User

1. Installation and Use of latex Software
Method A (self-help): download and install the free miktex package on the miktex official website. Download and install winedt (charged), texmaker (free), and other editing interface software.
Method B (packaging): Download The ctex package (including miktex and winedt) at ctex.org)
Haha, this part is not included in the title for 30 minutes.


2. First Document
Open winedt, create a new document, copy the following content into the document, save type select UTF-8.

\ Documentclass {Article}
\ Begin {document}
Hello, world
\ End {document}

In the winedt toolbar, find the compile button (in the middle of the bin and letter B), select xetex from the drop-down menu, and click compile.
If it succeeds, we can generate the first PDF file. Click the magnifier button in the toolbar to open the generated PDF file at high speed.


3. title, author, and gaze
Create a new document, copy the following content into the document, save, save the type to select UTF-8, compile and observe the phenomenon.

\ Documentclass {Article}
\ Author {My name}
\ Title {the title}
\ Begin {document}
\ Maketitle
Hello, world % This is comment
\ End {document}


4. chapters and paragraphs
Create a new document, copy the following content into the document, save, save the type to select UTF-8, compile and observe the phenomenon.

\ Documentclass {Article}
\ Title {Hello world}
\ Begin {document}
\ Maketitle
\ Section {Hello China} China is in East Asia.
\ Subsection {Hello Beijing} Beijing is the capital of China.
\ Subsubsection {Hello Dongcheng District}
\ Paragraph {Tian 'anmen Square} is in the center of Beijing
\ Subparagraph {Chairman Mao} is in the center of Tian 'anmen Square
\ Subsection {Hello Guangzhou}
\ Paragraph {Sun Yat-sen University} is the best university in Guangzhou.
\ End {document}

The exit is just my personal preferences and looks clear and beautiful. This is not necessary in practice. The space before each line does not affect the typographical result of the edited PDF.


5. Add a folder
Create a new document, copy the following content into the document, save, save the type to select UTF-8, compile and observe the phenomenon.

\ Documentclass {Article}
\ Begin {document}
\ Tableofcontents
\ Section {Hello China} China is in East Asia.
\ Subsection {Hello Beijing} Beijing is the capital of China.
\ Subsubsection {Hello Dongcheng District}
\ Paragraph {Hello Tian 'anmen Square} is in the center of Beijing
\ Subparagraph {Hello Chairman Mao} is in the center of Tian 'anmen Square
\ End {document}

6. line feed
Create a new document, copy the following content into the document, save, save the type to select UTF-8, compile and observe the phenomenon.
\ Documentclass {Article}
\ Begin {document}
Beijing is
The capital
Of China.

New York is

The capital

Of America.

Amsterdam is \ The capital \\
Of Netherlands.
\ End {document}


7. mathematical formulas
Create a new document, copy the following content into the document, save, save the type to select UTF-8, compile and observe the phenomenon.

\ Documentclass {Article}
\ Usepackage {amsmath}
\ Usepackage {amssymb}
\ Begin {document}
The Newton's second law is f = ma.

The Newton's second law is $ F = ma $.

The Newton's second law is
$ F = ma $

The Newton's second law is
\ [F = Ma \]

Greek letters $ \ ETA $ and $ \ Mu $

Fraction $ \ frac {A} {B} $

Power $ A ^ B $

Subscript $ a_ B $

Derivate $ \ frac {\ partial y} {\ partial t} $

Vector $ \ VEC {n} $

Bold $ \ mathbf {n} $

To time differential $ \ dot {f} $

Matrix (LCR here means left, center or right for each column)
\[
\ Left [
\ Begin {array} {LCR}
A1 & B22 & c333 \\
D444 & e555555 & F6
\ End {array}
\ Right]
\]

Equations (here \ & is the symbol for aligning different rows)
\ Begin {Align}
A + B & = C \\
D & = e + F + G
\ End {Align}

\[
\ Left \{
\ Begin {aligned}
& A + B = C \\
& D = e + F + G
\ End {aligned}
\ Right.
\]

\ End {document}

For details, you can search for the latex mathematical symbol table or the example given by others.


8. insert an image
Search for a software program that converts an image into an EPS file, which is very easy to find, and then save the image as a name such as figure1.eps.
Create a new document, copy the following content into the document, save, save type select UTF-8, put in the same directory as the image file, compile and observe the phenomenon.

\ Documentclass {Article}
\ Usepackage {graphicx}
\ Begin {document}
\ Shortdegraphics [width = 4.00in, Height = 3.00in] {figure1.eps}
\ End {document}


9. Simple Table
Create a new document, copy the following content into the document, save, save the type to select UTF-8, compile and observe the phenomenon.

\ Documentclass {Article}
\ Begin {document}
\ Begin {tabular} {| c |}
A & B \\
C & D \\
\ End {tabular}

\ Begin {tabular} {| c |}
\ Hline
A & B \\
\ Hline
C & D \\
\ Hline
\ End {tabular}

\ Begin {Center}
\ Begin {tabular} {| c |}
\ Hline
A & B \\\ hline
C & D \\
\ Hline
\ End {tabular}
\ End {Center}
\ End {document}


10. End
So far, you can use the article template provided by latex to write a major essay framework. At least you can use latex.
In the process from the framework to the complete, there must be a lot of details, such as the font size, such as image splicing, such as complex tables and so on.
For those questions, please consult Google. Generally, as people who are new to learning, we have already raised the same questions on the Internet by many of our predecessors. Just look at others' answers.
Latex penetration rate in China is not high, so it is often assumed that searching for English keywords will achieve better results.


====================================
Appendix, which I think is not a matter of urgent use for new users, but is indeed more practical than NLP

 

1. Chinese support
In the past, latex's Chinese support was more complicated than NLP, but now it is easy to use miktex + winedt Chinese support.
You only need to replace \ documentclass {atricle} with \ documentclass {ctexart.
If you use ctexart for the first time, you can manually download and install the macro package and template.
Example:
Open winedt, create a new document, copy the following content into the document, save type select UTF-8.
\ Documentclass {ctexart}
\ Begin {document}
Hello, world
\ End {document}


2. Macro package
\ Package {} is calling the macro package. It can be understood as a toolbox for students who are really familiar with computers.
Some special commands are defined in each macro package. These commands can be used to achieve unified layout (such as font fonts) of a class of objects (such as mathematical formulas ), or used to implement some functions (such as inserting images or creating complex tables ).
Generally, after \ documentclass and before \ begin {document}, the macro packages required by the article are listed.
For new users, macro packages that are often used by developers include

Macro package for editing mathematical formulas: \ usepackage {amsmath} And \ usepackage {amssymb}
Macro package for editing mathematical theorem and proof process: \ usepackage {amsthm}
Insert the macro package of the image: \ usepackage {graphicx}
Macro package for complex tables: \ usepackage {multirow}

Almost the same. For newcomers, these five macro packages are enough. If you have other special requirements, search for them through Google.
Note that the ctexart template now integrates Chinese support, so the CJK macro package is not a necessity.


3. Template
The template is the content in braces following \ documentclass.
In this tutorial, we use latex's default built-in template article and the Chinese template ctexart.
The template is the second implementation method that summarizes latex's experience.
In an article, we define section and paragraph, that is, the font size is not defined, because the font size is usually implemented in the template.
A template can specify what fonts are used at the section level and how the font size is aligned. What fonts are used at the subsection level and how the font size is aligned at the subsection level, and what fonts and font size are aligned at the paragraph level.
Of course, the template also includes some custom passwords and page settings such as the header and footer margins.
Because of the use of templates, in my experience, it is absolutely impossible to be a basic entry-level content, so it will not be mentioned in the text.
Suppose someone really wants to learn it. If latex has already reached this level, it will not be a loss to go over other thick teaching materials.



4. upload documents and make slides
The article was coming to an end when I took the exam, and slides were not an advanced requirement. Latex users who have requirements for these two functions are also quite skilled in using latex. It is not a matter of course to Google them or consult other thick tutorials.
Here I only provide two search keywords, which can be searched by the Referer literature, and Beamer can be searched by the slides.


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.