楼主: oliyiyi
5443 3

LaTeX/初学者必读_Latex_latex下载 [推广有奖]

版主

泰斗

0%

还不是VIP/贵宾

-

TA的文库  其他...

计量文库

威望
7
论坛币
271951 个
通用积分
31269.3519
学术水平
1435 点
热心指数
1554 点
信用等级
1345 点
经验
383775 点
帖子
9598
精华
66
在线时间
5468 小时
注册时间
2007-5-21
最后登录
2024-4-18

初级学术勋章 初级热心勋章 初级信用勋章 中级信用勋章 中级学术勋章 中级热心勋章 高级热心勋章 高级学术勋章 高级信用勋章 特级热心勋章 特级学术勋章 特级信用勋章

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

这份文件的用意是让你能更快速的了解LaTeX.

在开始之前,请确认你的电脑已经安装了LaTeX (安装LaTeX必要的步骤请参照Installation). 我们会从建立一个全新的LaTeX文件开始,接着会带着你利用这份文件来输出一份高品质的文稿,像是postscript格式或是PDF格式。


[size=20.292px]

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




LaTeX 源代码[编辑]

LaTeX 是所谓的标记式语言 (markup language), 使用一些标记去做文章的编排。LaTeX 系统把 LaTeX 源代码, 依其中的标记, 转成高品质的文件。打个比方说, LaTeX 很像网页用的 HTML, HTML 用标记来指定网页的排版, 文字的大小、颜色等等。

LaTeX 源代码只是一个纯文字档案, 最早使用英文就是用 ASCII 纯文字档, 近代为多国语言的使用 (包括中文), 大多使用 UTF-8 编码。只使用纯英文的档案, 用 UTF-8 编码也是完全和以前 ASCII 档案相容的, 因此建议有可能有中文或其他语言编写文件的需求, 就使用 UTF-8 编码。

如果你想以最快的速度进入状况, 我们介绍最简单 LaTeX 档: \documentclass{artical} \begin{document} Hallo! \end{document}

空格或空行[编辑]

空白字元比方space或是Tab在Latex中通常都被视为空格,多个空格在latex中也被视为单一空格。 若空白在一行的行首时通常不会显示出来,每一行的结束通常在Latex中都会被视为一个空格。 若要表示一个段落,则在上段最后一句和下段第一句间留下空行即可,然而空下多行在latex中会被视为只有空下一行。 下面正是例子。左边为tex档的文字,右端为输出的结果。

θ

特殊字元[编辑]

以下列举字元含特殊意义,若你直接输入下列字元,则下列字元将无法输出。

# $ % ^ & _ { } ~ \

若要让这些文字得以输出,请在这些字元前加反斜线: \documentclass{artical} \begin{document} Hallo! \end{document}

The other symbols and many more can be printed with special commands in mathematical formulae or as accents.

The backslash character ± can not be entered by adding another backslash in front of it (±); this sequence is used for line breaking. For introducing a backslash in math mode, you can use ± instead.

The command ± produces a tilde which is placed over the next letter. For example ± gives ñ. To produce just the character ~, use ±} which places a ~ over an empty box.

Similarly, the command ± produces a hat over the next character, for example ±} produces ô. If you need in text to display the ^ symbol you have to use ±.

If you want to insert text that might contain several particular symbols (such as URIs), you can consider using the ± command, that will be discussed later in the section on formatting.

LaTeX 指令[编辑]

LaTeX的命令是大小写敏感的, 一般取下列两种格式之一:

  • They start with a backslash ± and then have a name consisting of letters only. Command names are terminated by a space, a number or any other "non-letter".
  • They consist of a backslash ± and exactly one non-letter.

Some commands need an argument, which has to be given between curly braces ±} after the command name. Some commands support optional parameters, which are added after the command name in square brackets ±. The general syntax is: \documentclass{artical} \begin{document} Hallo! \end{document}

LaTeX 环境[编辑]

Environments in LaTeX have a role that is quite similar to commands, but they usually have effect on a wider part of the document. Their syntax is: \documentclass{artical} \begin{document} Hallo! \end{document}

Between the ± and the ± you can put other commands and nested environments. In general, environments can accept arguments as well, but this feature is not commonly used and so it will be discussed in more advanced parts of the document.

Anything in LaTeX can be expressed in terms of commands and environments.

评论[编辑]

