我是使用 Linux 系统的新手。
我被分配了使用 LaTeX 编写文档并将文件转换为 pdf 文件以提交的作业。所以我尝试使用我的 CentOS 来做到这一点。我的Linux系统版本是RedHat。我在网上查找了将 .tex 文件转换为 .pdf 的方法,它告诉我要安装 texlive。所以我这样做了。
[csi2102@localhost]$ yum install -y texlive
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
* base: data.nicehosting.co.kr
* extras: data.nicehosting.co.kr
* updates: data.nicehosting.co.kr
Setting up Install Process
Package texlive-2007-57.e.16_2.i686 already installed and latest version
Nothing to do
Run Code Online (Sandbox Code Playgroud)
因此,我寻找解决此问题的方法以及建议使用rpm -qa | grep tex
命令的网站之一。但我无处可找到 pdflatex 文件。
[csi2102@localhost]$ rpm -qa | grep tex
texlive-texmf-errata-dvips-2007.7.1.e16.noarch
texlive-2007.57.e16_2.i686
texlive-texmf-errata-fonts-2007.7.1e16.noarch
texlive-texmf-2007-38.e16.noarch
texlive-texmf-fonts-2007-38.e16.noarch
texlive-texmf-errata-2007-7.1.e16.noarch
texlive-texmf-dvips-2007-38.e16.noarch
[csi2102@localhost]$
Run Code Online (Sandbox Code Playgroud)
这是我输入命令时看到的。
当我尝试使用 pdflatex、latex 或 pdftex 命令时,这就是我得到的。
[csi2102@localhost]$ latex homework
bash: latex: command not found
[csi2102@localhost]$ pdflatex homework
bash: pdflatex: command not found
[csi2102@localhost]$ pdftex homework
This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
%&-line parsing enabled.
entering extended mode
(./homework1.tex
!Undefined control sequence.
1.7 \documentclass
[pdftex,11pt] {article}
?
Run Code Online (Sandbox Code Playgroud)
我不明白为什么我的系统不会像其他人所说的那样识别。
PS 哦,以防万一,我想附上我的 .tex 文件,想知道我在文件中写的内容是否造成了问题。
\documentclass[pdftex,11pt] {article}
\usepackage[utf8] {inputenc}
\usepackage{geometry}
\gemoetry{a4paper}
\usepackage[dvips]{graphicx}
\usepackage{pslatex}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\lhead{}\chead{}\rhead{Introduction to Engineering Design}
\lfoot{}\cfoot{\thepage}\rfoot{}
\usepacakge{sectsty}
\allsectionsfont{\sffamily\mdseries\upshape}
\title{What is \LaTex ?}
\author{2013147549 Geun Ho Lee}
\date{}
\begin{document}
\maketitle
LaTex is a document preparation system that is most often used for medium-to-large technical or scientific documents. It is not, however, a word processor. It is based on the idea that it would be more efficient for the authors to write their documents and let the document designers to worry about the document design. LaTex consists of several features ranging from typesetting journal articles, technical reports, books, and slide presentations to automatically generating bibliographies and indexes.
LaTex is based on the TeX typesetting language or certain extensions of it. LaTex was first developed in 1985 by Leslie Lamport and is now maintained and developed by the LaTex3 Project.
(source: http://latex-project.org/intro.html)
\end{document}
Run Code Online (Sandbox Code Playgroud)
gol*_*cks 16
你缺少一些东西。这是在 Fedora 上,但在 CentOS 上应该保持相同的模式:
> yum whatprovides latex
Loaded plugins: auto-update-debuginfo, langpacks, presto, refresh-packagekit, verify
texlive-latex-2007-70.fc17.x86_64 : The LaTeX front end for the TeX text formatting system
Repo : fedora
Matched from:
Filename : /usr/bin/latex
Run Code Online (Sandbox Code Playgroud)
我texlive-latex
在你的列表中没有看到任何地方。提到了相同的包yum whatprovides pdflatex
,所以......
> yum install texlive-latex
Run Code Online (Sandbox Code Playgroud)
以下是一些解决方案:
乳胶在您的第一行显示错误:
\documentclass[pdftex,11pt]{article}
Run Code Online (Sandbox Code Playgroud)
你确定这pdftex
是一个有效的选择吗?通常这些选项与纸张尺寸和布局有关。尝试删除它。
我不知道两者之间的区别pdflatex
,pdftex
但根据我的经验,pdflatex
它更常用。尝试yum whatprovides \*pdflatex
查看哪个包提供了该二进制文件(提示:它是texlive-latex
)并安装它。然后,尝试运行你的论文pdflatex
。
如果运行后仍然出现Latex错误pdflatex homework.tex
,请前往tex.stackexchange.com寻求与Latex相关的帮助。
归档时间: |
|
查看次数: |
28935 次 |
最近记录: |