首页 > 系统 > Linux > 正文

Ubuntu Install Latex

2020-06-07 13:34:03
字体:
来源:转载
供稿:网友
我的系统是Ubuntu7.04。

首先我们需要下载安装TeX.使用如下的命令: apt-get install tetex-base

当然如果你觉得你硬盘空间够多,还可以下tetex-extra,命令是:apt-get install tetex-extra

安装好以后,我们开始写我们第一个tex文件:

使用gvim foo.tex 新建一个.tex的文件(作为TeX的输入文件),在里面输入下面的文本:

/documentclass[a4paper,11pt]{article}
% define the title
/author{Wang E}
/title{This is a Test}
/begin{document}
% generates the title
/maketitle
% insert the table of content
/tableofcontents
/section{Hello,Earth!}
Hello,I'm WangE from Mars!/newline This document is generated by /LaTeX !
/section{Bye,Earth}
/ldots{} and here it ends.
/end{document}

输入上面文本以后,保存。

然后输入下面命令:
latex foo.tex
这将生成foo.dvi的设备无关文件。

然后输入下面命令:
xdvi foo.dvi &
这是使用xdvi工具对生成的dvi文件预览。

使用命令:
dvipdf foo.dvi
将生成pdf文件,这时就可以用
xpdf foo.pdf进行查看了。

其实更好的方法是直接写一个脚本程序,这样就免去了每次都要敲好几个命令的麻烦。
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表