Those interested may checkout the TEX file, with many custom commands and the corresponding presentation.推荐答案首先,您需要安装它: 如果您使用的是发行版,其中包含打包LaTeX的发行版(几乎都可以使用),请查找 texlive 或 tetex . TeX Live是两者中的较新版本,并且现在在大多数发行版中都取代了tetex.If you're using a distro which packages LaTeX (almost all will do) then look for texlive or tetex. TeX Live is the newer of the two, and is replacing tetex on most distributions now.如果您使用的是Debian或Ubuntu,则类似:If you're using Debian or Ubuntu, something like: apt-get install texlive ..将安装它. RedHat或CentOS需要:RedHat or CentOS need: yum install tetex 注意:这需要root权限,因此,如果您尚未以root用户身份登录,请使用su将用户切换为root用户,或者使用sudo作为命令的前缀.Note : This needs root permissions, so either use su to switch user to root, or prefix the commands with sudo, if you aren't already logged in as the root user.接下来,您将需要一个文本编辑器.任何编辑器都可以做,因此无论您喜欢什么.您会发现Emacs(和vim)等高级编辑器添加了许多功能,因此在尝试构建文档输出之前,将有助于确保语法正确.Next you'll need to get a text editor. Any editor will do, so whatever you are comfortable with. You'll find that advanced editors like Emacs (and vim) add a lot of functionality and so will help with ensuring that your syntax is correct before you try and build your document output.创建一个名为test.tex的文件,并在其中放入一些内容,例如 LaTeX底漆:Create a file called test.tex and put some content in it, say the example from the LaTeX primer:\documentclass[a4paper,12pt]{article}\begin{document}The foundations of the rigorous study of \emph{analysis}were laid in the nineteenth century, notably by themathematicians Cauchy and Weierstrass. Central to thestudy 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 continuousfunctions on $D$ then the functions $f+g$, $f-g$ and$f.g$ are continuous. If in addition $g$ is everywherenon-zero then $f/g$ is continuous.\end{document}拥有此文件后,您需要在其上运行乳胶以产生一些输出(以.dvi文件开头,可以将其转换为许多其他格式) :Once you've got this file you'll need to run latex on it to produce some output (as a .dvi file to start with, which is possible to convert to many other formats):latex test.tex这将打印一堆输出,如下所示:This will print a bunch of output, something like this:=> latex test.texThis is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)entering extended mode(./test.texLaTeX2e &lt;2003/12/01&gt;Babel &lt;v3.8d&gt; and hyphenation patterns for american, french, german, ngerman, bahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, estonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polish, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, turkish, ukrainian, nohyphenation, loaded.(/usr/share/texmf/tex/latex/base/article.clsDocument 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. ..不用担心大部分输出-重要的部分是在test.dvi 行上写的输出,它表示成功...don't worry about most of this output -- the important part is the Output written on test.dvi line, which says that it was successful.现在,您需要使用xdvi 查看输出文件:Now you need to view the output file with xdvi:xdvi test.dvi &这将弹出一个窗口,其中包含格式精美的输出.按"q"退出,或者将其保持打开状态,并在修改test.dvi文件时自动更新(因此无论何时运行乳胶来更新输出).This will pop up a window with the beautifully formatted output in it. Hit `q' to quit this, or you can leave it open and it will automatically update when the test.dvi file is modified (so whenever you run latex to update the output). 要生成此PDF ,您只需运行 pdflatex 而不是乳胶:To produce a PDF of this you simply run pdflatex instead of latex:pdflatex test.tex ..您将创建一个test.pdf文件,而不是test.dvi文件...and you'll have a test.pdf file created instead of the test.dvi file.一切正常之后,建议您使用 LaTeX底漆页面,并在页面上遍历所有项目,因为您需要要编写的文档的功能.After this is all working fine, I would suggest going to the the LaTeX primer page and running through the items on there as you need features for documents you want to write.未来要考虑的事情包括:Future things to consider include: 使用诸如 xfig 或 dia 之类的工具来创建图表.这些可以很容易地以各种格式插入到您的文档中.请注意,如果要创建PDF,则不应使用EPS(封装的后记)作为图像-尽可能使用从图表编辑器导出的pdf,也可以使用epstopdf包自动将\includegraphics中包含的数字从(e)ps转换为pdf.Use tools such as xfig or dia to create diagrams. These can be easily inserted into your documents in a variety of formats. Note that if you are creating PDFs then you shouldn't use EPS (encapsulated postscript) for images -- use pdf exported from your diagram editor if possible, or you can use the epstopdf package to automatically convert from (e)ps to pdf for figures included with \includegraphics. 开始在文档上使用版本控制.乍一看似乎有点多余,但是当您编写大型文章时,能够回头查看较早的版本可能会非常有用.Start using version control on your documents. This seems excessive at first, but being able to go back and look at earlier versions when you are writing something large can be extremely useful. 使用 make 为您运行乳胶.当您开始使用书目,图像和其他更复杂的乳胶用法时,您会发现需要对多个文件或多次运行它(第一次是更新引用,第二次是将引用放入文档中,因此它们可能会过时,除非您两次运行乳胶...).将其抽象到makefile中可以节省大量时间和精力.Use make to run latex for you. When you start on having bibliographies, images and other more complex uses of latex you'll find that you need to run it over multiple files or multiple times (the first time updates the references, and the second puts references into the document, so they can be out-of-date unless you run latex twice...). Abstracting this into a makefile can save a lot of time and effort. 使用更好的编辑器.诸如Emacs + AUCTeX之类的功能非常强大.当然,这是一个非常主观的主题,所以我将留给它(那个和那个Emacs显然是最好的选择:)Use a better editor. Something like Emacs + AUCTeX is highly competent. This is of course a highly subjective subject, so I'll leave it at that (that and that Emacs is clearly the best option :) 这篇关于在Linux上开始使用Latex的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-23 00:33
查看更多