特殊:Badtitle/NS100:LaTeX:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/LaTeX}} | {{From|https://help.ubuntu.com/community/LaTeX}} | ||
{{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. | [[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. [[UbuntuHelp:LaTeX|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. [[UbuntuHelp:LaTeX|LaTeX]] files can be converted into a huge number of formats such as PDF, PostScript, DVI, and 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. | A [[UbuntuHelp:LaTeX|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 [[UbuntuHelp:LaTeX|LaTeX]] compiler. Some people like to write [[UbuntuHelp:LaTeX|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 [[UbuntuHelp:LaTeX|LaTeX]]. | ||
=== Installing === | === Installing === | ||
Like Linux, LaTeX is a collection of many interdependent tools and files. Rather than find and install them all you use a LaTeX distribution. LaTeX distributions in the Ubuntu repositories are | Like Linux, [[UbuntuHelp:LaTeX|LaTeX]] is a collection of many interdependent tools and files. Rather than find and install them all you use a [[UbuntuHelp:LaTeX|LaTeX]] distribution. [[UbuntuHelp:LaTeX|LaTeX]] distributions in the Ubuntu repositories are | ||
* 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 is a common [[UbuntuHelp:LaTeX|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 | ||
<pre><nowiki> | <pre><nowiki> | ||
tetex-base tetex-bin | tetex-base tetex-bin | ||
第15行: | 第15行: | ||
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. | Another [[UbuntuHelp:LaTeX|LaTeX]] distribution you can install is TeXlive. TeXlive has a more comprehensive selection of [[UbuntuHelp:LaTeX|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 | To install TeXlive install the package | ||
<pre><nowiki> | <pre><nowiki> | ||
第21行: | 第21行: | ||
</nowiki></pre> | </nowiki></pre> | ||
=== Add on packages === | === Add on packages === | ||
LaTeX can be extended using add on packages. | [[UbuntuHelp:LaTeX|LaTeX]] can be extended using add on packages. | ||
==== Repositories ==== | ==== Repositories ==== | ||
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 | 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 | ||
第35行: | 第35行: | ||
</nowiki></pre> | </nowiki></pre> | ||
==== Local Installation ==== | ==== 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. | 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 [[UbuntuHelp:LaTeX|LaTeX]] looks for local files. | ||
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: | 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: | ||
<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. | Now you can put files in <code><nowiki> ~/mylatex </nowiki></code> and [[UbuntuHelp:LaTeX|LaTeX]] will know where to find them. | ||
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 | 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> | ||
第51行: | 第51行: | ||
=== Resources === | === Resources === | ||
* [http://www.tug.org/interest.html TeX Users Group] Lots of links | * [http://www.tug.org/interest.html TeX Users Group] Lots of links | ||
* [http://www.latex-project.org/guides/ LaTeX Documentation] | * [http://www.latex-project.org/guides/ [[UbuntuHelp:LaTeX|LaTeX]] Documentation] | ||
* [http://tug.org/TeXnik/mainFAQ.cgi?file=index A-Z list of TeX FAQs] | * [http://tug.org/TeXnik/mainFAQ.cgi?file=index A-Z list of TeX FAQs] | ||
=== Inverse Search === | === Inverse Search === | ||
第75行: | 第75行: | ||
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] | * Download and install the [[UbuntuHelp:LaTeX|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 | * You need to compile your [[UbuntuHelp:LaTeX|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 for this to work | </nowiki></pre>in your [[UbuntuHelp:LaTeX|LaTeX]] files for this to work | ||
==== Kile and kdvi ==== | ==== Kile and kdvi ==== | ||
* You need to compile your LaTeX file with the srcltx package. Put the line | * You need to compile your [[UbuntuHelp:LaTeX|LaTeX]] file with the srcltx package. Put the line | ||
<pre><nowiki> | <pre><nowiki> | ||
\usepackage[active]{srcltx} | \usepackage[active]{srcltx} |
2007年12月4日 (二) 10:49的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/LaTeX }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/af | • {{#if: UbuntuHelp:LaTeX|Afrikaans| [[::LaTeX/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/ar | • {{#if: UbuntuHelp:LaTeX|العربية| [[::LaTeX/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/az | • {{#if: UbuntuHelp:LaTeX|azərbaycanca| [[::LaTeX/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/bcc | • {{#if: UbuntuHelp:LaTeX|جهلسری بلوچی| [[::LaTeX/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/bg | • {{#if: UbuntuHelp:LaTeX|български| [[::LaTeX/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/br | • {{#if: UbuntuHelp:LaTeX|brezhoneg| [[::LaTeX/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/ca | • {{#if: UbuntuHelp:LaTeX|català| [[::LaTeX/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/cs | • {{#if: UbuntuHelp:LaTeX|čeština| [[::LaTeX/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/de | • {{#if: UbuntuHelp:LaTeX|Deutsch| [[::LaTeX/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/el | • {{#if: UbuntuHelp:LaTeX|Ελληνικά| [[::LaTeX/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/es | • {{#if: UbuntuHelp:LaTeX|español| [[::LaTeX/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/fa | • {{#if: UbuntuHelp:LaTeX|فارسی| [[::LaTeX/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/fi | • {{#if: UbuntuHelp:LaTeX|suomi| [[::LaTeX/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/fr | • {{#if: UbuntuHelp:LaTeX|français| [[::LaTeX/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/gu | • {{#if: UbuntuHelp:LaTeX|ગુજરાતી| [[::LaTeX/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/he | • {{#if: UbuntuHelp:LaTeX|עברית| [[::LaTeX/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/hu | • {{#if: UbuntuHelp:LaTeX|magyar| [[::LaTeX/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/id | • {{#if: UbuntuHelp:LaTeX|Bahasa Indonesia| [[::LaTeX/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/it | • {{#if: UbuntuHelp:LaTeX|italiano| [[::LaTeX/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/ja | • {{#if: UbuntuHelp:LaTeX|日本語| [[::LaTeX/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/ko | • {{#if: UbuntuHelp:LaTeX|한국어| [[::LaTeX/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/ksh | • {{#if: UbuntuHelp:LaTeX|Ripoarisch| [[::LaTeX/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/mr | • {{#if: UbuntuHelp:LaTeX|मराठी| [[::LaTeX/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/ms | • {{#if: UbuntuHelp:LaTeX|Bahasa Melayu| [[::LaTeX/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/nl | • {{#if: UbuntuHelp:LaTeX|Nederlands| [[::LaTeX/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/no | • {{#if: UbuntuHelp:LaTeX|norsk| [[::LaTeX/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/oc | • {{#if: UbuntuHelp:LaTeX|occitan| [[::LaTeX/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/pl | • {{#if: UbuntuHelp:LaTeX|polski| [[::LaTeX/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/pt | • {{#if: UbuntuHelp:LaTeX|português| [[::LaTeX/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/ro | • {{#if: UbuntuHelp:LaTeX|română| [[::LaTeX/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/ru | • {{#if: UbuntuHelp:LaTeX|русский| [[::LaTeX/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/si | • {{#if: UbuntuHelp:LaTeX|සිංහල| [[::LaTeX/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/sq | • {{#if: UbuntuHelp:LaTeX|shqip| [[::LaTeX/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/sr | • {{#if: UbuntuHelp:LaTeX|српски / srpski| [[::LaTeX/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/sv | • {{#if: UbuntuHelp:LaTeX|svenska| [[::LaTeX/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/th | • {{#if: UbuntuHelp:LaTeX|ไทย| [[::LaTeX/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/tr | • {{#if: UbuntuHelp:LaTeX|Türkçe| [[::LaTeX/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/vi | • {{#if: UbuntuHelp:LaTeX|Tiếng Việt| [[::LaTeX/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/yue | • {{#if: UbuntuHelp:LaTeX|粵語| [[::LaTeX/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/zh | • {{#if: UbuntuHelp:LaTeX|中文| [[::LaTeX/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/zh-hans | • {{#if: UbuntuHelp:LaTeX|中文(简体)| [[::LaTeX/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:LaTeX | UbuntuHelp:LaTeX | {{#if: | :}}LaTeX}}/zh-hant | • {{#if: UbuntuHelp:LaTeX|中文(繁體)| [[::LaTeX/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:LaTeX|:LaTeX|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :LaTeX/zh | | {{#ifexist: LaTeX/zh | | {{#ifeq: {{#titleparts:LaTeX|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:LaTeX|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. 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.
Installing
Like Linux, LaTeX is a collection of many interdependent tools and files. Rather than find and install them all you use a LaTeX distribution. LaTeX distributions in the Ubuntu repositories are
- 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
- Ctrl-Left Click is the default for xdvi
- 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
(server-start)
- Add the following line to
.Xresources
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.