When LaTeX encounters a ± character while processing an input file, it ignores the rest of the current line, the line break, and all whitespace at the beginning of the next line.

This can be used to write notes into the input file, which will not show up in the printed version. θ

Note that the ± character can be used to split long input lines that do not allow whitespace or line breaks, as with Supercali...cious above.

The core LaTeX language does not have a predefined syntax for commenting out regions spanning multiple lines. Refer to multi-line comments for simple workarounds.

输入档案架构[编辑]

When LaTeX processes an input file, it expects it to follow a certain structure. Thus every input file must start with the command \documentclass{artical} \begin{document} Hallo! \end{document}

This specifies what sort of document you intend to write. After that, you can include commands that influence the style of the whole document, or you can load packages that add new features to the LaTeX system. To load such a package you use the command \documentclass{artical} \begin{document} Hallo! \end{document}

When all the setup work is done, you start the body of the text with the command \documentclass{artical} \begin{document} Hallo! \end{document}

Now you enter the text mixed with some useful LaTeX commands. At the end of the document you add the \documentclass{artical} \begin{document} Hallo! \end{document}

command, which tells LaTeX to call it a day. Anything that follows this command will be ignored by LaTeX. The area between ± and ±} is called the preamble.

A Typical Command Line Session[编辑]

LaTeX itself does not have a GUI (graphical user interface), since it is just a program that crunches away at your input files, and produces either a DVI or PDF file. Some LaTeX installations feature a graphical front-end where you can click LaTeX into compiling your input file. On other systems there might be some typing involved, so here is how to coax LaTeX into compiling your input file on a text based system. Please note: this description assumes that you already have a working LaTeX installation on your computer.

  • Edit/Create your LaTeX input file. This file must be plain ASCII text. On Unix all the editors will create just that. On Windows you might want to make sure that you save the file in ASCII or Plain Text format. When picking a name for your file, make sure it bears a .tex extension.
  • Run LaTeX on your input file. If successful you will end up with a .dvi file. It may be necessary to run LaTeX several times to get the table of contents and all internal references right. When your input file has a bug LaTeX will tell you about it and stop processing your input file.

Type ctrl-D to get back to the command line.

latex foo.tex

Now you may view the DVI file. On Unix with X11 you can type xdvi foo.dvi, on Windows you can use a program called yap (yet another previewer). (Now evince and okular, the standard document viewers for many Linux distributions are able to view DVI files.)

You can run a similar procedure with pdflatex to produce a PDF document from the original .tex source. Similar to above, type the commands:

pdflatex foo.tex

Now you may view the PDF file, foo.pdf.


二维码

扫码加我 拉你入群

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

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

关键词:LaTeX atex Late TeX LAT Latex初学者 Latex培训 latex下载

回帖推荐

taoan 发表于4楼  查看完整内容

大于等于号和小于等于号在latex中怎么打? 有两种大于等于和小于等于号, (1) 在大于小于号加下划线作等号的一种很简单但不美观, 直接在正文区的公式环境中输入下面的命令 大于号敲\geq ,小于号敲\leq (2) 等号线倾斜并与大小于号下边平行的一种和我们手写一致,比较美观, 需要先在导言区使用两个宏包: \usepackage{amsmath} \usepackage{amssymb} 然后在正文区公式环境中输入: 大于号敲\geslant,小于号敲\leslant
缺少币币的网友请访问有奖回帖集合
https://bbs.pinggu.org/thread-3990750-1-1.html
沙发
seahhj 发表于 2015-11-3 17:24:05 |只看作者 |坛友微信交流群
thanks for sharing

使用道具

藤椅
houyunhuang 发表于 2015-12-7 09:49:51 |只看作者 |坛友微信交流群

使用道具

板凳
taoan 发表于 2016-9-26 11:05:59 |只看作者 |坛友微信交流群
大于等于号和小于等于号在latex中怎么打?
有两种大于等于和小于等于号,
(1) 在大于小于号加下划线作等号的一种很简单但不美观,
直接在正文区的公式环境中输入下面的命令
大于号敲\geq ,小于号敲\leq
(2) 等号线倾斜并与大小于号下边平行的一种和我们手写一致,比较美观,
需要先在导言区使用两个宏包:
\usepackage{amsmath}
\usepackage{amssymb}
然后在正文区公式环境中输入:
大于号敲\geslant,小于号敲\leslant

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-26 16:17