全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 LATEX论坛
2008 1
2015-11-03
LaTeX/基础[size=19.6512px]维基教科书,自由的教学读本
[size=17.9424px]< LaTeX



[size=20.292px]

目录 [size=20.292px] [隐藏]




文件类型[编辑]

LaTeX在处理输入文档(input file)时,首先需要的信息就是文档类型,由\documentclass这个指令来定义:

\documentclass[options]{class}

这里,"class(种类)"指定了将要被创建的文档的类型. LaTeX 也为其他种类的文件提供了额外的类型设置, 包括信件(letters)和幻灯片(slides). 选项参数(英文为options parameter, 指的应该是花括号里的内容)定义了\documentclass这个指令的行为.选项参数之间必须有逗号(comma)隔开.

Example: an input file for a LaTeX document could start with the line

\documentclass[11pt,twoside,a4paper]{article}

which instructs LaTeX to typeset the document as an article with a base font size of 11 points, and to produce a layout suitable for double sided printing on A4 paper.

Here are some document classes that can be used with LaTeX:

Document Classesarticlefor articles in scientific journals, presentations, short reports, program documentation, invitations, ...
IEEEtranfor articles with the IEEE Transactions format.
proca class for proceedings based on the article class.
minimalis as small as it can get. It only sets a page size and a base font. It is mainly used for debugging purposes.
reportfor longer reports containing several chapters, small books, thesis, ...
bookfor real books
slidesfor slides. The class uses big sans serif letters.
memoirfor changing sensibly the output of the document. It is based on the book class, but you can create any kind of document with it [1]
letterfor writing letters.
beamerfor writing presentations (see LaTeX/Presentations).

The most common options for the standard document classes are listed in the following table:

Document Class Options10pt, 11pt, 12ptSets the size of the main font in the document. If no option is specified, 10pt is assumed.
a4paper, letterpaper,...Defines the paper size. The default size is letterpaper; However, many European distributions of TeX now come pre-set for A4, not Letter, and this is also true of all distributions of pdfLaTeX. Besides that, a5paper, b5paper, executivepaper, and legalpaper can be specified.
fleqnTypesets displayed formulas left-aligned instead of centered.
leqnoPlaces the numbering of formulae on the left hand side instead of the right.
titlepage, notitlepageSpecifies whether a new page should be started after the document title or not. The article class does not start a new page by default, while report and book do.
onecolumn, twocolumnInstructs LaTeX to typeset the document in one column or two columns.
twoside, onesideSpecifies whether double or single sided output should be generated. The classes article andreport are single sided and the book class is double sided by default. Note that this option concerns the style of the document only. The option twoside does not tell the printer you use that it should actually make a two-sided printout.
landscapeChanges the layout of the document to print in landscape mode.
openright, openanyMakes chapters begin either only on right hand pages or on the next page available. This does not work with the article class, as it does not know about chapters. The report class by default starts chapters on the next page available and the book class starts them on right hand pages.
draftmakes LaTeX indicate hyphenation and justification problems with a small square in the right-hand margin of the problem line so they can be located quickly by a human. It also suppresses the inclusion of images and shows only a frame where they would normally occur.

For example, if you want a report to be in 12pt type on A4, but printed one-sided in draft mode, you would use:

\documentclass[12pt,a4paper,oneside,draft]{report}

套件[编辑]

While writing your document, you will probably find that there are some areas where basic LaTeX cannot solve your problem. If you want to include graphics, colored text or source code from a file into your document, you need to enhance the capabilities of LaTeX. Such enhancements are called packages. Packages are activated with the

\usepackage[options]{package}

command, where package is the name of the package and options is a list of keywords that trigger special features in the package. Some packages come with the LaTeX base distribution. Others are provided separately.

Modern TeX distributions come with a large number of packages pre-installed. If you are working on a Unix system, use the command texdoc for accessing package documentation. For more information, see the Packages section.

你将遇到的档案类型[编辑]

When you work with LaTeX you will soon find yourself in a maze of files with various extensions and probably no clue. The following list explains the most common file types you might encounter when working with TeX:


Common file extensions in LaTeX.auxA file that transports information from one compiler run to the next. Among other things, the .aux file is used to store information associated with cross-references.
.bblBibliography file output by BiBTeX and used by LaTeX
.bibBibliography database file
.blgBiBTeX log file.
.bstBiBTeX style file.
.clsClass files define what your document looks like. They are selected with the \documentclass command.
.dtxDocumented TeX. This is the main distribution format for LaTeX style files. If you process a .dtx file you get documented macro code of the LaTeX package contained in the .dtx file.
.insThe installer for the files contained in the matching .dtx file. If you download a LaTeX package from the net, you will normally get a .dtx and a .ins file. Run LaTeX on the .ins file to unpack the .dtx file.
.fdFont description file telling LaTeX about new fonts.
.dviDevice Independent File. This is the main result of a LaTeX compile run with latex. You can look at its content with a DVI previewer program or you can send it to a printer with dvips or a similar application.
.pdfPortable Document Format. This is the main result of a LaTeX compile run with pdflatex. You can look at its content or print it with any PDF viewer.
.logGives a detailed account of what happened during the last compiler run.
.tocStores all your section headers. It gets read in for the next compiler run and is used to produce the table of contents.
.lofThis is like .toc but for the list of figures.
.lotAnd again the same for the list of tables.
.idxIf your document contains an index. LaTeX stores all the words that go into the index in this file. Process this file with makeindex.
.indThe processed .idx file, ready for inclusion into your document on the next compile cycle.
.ilgLogfile telling what makeindex did.
.styLaTeX Macro package. This is a file you can load into your LaTeX document using the \usepackage command.
.texLaTeX or TeX input file. It can be compiled with latex.


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2015-11-3 19:00:51
thanks for sharing
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群