--- neokid 原创文章。转载时请注明出处。
What is LaTeX?
LaTeX is a high-quality typesetting system, with features designed for the production of technical and scientific documentation. LaTeX uses tags to mark up the content in documents. With the comprehensive style packets, control macros, commands and high expanding capability, users can produce high-quality documents without spending too time to adjust the layout the style. LaTeX is the de facto standard for the communication and publication of scientific documents.
Why LaTeX?
It is true that we already have some efficient document preparation tools such as Doxygen and DocBook, which actually have done great jobs for generating reference book for APIs etc., but when it goes to some large documents, such as the Developers’ Guide or Getting Started Guide, which require high-quality print out and well documented graphics, resource reference, bibliography, LaTeX is more powerful and more easy tool to use.
LaTeX is used by many famous publish houses and technical organizations as the standard document system for its high efficiency and quality. There are also some additional advantages for SDK team members who will engage document works.
· Firstly, LaTeX provide very flexible customize methods, so that we can create our own style packet for Motorola SDK documents. The style packet will contain page style definition, environment tags, control macros, which are all closely related to the specific elements in our document, so the engineers can put more efforts on the content rather than worry about the appearance of the documents. For example, engineers can use quite simple tags to embrace the text, only indicating the text should be common description, sample codes or command instructions, then pre-defined LaTeX packet take care of other things.
· Secondly, LaTeX can be easily interacted with other tools including Doxygen and DocBook. For example, Doxygen is able to output *.tex file (LaTeX source file), which can be used to produce DVI, PS and PDF files. We can also copy this generated tex source code into larger documents such as Developers’ Guide. LaTeX file can also be transformed into other format such as HTML, DocBook, XML by some addition tools such as latex2html (www.latex2html.org ). A large number of such tools can be found. We will put an incompleted list later in this tutorial.
Installing LaTeX
Windows I recommend the MiKTeX distribution to install, so you can easily manage TeX packages. It automatically starts to search the web for new packages when your document needs them. It also includes other components that help you work with your TeX system.
Unix-type systems, including Linux Many unix-like systems usually have TeX as an installation option. However, it is not installed in our ECGL system. The most widely used distribution is teTeX .
Detailed installation guide can be found in all these distribution packets.
Word processing companion
Theoretically speaking, having the latex distribution installed is enough for producing document. However, editing latex source file with numerous tags and commands, without any grammar highlight and spelling check can be daunting. Therefore, some companions are usually used to help people writing tex files. Here are some of them.
Windows | On windows, the best choice may be WinEdt by Dr. Aleksander Simonic. |
| UltraEdit is another choice. If your installed version doesn’t automatically highlight Latex key words, go to http://www.ultraedit.com/downloads/additional.html to download the latextag.txt, and then append it to the UltraEdit’s tagfile. |
Unix-type systems, including Linux | The most commonly used editor, vi , can give your basic helps. |
| Personally I refer Emacs for its multi document edit style, quick commands, high customizable features, and plentiful extensions. |
| AUCTex is an extension which makes Emacs even more suitable for typing latex files. |
| Kile is very similar to WinEdt on Windows. It requires Qt3.2 or above. It has beautiful edit environment and many friendly methods for editing, compiling, reviewing. |
Basic work process
Suppose we have typed a valid latex file named as mydoc.tex, run the following commands to compile it:
$ latex mydoc.tex
the output should be mydoc.dvi if no errors. Note that if hyperlinks or cross reference are used in the document, you may need to run the above command up to three times. The output DVI file can be converted to Postscript file with
$ dvi2ps mydoc.dvi
The postscript is very high quality document format but the file size is quite large. It can be converted to PDF file with tools such as ghostscript, which is available on most Linux system.
It is possible to generate PDF directly from latex source file by using
$ pdflatex mydoc.tex
Some modifications are needed, such as using JPEG, PNG pictures instead of EPS pictures.
The LaTeX source file
The framework of a latex source file, which has filename extension as tex, is demonstrated as follows.
Where to find more?
Of course the knowledge above is not enough for people who want to work with Latex frequently. In fact, Latex is such a large-scale system, and so many people are contributing to this system every day. So here is the list of some places for you can get helps from. It includes books, tutorials, forums, blogs and Wikis.
The Comprehensive Tex Archive Network, where you can find ALL about latex. | |
The authors of LaTeX2e set up this website, much useful knowledge can be found here. | |
Many useful tips about LaTeX for Chinese language are here. | |
The official manual for beginners. | |
A very good tutorial for beginners. | |
Using graphics in LaTeX really needs more skills. Learn them from this book! | |
The book above has been translated in Chinese by Wang Lei, who also put some addition skills according his own experience. | |
The most comprehensive manual. |
There are a large number of tools to help LaTeX interacting with other document tools. We can find lots of discussion about them. I will keep on evaluate these tools. The goal is to achieve one unique document content source, and generate the final released document in all necessary formats including HTML, PDF etc.
| Docbook stylesheet for LaTeX | http://lists.oasis-open.org/archives/docbook-apps/200403/msg00225.html |
| An xsl file for LaTeX | |
| Another xsl | |
| DB2Latex | |
|
| |
| Some ideas about file format conversion |