特殊:Badtitle/NS100:LaTeX/zh
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/LaTeX }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/af | • {{#if: UbuntuHelp:LaTeX|Afrikaans| [[::LaTeX/zh/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/ar | • {{#if: UbuntuHelp:LaTeX|العربية| [[::LaTeX/zh/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/az | • {{#if: UbuntuHelp:LaTeX|azərbaycanca| [[::LaTeX/zh/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/bcc | • {{#if: UbuntuHelp:LaTeX|جهلسری بلوچی| [[::LaTeX/zh/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/bg | • {{#if: UbuntuHelp:LaTeX|български| [[::LaTeX/zh/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/br | • {{#if: UbuntuHelp:LaTeX|brezhoneg| [[::LaTeX/zh/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/ca | • {{#if: UbuntuHelp:LaTeX|català| [[::LaTeX/zh/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/cs | • {{#if: UbuntuHelp:LaTeX|čeština| [[::LaTeX/zh/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/de | • {{#if: UbuntuHelp:LaTeX|Deutsch| [[::LaTeX/zh/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/el | • {{#if: UbuntuHelp:LaTeX|Ελληνικά| [[::LaTeX/zh/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/es | • {{#if: UbuntuHelp:LaTeX|español| [[::LaTeX/zh/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/fa | • {{#if: UbuntuHelp:LaTeX|فارسی| [[::LaTeX/zh/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/fi | • {{#if: UbuntuHelp:LaTeX|suomi| [[::LaTeX/zh/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/fr | • {{#if: UbuntuHelp:LaTeX|français| [[::LaTeX/zh/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/gu | • {{#if: UbuntuHelp:LaTeX|ગુજરાતી| [[::LaTeX/zh/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/he | • {{#if: UbuntuHelp:LaTeX|עברית| [[::LaTeX/zh/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/hu | • {{#if: UbuntuHelp:LaTeX|magyar| [[::LaTeX/zh/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/id | • {{#if: UbuntuHelp:LaTeX|Bahasa Indonesia| [[::LaTeX/zh/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/it | • {{#if: UbuntuHelp:LaTeX|italiano| [[::LaTeX/zh/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/ja | • {{#if: UbuntuHelp:LaTeX|日本語| [[::LaTeX/zh/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/ko | • {{#if: UbuntuHelp:LaTeX|한국어| [[::LaTeX/zh/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/ksh | • {{#if: UbuntuHelp:LaTeX|Ripoarisch| [[::LaTeX/zh/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/mr | • {{#if: UbuntuHelp:LaTeX|मराठी| [[::LaTeX/zh/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/ms | • {{#if: UbuntuHelp:LaTeX|Bahasa Melayu| [[::LaTeX/zh/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/nl | • {{#if: UbuntuHelp:LaTeX|Nederlands| [[::LaTeX/zh/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/no | • {{#if: UbuntuHelp:LaTeX|norsk| [[::LaTeX/zh/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/oc | • {{#if: UbuntuHelp:LaTeX|occitan| [[::LaTeX/zh/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/pl | • {{#if: UbuntuHelp:LaTeX|polski| [[::LaTeX/zh/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/pt | • {{#if: UbuntuHelp:LaTeX|português| [[::LaTeX/zh/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/ro | • {{#if: UbuntuHelp:LaTeX|română| [[::LaTeX/zh/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/ru | • {{#if: UbuntuHelp:LaTeX|русский| [[::LaTeX/zh/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/si | • {{#if: UbuntuHelp:LaTeX|සිංහල| [[::LaTeX/zh/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/sq | • {{#if: UbuntuHelp:LaTeX|shqip| [[::LaTeX/zh/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/sr | • {{#if: UbuntuHelp:LaTeX|српски / srpski| [[::LaTeX/zh/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/sv | • {{#if: UbuntuHelp:LaTeX|svenska| [[::LaTeX/zh/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/th | • {{#if: UbuntuHelp:LaTeX|ไทย| [[::LaTeX/zh/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/tr | • {{#if: UbuntuHelp:LaTeX|Türkçe| [[::LaTeX/zh/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/vi | • {{#if: UbuntuHelp:LaTeX|Tiếng Việt| [[::LaTeX/zh/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/yue | • {{#if: UbuntuHelp:LaTeX|粵語| [[::LaTeX/zh/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/zh | • {{#if: UbuntuHelp:LaTeX|中文| [[::LaTeX/zh/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/zh-hans | • {{#if: UbuntuHelp:LaTeX|中文(简体)| [[::LaTeX/zh/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX/zh}}/zh-hant | • {{#if: UbuntuHelp:LaTeX|中文(繁體)| [[::LaTeX/zh/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:LaTeX|:LaTeX/zh|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :LaTeX/zh/zh | | {{#ifexist: LaTeX/zh/zh | | {{#ifeq: {{#titleparts:LaTeX/zh|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:LaTeX/zh|1|-1|}} | zh | | }}
Latex is a language for describing a document. If you have used HTML, or edited a wiki then you will be familiar with the idea of using symbols or commands within a text file to describe the layout of text. Latex is commonly used in scientific publishing. It helps you to make well formated papers, with good looking formulae. It also helps keep track of figure and equation numbers. Latex files can be converted into a huge number of formats such as PDF, PostScript, DVI, and HTML.
LaTex 是一种文档描述语言。如果你曾使用过 HTML, 或曾经编辑过 wiki 那么你对文本中使用符号或命令来描述文档结构的方法很熟悉。 LaTeX 普遍使用在科学出版界。它帮助你制作非常漂亮的论文,还有非常好看的数学公式。它也能帮助你跟踪记录图片和公式的编号。LaTeX 源文件能够被转换成非常多的格式比如 PDF, PostScript, DVI, 和 HTML。
A Latex file is an ASCII file containing the text and markup commands. It can be written in a text editor such as Gedit or vim. It is converted into an output format using a Latex compiler. Some people like to write Latex files in a more integrated environment, with menus and buttons for formatting commands. There are also many add on packages that add features to Latex.
一个 LaTeX 源文件是一个包含文本和标记命令的 ASCII 文件。它能够在文本编辑器如 Gedit 和 Vim 中编辑。他被 LaTeX 编译器转换成特定的输出格式。有人喜欢在一个更加集成的环境中书写 LaTeX 文件,使用菜单和按钮来生成格式控制命令。也有非常多的插件包为 LaTeX 增加新的功能。
Installing
安装
Like Linux, Latex is a collection of many tools and files. Rather than find and install them all you use a Latex distribution. Latex distributions in the Ubuntu repositories are 就像 Linux, LaTeX 也包含了非常多的相互依赖的工具和文件。一般来说,您会使用一个 LaTeX 的发行版,而不是寻找和安装所有的这些文件,在 Ubuntu 的软件仓库中,他们是下面的两种:
- Tetex
- Texlive
Tetex is a common Latex distribution for Linux. This is in the main Ubuntu repository and can be installed with synaptic or apt-get. At a minimum you will need to install the packages
tetex-base tetex-bin
you may also want some add on packages
tetex-extra
Another Latex distribution you can install is texlive. Texlive has a more comprehensive selection of Latex tools than tetex but takes up more space. It is also a newer addition to Ubuntu so you may run into some teething problems. It is available for Ubuntu from version 6.10 and is in the universe repository.
To install texlive install the package
texlive
Add on packages
Latex can be extended using add on packages.
Repositories
In addition to tetex-extra
there are numerous packages in the repositories containing add-ons. To see what packages are available you can browse
Software Packages in "breezy", tex section.
Other add-ons
There are also lots of add-ons which are not in the repositories. A comprehensive list is availiable at the TeX Catalogue Online or the Comprehensive TeX Archive Network. They are usually downloaded as tar.gz or zip files. To install them they need to be uncompressed and copied to /usr/local/share/texmf/tex/latex/. Then you need to run texhash, to update the database.
If you downloaded the package mhchem.zip to your home directory, then this should work:
cd /usr/local/share/texmf/tex/latex sudo unzip ~/mhchem.zip sudo texhash
Local Installation
You can also install style or class files in your home directory. This is especially useful if you don't have access to root privileges. The variable TEXINPUTS
controls where latex looks for local files.
Suppose you want to put them in a subdirectory of your home directory called mylatex
. Just set TEXINPUTS
as follows:
export TEXINPUTS= ~/mylatex/:
Now you can put files in ~/mylatex
and latex will know where to find them.
To set this as the default value of TEXINPUTS
add the line above to .bashrc
or type
cd echo "export TEXINPUTS= ~/mylatex:" >> .bashrc
Useful addons include:
Resources
- TeX Users Group Lots of links
- Latex Documentation
- A-Z list of TeX FAQs
Inverse Search
Inverse search means that
- A mouse click in the dvi-viewer window can open an editor with the corresponding place in the (La)TeX source (also called `reverse search')
* Ctrl-Left Click is the default for xdvi * Middle Click is the default for kdvi
- the dvi-viewer can jump to (and visually highlight) a position in the DVI file that corresponds to a certain line number in the (La)TeX source file (`forward search').
- for information see [1]
Emacs and xdvi
Reverse search
Instructions to set up reverse search with emacs and xdvi
- Add the following line to the file
.emacs
in your home directory
- Add the following line to the file
(server-start)
- Add the following line to
.Xresources
- Add the following line to
xdvi.editor: emacsclient --no-wait +%l %f
- and run
xrdb .Xresources
- Download and install the latex package srcltx
- You need to compile your latex file with the srcltx package. Put the line
\usepackage[active]{srcltx}
in your latex files for this to work
Kile and kdvi
- You need to compile your latex file with the srcltx package. Put the line
\usepackage[active]{srcltx}
in your latex files and forward and reverse search should work.