https://blog.csdn.net/cocoonyang/article/details/78036326
LaTex简介
TeX 是由Donald Knuth创造的基于底层编程语言的电子排版系统[1](TEX是Honeywell公司在1980年为其Text Executive文本处理系统注册的商标,它与 TeX是两回事)。TeX能够对文档的排版进行非常精细的操作,可以生成十分精美的文档。TeX系统生成的是DVI(Device Independent)文件。
LaTex是由Leslie Lamport开发的的TeX扩展命令集合[5]。LaTex可生成DVI和PDF格式文件。由于LaTex强大的排版功能,特别是对科技文档的支持,LaTex 已经成为撰写科研论文的事实上的标准[5]。
TeX在不同的硬件和操作系统上有不同的实现版本。目前Unix/Linux上常用的TeX系统是teTeX,Windows中有MiKTeX和fpTeX。CTeX是中文套装[4]。下面仅简要介绍在使用LaTex中一些常见问题。
LaTex 与 Word
Word 是微软公司推出的一款文档和文字处理软件,它也具有较强的排版功能。与LaTex相比,Word最大优势是其”所见既所得”的特点,因而入门门槛低。另一方面Word的语法和拼写错误检查等能力比LaTex强。
LaTex作为一款排版系统,格式控制、公式编辑方面比Word好用。LaTex生成的文档比Word文档更美观。LaTex的入门门槛比较高,使用LaTex不仅要编辑文本,整理文档格式,还要处理编译过程中出现的bugs,如果使用中文,更要注意GBK,UTF-8等文档编码这些琐碎问题。另外LaTex做的幻灯片没有Word做出来的好看。
LaTex 和 Word两款软件针对的用户群体不一样,在文字处理和文档排版方面有不同的理念。 两者在功能上有许多重合之处,各有优势和不足。
安装
Latex的衍生版本众多,中文环境中常用的时CTex。下载地址为
http://www.ctex.org/CTeXDownload
- 1
Ctex套装中自带Latex编辑器WinEdt
LaTex文件格式简介
TeX文件样例
下面是一个TeX文件的简单样例:
This is an example of TeX file format.
An example of mathematical formulaion: $ ds = \sqrt{dx^2 + dy^2} $
\bye
- 1
- 2
- 3
- 4
编译说明:
前提: 已经正确安装TeX编译环境,例如:LaTeX
操作步骤:
1) 将上述内容保存在一文本文件中,例如: foo.tex.
2) 在Windows控制台环境中,使用
tex foo.tex
- 1
既可生成相应的foo.dvi文件。
LaTex文件样例
下面一个样例[3]展示了LaTex文件的基本结构:
\documentclass[12pt, letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage{comment}
% Title
\title{Document Title}
\author{Nobody \thanks{Somebody}}
\date{Some Date}
\begin{document}
\begin{titlepage}
\maketitle
\end{titlepage}
\tableofcontents
\begin{abstract}
This is a simple paragraph at the beginning of the
document. A brief introduction about the main subject.
\end{abstract}
First document. This is a simple example, with no
extra parameters or packages included.
% Comments
\begin{comment}
This text won't show up in the compiled pdf
this is just a multi-line comment. Useful
to, for instance, comment out slow-rendering
while working on the draft.
\end{comment}
\end{document}