个人工具

“UbuntuHelp:LaTeX/zh”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(New page: {{Translation}} {{From|https://help.ubuntu.com/community/LaTeX}} {{Translator|zhan}} {{Languages|UbuntuHelp:LaTeX}} Latex is a language for describing a document. If you have used HTML, ...)
 
安装: tetex-bin 和 tetex-base 在发布源被 texinfo 和 tex-common 所替代。
 
(未显示2个用户的12个中间版本)
第1行: 第1行:
{{Translation}}
 
 
{{From|https://help.ubuntu.com/community/LaTeX}}
 
{{From|https://help.ubuntu.com/community/LaTeX}}
 
{{Translator|zhan}}
 
{{Translator|zhan}}
 +
{{Verifier|dbzhang800}}
 
{{Languages|UbuntuHelp:LaTeX}}
 
{{Languages|UbuntuHelp:LaTeX}}
  
  
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。
  
LaTex 是一种文档描述语言。如果你曾使用过 HTML, 或曾经编辑过 wiki 那么你对文本中使用符号或命令来描述文档结构的方法很熟悉。 LaTeX 普遍使用在科学出版界。它帮助你制作非常漂亮的论文,还有非常好看的数学公式。它也能帮助你跟踪记录图片和公式的编号。LaTeX 源文件能够被转换成非常多的格式比如 PDF, PostScript, DVI, 和 HTML。
+
一个 LaTeX 源文件是一个包含文本和标记命令的 ASCII 文件。它能够在文本编辑器如 Gedit 和 Vim 中编辑。他被 LaTeX 编译器转换成特定的输出格式。有人喜欢在一个更加集成的环境中书写 LaTeX 文件,使用菜单和按钮来生成格式控制命令。有非常多的宏包为 LaTeX 增加新的功能。
 
+
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 的软件仓库中,他们是下面的两种:
+
就像 Linux, LaTeX 也包含了非常多的相互依赖的工具和文件。一般来说,您会使用一个 LaTeX 的发行版,而不是寻找和安装所有的这些文件,在 Ubuntu 的软件仓库中的发行版是:
  
 
* Tetex
 
* Tetex
 
* Texlive  
 
* 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 是一个常用的适用于 Linux 的 LaTeX 的发行版。它在 Ubuntu 的 main 软件仓库中,可以使用新利得或 apt-get 来安装。至少您要安装下列软件包:
 +
 
 
<pre><nowiki>
 
<pre><nowiki>
tetex-base tetex-bin
+
tetex-info tetex-common
 
</nowiki></pre>
 
</nowiki></pre>
you may also want some add on packages
+
 
 +
您可能也需要一些附加包:
 
<pre><nowiki>
 
<pre><nowiki>
 
tetex-extra
 
tetex-extra
 
</nowiki></pre>
 
</nowiki></pre>
  
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.
+
另一个您可以安装的 LaTeX 的发行版是 texlive。Texlive 是一个比 tetex 更加丰富的LaTeX 套件的选择,同时也需要更大的空间。同时它也是 Ubuntu 新加入的特性,所以您可能的遇到一些问题。从 6.10 开始它就可以使用在 Ubuntu 上并处于 universe 的软件仓库中。
  
To install texlive install the package
+
安装 texlive 您需要安装软件包
 
<pre><nowiki>
 
<pre><nowiki>
 
texlive
 
texlive
 
</nowiki></pre>
 
</nowiki></pre>
 
=== Add on packages ===
 
  
Latex can be extended using add on packages.
+
= 附加软件包 =
  
====  Repositories  ====
+
可以使用附加软件包来扩展 LaTeX 的功能。
  
In addition to <code><nowiki>tetex-extra</nowiki></code> there are numerous packages in the repositories containing add-ons. To see what packages are available  you can browse
 
[http://packages.ubuntu.com/breezy/tex/ Software Packages in "breezy", tex section].
 
  
==== Other add-ons ====
+
== 软件仓库 ==
  
There are also lots of add-ons  which are not in the repositories.
+
除了 <code><nowiki>tetex-extra</nowiki></code> 之外仓库中还有很多软件包包含有 LaTeX 的附加软件。您可以查看以下页面来看看究竟有哪些软件
A comprehensive list is availiable at the [http://www.tug.org/tex-archive/help/Catalogue/index.html TeX Catalogue Online] or the [http://www.ctan.org/ 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:
+
[http://packages.ubuntu.com/breezy/tex/ breezy 的软件包,tex 章节].
 +
[http://packages.ubuntu.com/dapper/tex/ dapper 的软件包,tex 章节].
 +
[http://packages.ubuntu.com/edgy/tex/ edgy 的软件包,tex 章节].
 +
[http://packages.ubuntu.com/feisty/tex/ feisty 的软件包,tex 章节].
 +
 
 +
== 其他的附加软件 ==
 +
 
 +
还有非常多不在软件仓库中的附加软件。
 +
 
 +
下面有一个非常丰富的列表。
 +
 
 +
[http://www.tug.org/tex-archive/help/Catalogue/index.html 在线 TeX 目录 ] 或者  [http://www.ctan.org/ 全面的 TeX 软件包网络].
 +
通常下载回来的软件包是 tar.gz 或者 zip 格式的。安装它们您需要把它们解压并拷贝到 /usr/local/share/texmf/tex/latex 中,然后您需要运行 texhash 命令来更新数据库。
 +
 
 +
如果您下载了一个软件包 mhchem.zip 到您的家目录,那么执行下面的步骤应该能够起作用:
 
<pre><nowiki>
 
<pre><nowiki>
 
cd /usr/local/share/texmf/tex/latex
 
cd /usr/local/share/texmf/tex/latex
第57行: 第63行:
 
sudo texhash
 
sudo texhash
 
</nowiki></pre>
 
</nowiki></pre>
==== 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 <code><nowiki> TEXINPUTS </nowiki></code> controls where latex looks for local files. 
+
== 本地安装 ==
 +
 
 +
您也可以把类型或类文件安装在您的家目录中。如果您没有 root 权限的话,这样做显得尤其有用。<code><nowiki> TEXINPUTS </nowiki></code> 控制 LaTeX 在什么地方寻找本地的文件。
  
Suppose you want to put them in a subdirectory of your home directory called <code><nowiki>mylatex</nowiki></code>. Just set <code><nowiki> TEXINPUTS </nowiki></code> as follows:
+
假定您想把它们放在你的家目录的一个叫做 <code><nowiki>mylatex</nowiki></code> 的子目录下面,只要按照如下设置 <code><nowiki> TEXINPUTS </nowiki></code> :
 
<pre><nowiki>  
 
<pre><nowiki>  
 
export TEXINPUTS= ~/mylatex/:
 
export TEXINPUTS= ~/mylatex/:
 
</nowiki></pre>
 
</nowiki></pre>
  
Now you can put files in <code><nowiki> ~/mylatex </nowiki></code> and latex will know where to find them.  
+
现在您可以把文件解压到 <code><nowiki> ~/mylatex </nowiki></code>, LaTeX 能够知道到什么地方去寻找它们。
 +
 
 +
要把这个设置成 <code><nowiki>TEXINPUTS</nowiki></code> 的默认值需要将上面的一样加入到 <code><nowiki>.bashrc</nowiki></code> 或者在终端中输入:
  
To set this as the default value of <code><nowiki>TEXINPUTS</nowiki></code> add the line above to <code><nowiki>.bashrc</nowiki></code> or type
 
 
<pre><nowiki>
 
<pre><nowiki>
 
cd
 
cd
第74行: 第82行:
 
</nowiki></pre>
 
</nowiki></pre>
  
==== Useful addons include: ====
+
== 有用的附加软件 ==
 
+
* [http://www.tug.org/tex-archive/help/Catalogue/entries/mhchem.html mhchem] ,  
* [http://www.tug.org/tex-archive/help/Catalogue/entries/mhchem.html mhchem] chemical names, chemical reactions etc.
+
化学符号,化学反应式等。
 
* [http://www.tug.org/tex-archive/help/Catalogue/entries/isotope.html isotope]
 
* [http://www.tug.org/tex-archive/help/Catalogue/entries/isotope.html isotope]
  
=== Resources ===
+
= 资源 =
 +
* [http://www.tug.org/interest.html TeX Users Group TeX 用户组] Lots of links 大量的链接
 +
* [http://www.latex-project.org/guides/ Latex Documentation Latex 文档]
 +
* [http://tug.org/TeXnik/mainFAQ.cgi?file=index A-Z TeX FAQs 列表]
  
* [http://www.tug.org/interest.html TeX Users Group] Lots of links
 
* [http://www.latex-project.org/guides/ Latex Documentation]
 
* [http://tug.org/TeXnik/mainFAQ.cgi?file=index 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 [http://xdvi.sourceforge.net/inverse-search.html]
+
* 在 dvi-viewer 中点击鼠标可以打开编辑器并且打开到相应的 (La)TeX 源码处(同时也叫做'逆向搜索')
==== Emacs and xdvi ====
+
        * Ctrl+鼠标左键是 xdvi 的默认按键
 +
        * 中键是 kdvi 的默认按键
 +
* dvi-viewer 能够根据相关的 (La)TeX 源码的特定的行跳转到(而且会高亮显示) DVI 文件的相应位置(正向搜索)。
  
==== Reverse search ====
+
* 更多资料请看 [http://xdvi.sourceforge.net/inverse-search.html]
  
===== Instructions to set up reverse search with emacs and xdvi =====
+
== 设置 emacs xdvi 的反向搜索 ==
  
** Add the following line to the file <code><nowiki>.emacs</nowiki></code> in your home directory <pre><nowiki>
+
* 将下面的行加入到您的家目录中的 <code><nowiki>.emacs</nowiki></code> 文件中。
 +
<pre><nowiki>
 
(server-start)
 
(server-start)
 
</nowiki></pre>
 
</nowiki></pre>
** Add the following line to <code><nowiki>.Xresources</nowiki></code> <pre><nowiki>
+
 
 +
* 将下面的一行加入到您的家目录中的 <code><nowiki>.Xresources</nowiki></code> 文件中。
 +
<pre><nowiki>
 
xdvi.editor: emacsclient --no-wait +%l %f
 
xdvi.editor: emacsclient --no-wait +%l %f
 
</nowiki></pre>
 
</nowiki></pre>
** and run <pre><nowiki>
+
 
 +
* 运行
 +
<pre><nowiki>
 
xrdb .Xresources
 
xrdb .Xresources
 
</nowiki></pre>
 
</nowiki></pre>
** Download and install the latex package [http://www.ctan.org/tex-archive/help/Catalogue/entries/srcltx.html srcltx]
 
  
** You need to compile your latex file with the srcltx package. Put the line <pre><nowiki>
+
* 下载并且安装下面的 latex 宏包[http://www.ctan.org/tex-archive/help/Catalogue/entries/srcltx.html srcltx]
\usepackage[active]{srcltx}
+
</nowiki></pre>in your latex files for this to work
+
  
==== Kile and kdvi ====
+
* 您需要使用 srcltx 软件包来编译您的 latex 文件。将下面的一行
  
** You need to compile your latex file with the srcltx package. Put the line <pre><nowiki>
+
<pre><nowiki>
 
\usepackage[active]{srcltx}
 
\usepackage[active]{srcltx}
</nowiki></pre>in your latex files and forward and reverse search should work.
+
</nowiki></pre>
  
 +
加入到您的 latex 文件中以使用 srcltx 的功能。
 +
 +
== Kile 和 kdvi ==
 +
 +
* 您需要使用 srcltx 宏包来编译 latex 文件。将下面一行
 +
<pre><nowiki>
 +
\usepackage[active]{srcltx}
 +
</nowiki></pre>
 +
写入到您的 latex 文件中,正向与反向搜索应该就可以正常工作了。
  
 +
== 译者注 ==
 +
tetex是一个比较老的tex,已经停止开发了。
  
 +
texlive是较好的选择,可是源中的texlive需要自己配置中文,这一点对新手来说难度很大。
 +
http://bbs.ctex.org 一般都有配置好的texlive可以下载,望大家注意。
 
----
 
----
 
[[category:CategoryDocumentation]] [[category:CategoryArchive]] [[category:CategoryScience]]
 
[[category:CategoryDocumentation]] [[category:CategoryArchive]] [[category:CategoryScience]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2012年10月15日 (一) 08:55的最新版本


LaTeX 是一种文档描述语言。如果您曾使用过 HTML,或曾经编辑过 wiki 那么您对文本中使用符号或命令来描述文档结构的方法很熟悉。 LaTeX 普遍使用在科学出版界。它帮助您制作非常漂亮的论文,还有非常好看的数学公式。它也能帮助您跟踪记录图片和公式的编号。LaTeX 源文件能够被转换成非常多的格式比如 PDF, PostScript, DVI, 和 HTML。

一个 LaTeX 源文件是一个包含文本和标记命令的 ASCII 文件。它能够在文本编辑器如 Gedit 和 Vim 中编辑。他被 LaTeX 编译器转换成特定的输出格式。有人喜欢在一个更加集成的环境中书写 LaTeX 文件,使用菜单和按钮来生成格式控制命令。有非常多的宏包为 LaTeX 增加新的功能。

安装

就像 Linux, LaTeX 也包含了非常多的相互依赖的工具和文件。一般来说,您会使用一个 LaTeX 的发行版,而不是寻找和安装所有的这些文件,在 Ubuntu 的软件仓库中的发行版是:

  • Tetex
  • Texlive

Tetex 是一个常用的适用于 Linux 的 LaTeX 的发行版。它在 Ubuntu 的 main 软件仓库中,可以使用新利得或 apt-get 来安装。至少您要安装下列软件包:

tetex-info tetex-common

您可能也需要一些附加包:

tetex-extra

另一个您可以安装的 LaTeX 的发行版是 texlive。Texlive 是一个比 tetex 更加丰富的LaTeX 套件的选择,同时也需要更大的空间。同时它也是 Ubuntu 新加入的特性,所以您可能的遇到一些问题。从 6.10 开始它就可以使用在 Ubuntu 上并处于 universe 的软件仓库中。

安装 texlive 您需要安装软件包

texlive

附加软件包

可以使用附加软件包来扩展 LaTeX 的功能。


软件仓库

除了 tetex-extra 之外仓库中还有很多软件包包含有 LaTeX 的附加软件。您可以查看以下页面来看看究竟有哪些软件

breezy 的软件包,tex 章节. dapper 的软件包,tex 章节. edgy 的软件包,tex 章节. feisty 的软件包,tex 章节.

其他的附加软件

还有非常多不在软件仓库中的附加软件。

下面有一个非常丰富的列表。

在线 TeX 目录 或者 全面的 TeX 软件包网络. 通常下载回来的软件包是 tar.gz 或者 zip 格式的。安装它们您需要把它们解压并拷贝到 /usr/local/share/texmf/tex/latex 中,然后您需要运行 texhash 命令来更新数据库。

如果您下载了一个软件包 mhchem.zip 到您的家目录,那么执行下面的步骤应该能够起作用:

cd /usr/local/share/texmf/tex/latex
sudo unzip ~/mhchem.zip
sudo texhash

本地安装

您也可以把类型或类文件安装在您的家目录中。如果您没有 root 权限的话,这样做显得尤其有用。 TEXINPUTS 控制 LaTeX 在什么地方寻找本地的文件。

假定您想把它们放在你的家目录的一个叫做 mylatex 的子目录下面,只要按照如下设置 TEXINPUTS  :

 
export TEXINPUTS= ~/mylatex/:

现在您可以把文件解压到 ~/mylatex , LaTeX 能够知道到什么地方去寻找它们。

要把这个设置成 TEXINPUTS 的默认值需要将上面的一样加入到 .bashrc 或者在终端中输入:

cd
echo "export TEXINPUTS= ~/mylatex:" >>  .bashrc

有用的附加软件

化学符号,化学反应式等。

资源


反向搜索

反向搜索的意思是

  • 在 dvi-viewer 中点击鼠标可以打开编辑器并且打开到相应的 (La)TeX 源码处(同时也叫做'逆向搜索')
        * Ctrl+鼠标左键是 xdvi 的默认按键
        * 中键是 kdvi 的默认按键
  • dvi-viewer 能够根据相关的 (La)TeX 源码的特定的行跳转到(而且会高亮显示) DVI 文件的相应位置(正向搜索)。
  • 更多资料请看 [1]

设置 emacs 和 xdvi 的反向搜索

  • 将下面的行加入到您的家目录中的 .emacs 文件中。
(server-start)
  • 将下面的一行加入到您的家目录中的 .Xresources 文件中。
xdvi.editor: emacsclient --no-wait +%l %f
  • 运行
xrdb .Xresources
  • 下载并且安装下面的 latex 宏包srcltx
  • 您需要使用 srcltx 软件包来编译您的 latex 文件。将下面的一行
\usepackage[active]{srcltx}

加入到您的 latex 文件中以使用 srcltx 的功能。

Kile 和 kdvi

  • 您需要使用 srcltx 宏包来编译 latex 文件。将下面一行
\usepackage[active]{srcltx}

写入到您的 latex 文件中,正向与反向搜索应该就可以正常工作了。

译者注

tetex是一个比较老的tex,已经停止开发了。

texlive是较好的选择,可是源中的texlive需要自己配置中文,这一点对新手来说难度很大。 http://bbs.ctex.org 一般都有配置好的texlive可以下载,望大家注意。