How to learn LaTeX in one day --- The shorter than not so short introduction to LaTeX2e

时间:2021-07-06 06:07:44

In order to have a more eye-catching title, I decide to post the Chinese version (for Chinese readers/learners): 如何在一天之内学会LaTeX, and the subtitle: 比112分钟学会LaTeX2e更快的学会LaTeX2e的介绍

 

I write like this for a reason i.e. I did learn (or begin to have a sense of) LaTeX in one day. While the subtitle came from a famous book called "lshort" or "The Not So Short Introduction to LaTeX2e". The Chinese version of that book has an interesting name "Learn LaTeX2e in 112 minutes". I believe you will be able to learn even faster than that after you read this article.

 

This introduction is for people like me, who has heard of TeX/LaTeX for a couple of times, urge to learn and heavily addicted to MS Word. Hopefully readers will also have some basic programming backgrounds, but not so necessary. I am not saying that MS Word is harmful, or charging people money is evil. Nevertheless, I think, even after you master LaTeX, Office tool kits are still great art works and brilliant inventions. "What you see is what you get" philosophy is, what I believe, the ultimate goal of software development. It is just, sometimes, we need to balance between "easy to use" and "efficiency".

 

So after you decide to learn LaTeX but without an instructor, the first barrier you will encounter is countless softwares and books on TeX/LaTeX. Shall I read "The not so short introduction to LaTeX2e"? Which editor should I choose, emacs or notepad++? What is the appropriate version of TeX Live to download? Please don't worry. This article is here to make shortcuts for you learners. After the author's several unsuccessful trials, he has found out it really doesn't matter that much. Whatever choice you made, it's ok. So for simplicity, I would strongly suggest you to keep with me, that is, use CTeX software and "LATEX TUTORIALS --- A PRIMER" as your textbook.

 

CTeX is for "Chinese TeX". You may found its project homepage here: http://www.ctex.org/HomePage. And download the latest version here (full version): http://www.ctex.org/CTeXDownload. This software is especially good with Chinese characters display. As for the textbook, you may download it here: http://www.tug.org/twg/mactex/tutorials/ltxprimer-1.0.pdf. Setup the software. Now let's try our first primitive tex file! Create a new text file at any directory and name it "test.tex". If you have correctly installed the CTeX, you should see that the icon will change to a pen writing on a piece of paper. Double click on the file to open WinEdit environment. This is where you will edit, compile and create pdf version of your tex file. The WinEdit looks like this:

How to learn LaTeX in one day --- The shorter than not so short introduction to LaTeX2e

 

You may edit tex file in the right window. A first-thing-first example looks like this: 

% This is my first LaTeX trial
\documentclass{article}
\begin{document}
Hello world!
\end{document}

  

Then WinEdit will look like this:

How to learn LaTeX in one day --- The shorter than not so short introduction to LaTeX2e

 

Click on menu "TeX->LaTeX" or simply use shortcut "Shift+Ctrl+L" to compile, WinEdit will look like this:

How to learn LaTeX in one day --- The shorter than not so short introduction to LaTeX2e

 

which show the compilation is successful. Then we may click on menu "TeX->PDF->dvi2pdf" to preview the created "test.pdf" file. Meanwhile, you may discover that under the same directory as test.tex's, a pdf file entitled "test.pdf" file is created. Till now our first trial of CTeX is finished.

 

This whole process seems quite troublesome. Why do I need to type all these complicated commands? In MS Word what I do is only to create a new ".docx" document, open it with Office Word and type in whatever I want. Why is LaTeX designed in such a humble way, seems even harder than a programming language? I thought of this question for so long today, and luckily I get to the point of Donald Knuth. Let's retrace our procedures in creating an entire article with Word. We need to type in contents, which takes most of the time, and we need to select the contents and adjust fonts, size etc. Sometimes we also need to edit paragraph formats, as page headers and footers too. Well, when you think this way, LaTeX is doing almost the same thing as MS Word. Each command sets the rules for a block of contents. The only difference is that, in MS Word, we use mouse, while in LaTeX, we use keyboards to set commands. Besides, LaTeX are nicer to exactly design the pattern we want. If we can master LaTeX, it will not take us more time to finish a document than MS Word. This is what I found the most exciting idea today. It gave me confidence that, LaTeX is not that difficult, it's just like Word. We simply type in contents, and make adjustments to place we want. One command is just like one mouse click in Word. I hope this truth of editing will give you confidence too.

 

Till this step, I shall say you are able to carry on learning by yourself. The textbook "LATEX TUTORIALS --- A PRIMER" contains many useful examples and I suggest you try every one of them by yourself. Finally my definition of being able to use and write LaTeX is to write a whole article/paper with the help of this textbook or google. Then you should add a new skill to your resume.