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

Source: Internet
Author: User

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

By Nan

For those who really want to get started with latex quickly, you can skip the preface.

This tutorial is intended for newcomers who have no knowledge of latex.
The aim is to allow new users to quickly and easily get started with latex to complete basic text editing.
The final achievement of this teaching material is the ability to use latex to write a normal proposal. If you want to increase your requirements, we recommend that you read the content of this article on your own and Google or other thick textbooks.
This is especially intended to break the fear of some new people who are hard to learn about latex.
After getting started, you can consult Google to solve various advanced applications, special requirements and exceptions.


First, I will introduce what latex is. The following three points are based on my personal experience.
1. Latex is a type of software used for editing and formatting. It is used to generate PDF documents.
2. the core idea of latex editing and formatting is to define the hierarchy of each sentence in the article through statements such as \ section and \ paragraph, which greatly facilitates batch processing at each level.
3. latex is not easily replaced by word in terms of user experience: convenient and elegant mathematical formula editing, non-dynamic backspace alignment, and WYSIWYG. Therefore, you can use backspace and line breaks to organize ideas during editing, but generating a PDF will not affect the appearance of Some mentors and publications. text that does not accept word formatting.


I would like to severely warn and speak out to those who are self-righteous advanced latex users. Please do not deliberately render latex as high-end and difficult to learn for your own poor and miserable vanity, what is the difference between this and the four types of writing methods for Kong Yiji's show-off fennel beans? Mixed account! How difficult is latex? Are you sure you know? Similarly, there are a large part of VI users, Linux users, and fallout player. Slot, just a piece of software. What is a good display. If someone else wants to learn latex, well, are you sure you want to lose a hundred-page manual? Have you seen it yourself? Do you really hope someone else can read it when you recommend it to others? If it's just an installation, it's a mixed account!


The motivation for writing this tutorial is because there is no simple and fast latex tutorial on the Internet. The simplest or most instructive thing I can find is the article latex, which is not very short. However, for those who want to quickly get to know latex, the "not very brief introduction" is still a little too long. I studied it all night at the beginning. I have been chatting in the latex community for a long time. Everyone is a friend. Now that I am idle, I will make up for it. Therefore, I wrote this tutorial for the purpose of teaching new people to get started, and omitted all the flashy content, make sure that you can follow this tutorial in 30 minutes to take full steps. This is basically a "Fun with latex. This thirty-minute period is the result of my experience in helping my friends get started with latex. For other latex tutorials, I personally recommend that you use a dictionary or encyclopedia after reading this article.

========================================================== =====

The following is the body of the tutorial. (The appendix is added at the end of the text)

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, of course, 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 the PDF file is successfully generated, click the magnifier button in the toolbar to quickly open the generated PDF file.


3. title, author, and comment
Create a new document, copy the following content into the document, save, save type to 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 type to 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}

This is just my personal preference 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 directory
Create a new document, copy the following content into the document, save, save type to 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 type to 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 type to 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 math symbol table of Latex 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 easy to find, and save the image as a name such as figure1.eps.
Create a new document, copy the following content into the document, save, save type to UTF-8, put in the same folder 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 type to 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 basic thesis framework. At least you can use latex.
In the process from the framework to the integrity of the paper, there must be many details, such as font size, combination of parts, such as complex tables.
For those questions, please consult Google. Generally, as a beginner, we have already asked many elders the same questions on the Internet. Just look at others' answers.
Latex's penetration rate in China is not high. Therefore, if you search for English keywords in many cases, you will get better results.


====================================
Appendix, which I think is not an urgent but useful information for beginners

1. Chinese support
The Chinese support of latex was troublesome, but it is very easy to use the Chinese support of miktex + winedt.
You only need to replace \ documentclass {atricle} with \ documentclass {ctexart.
If ctexart is used for the first time, the macro package and template will be automatically downloaded and installed.
The example is as follows:
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 newcomers, the commonly used macro packages 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}

These five macro packages are enough for new users. 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 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 contains 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.
If 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. References and slides
At the time of reference, the article is coming to an end, and slides are not an advanced requirement. Latex users who have requirements for these two functions are also quite skilled in using latex. It is a matter of course to Google them or consult other thick tutorials.
Here, I only provide two search keywords. You can search for the document and create a slide to search for Beamer.

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

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.