Lak*_*sad 184 linux latex typesetting tex
对于今天的is-latex-worth-learning以及Windows上的许多操作方法印象深刻,
你是如何在Linux上开始使用LaTeX的?
如何从中生成pdf并放弃OOO Word处理器?
更新:
感谢这里给出的所有建议.我能够使用Beamer类创建一个很棒的ppt:http://github.com/becomingGuru/gids-django-ppt.我发现这种方法比使用powerpoint等要好得多.
Dav*_*ner 280
首先,您需要安装它:
如果您正在使用包装LaTeX的发行版(几乎所有人都会这样做),那么请寻找texlive或tetex.TeX Live是两者中最新的,现在正在大多数发行版上取代tetex.
如果您使用的是Debian或Ubuntu,请执行以下操作:
apt-get install texlive
..会安装它.
RedHat或CentOS需要:
yum install tetex
注意:这需要root权限,因此,如果您尚未以root用户身份登录,则可以使用su
将用户切换到root,或者使用前缀命令sudo
.
接下来,您需要获得文本编辑器.任何编辑都会这样做,所以不管你感到满意.您会发现像Emacs(和vim)这样的高级编辑器添加了许多功能,因此在您尝试构建文档输出之前,这将有助于确保您的语法正确.
创建一个名为test.tex的文件,并在其中放入一些内容,比如LaTeX入门中的示例:
\documentclass[a4paper,12pt]{article}
\begin{document}
The foundations of the rigorous study of \emph{analysis}
were laid in the nineteenth century, notably by the
mathematicians Cauchy and Weierstrass. Central to the
study of this subject are the formal definitions of
\emph{limits} and \emph{continuity}.
Let $D$ be a subset of $\bf R$ and let
$f \colon D \to \mathbf{R}$ be a real-valued function on
$D$. The function $f$ is said to be \emph{continuous} on
$D$ if, for all $\epsilon > 0$ and for all $x \in D$,
there exists some $\delta > 0$ (which may depend on $x$)
such that if $y \in D$ satisfies
\[ |y - x| < \delta \]
then
\[ |f(y) - f(x)| < \epsilon. \]
One may readily verify that if $f$ and $g$ are continuous
functions on $D$ then the functions $f+g$, $f-g$ and
$f.g$ are continuous. If in addition $g$ is everywhere
non-zero then $f/g$ is continuous.
\end{document}
Run Code Online (Sandbox Code Playgroud)
获得此文件后,您需要在其上运行latex以生成一些输出(作为.dvi文件开始,可以转换为许多其他格式):
latex test.tex
Run Code Online (Sandbox Code Playgroud)
这将打印一堆输出,如下所示:
=> latex test.tex
This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
entering extended mode
(./test.tex
LaTeX2e <2003/12/01>
Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b
ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e
stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis
h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur
kish, ukrainian, nohyphenation, loaded.
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size12.clo))
No file test.aux.
[1] (./test.aux) )
Output written on test.dvi (1 page, 1508 bytes).
Transcript written on test.log.
Run Code Online (Sandbox Code Playgroud)
..不要担心大部分输出 - 重要的部分是在test.dvi行上写的输出,它表示它是成功的.
现在您需要使用xdvi 查看输出文件:
xdvi test.dvi &
Run Code Online (Sandbox Code Playgroud)
这将弹出一个窗口,其中包含格式精美的输出.点击"q"退出,或者你可以打开它,它会在修改test.dvi文件时自动更新(所以每当你运行latex来更新输出时).
要生成PDF,您只需运行pdflatex而不是latex:
pdflatex test.tex
Run Code Online (Sandbox Code Playgroud)
..并且您将创建一个test.pdf文件而不是test.dvi文件.
在这一切工作正常之后,我建议您去LaTeX入门页面并浏览那里的项目,因为您需要要编写的文档的功能.
未来需要考虑的事项包括:
使用xfig或dia等工具创建图表.这些可以以各种格式轻松插入到您的文档中.请注意,如果您要创建PDF,则不应使用EPS(封装的postscript)作为图像 - 如果可能,请使用从图表编辑器导出的pdf,或者您可以使用该epstopdf
程序包自动从(e)ps转换为pdf以获取数字包括在内\includegraphics
.
开始在文档上使用版本控制.这看起来似乎过分了,但是当你写一些大的东西时能够回头看看早期的版本可能非常有用.
使用make为您运行乳胶.当您开始使用参考书目,图像和其他更复杂的乳胶用途时,您会发现需要在多个文件上或多次运行它(第一次更新引用,第二次将引用放入文档中,因此它们可以是过时的,除非你运行乳胶两次......).将其抽象为makefile可以节省大量的时间和精力.
使用更好的编辑器.像Emacs + AUCTeX这样的东西非常称职.这当然是一个非常主观的主题,所以我会把它留在那(那个Emacs显然是最好的选择:)
las*_*ock 39
要在Linux上开始使用LaTeX,您需要安装几个软件包:
您将需要LaTeX发行版.这是包含(La)TeX计算机排版系统的程序集合.Unix系统上的标准LaTeX发行版曾经是teTeX,但它已被TeX Live取代.大多数Linux发行版都有TeX Live的安装包 - 例如,请参阅Ubuntu和Fedora的包数据库条目.
您可能希望安装LaTeX编辑器.标准的Linux文本编辑器可以正常工作; 特别是,Emacs有一个很好的(La)TeX编辑宏包叫做AUCTeX.专业的LaTeX编辑器也存在; 其中,Kile(KDE Integrated LaTeX Environment)特别好看.
您可能需要一个LaTeX教程.经典教程是" A(不是那么)LaTeX2e简介 ",但现在LaTeX wikibook可能是更好的选择.