我正在使用基于 Debian 的操作系统,并且安装了最新版本的 TeXlive:
alex@Sargon:~$ latex -v
pdfTeX 3.14159265-2.6-1.40.19 (TeX Live 2018)
kpathsea version 6.3.0
Copyright 2018 Han The Thanh (pdfTeX) et al.
There is NO warranty. Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.34; using libpng 1.6.34
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.00
我花了一段时间让终端从 2018 的文件夹中获取 LaTeX 的命令。现在这是我启动终端时默认加载的 $PATH 变量:
alex@Sargon:~$ echo $PATH
/usr/local/texlive/2018/bin/x86_64-linux:/home/alex/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
如果我从终端导出文档,它会完美运行。它使用 TeXLive 所有软件包的最新版本。
alex@Sargon:~/MEGAsync/gnogna$ pdflatex gnogna.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./gnogna.tex
LaTeX2e <2018-04-01> patch level 5
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/book.cls
Document Class: book 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/bk10.clo))
(/usr/local/texlive/2018/texmf-dist/tex/generic/babel/babel.sty
(/usr/local/texlive/2018/texmf-dist/tex/generic/babel/switch.def)
(/usr/local/texlive/2018/texmf-dist/tex/generic/babel-italian/italian.ldf
(/usr/local/texlive/2018/texmf-dist/tex/generic/babel/babel.def
(/usr/local/texlive/2018/texmf-dist/tex/generic/babel/txtbabel.def))))
(/usr/local/texlive/2018/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/inputenc.sty)
(/usr/local/texlive/2018/texmf-dist/tex/generic/ulem/ulem.sty)
(/usr/local/texlive/2018/texmf-dist/tex/latex/url/url.sty)
(/usr/local/texlive/2018/texmf-dist/tex/latex/eurosym/eurosym.sty)
(/usr/local/texlive/2018/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty)
(/usr/local/texlive/2018/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2018/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2018/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2018/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2018/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/local/texlive/2018/texmf-dist/tex/latex/graphics-def/pdftex.def)))
(/usr/local/texlive/2018/texmf-dist/tex/latex/wrapfig/wrapfig.sty)
(/usr/local/texlive/2018/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/local/texlive/2018/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/local/texlive/2018/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
(/usr/local/texlive/2018/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
(/usr/local/texlive/2018/texmf-dist/tex/latex/tocloft/tocloft.sty)
(./gnogna.aux)
[...]
Output written on gnogna.pdf (107 pages, 2501192 bytes).
Transcript written on gnogna.log.
但是,如果我从 TeXStudio 导出相同的文档,日志会显示与某些包相关的错误。
Package babel Error: Unknown option `italian'. Either you misspelled itd. \ProcessOptions*
Package babel Error: You haven't specified a language option. ...ry to proceed from here, type x to quit.}
File `eurosym.sty' not found. \usepackage
发生这种情况是因为 TeXstudio 奇怪地尝试使用与其一起安装的旧版本的 TeXlive。事实上,如果我继续Help --> check LaTeX installation
,输出是这样的:
which pdflatex: /usr/bin/pdflatex
PDFLATEX: pdflatex -version
pdfTeX 3.14159265-2.6-1.40.17 (TeX Live 2016/Debian)
kpathsea version 6.2.2
Copyright 2016 Han The Thanh (pdfTeX) et al.
There is NO warranty. Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.28; using libpng 1.6.28
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with poppler version 0.48.0
Environment variables:
DISPLAY=:0
DESKTOP_SESSION=/etc/alternatives/x-session-manager
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
SSH_AUTH_SOCK=/tmp/ssh-cNcLxJOj0sIm/agent.15897
HOME=/home/alex
XDG_SESSION_COOKIE=cafc501f3b2c4e64bbd5ed2d878ff3ef-1540731184.754442-1971382251
QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
XDG_SEAT=seat0
USER=alex
LOGNAME=alex
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
PWD=/home/alex
INVOCATION_ID=68a91321ce974e7a844df05ad0754f2f
JOURNAL_STREAM=8:18516
XAUTHORITY=/home/alex/.Xauthority
XDG_SESSION_ID=8
LANG=it_IT.UTF-8
XDG_VTNR=7
PATH=/home/alex/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
SHELL=/bin/bash
QT_ACCESSIBILITY=1
SSH_AGENT_PID=15950
XDG_RUNTIME_DIR=/run/user/1000
SHLVL=0
TeXstudio:
Path : /usr/bin/texstudio
Program call: texstudio
Setting file: /home/alex/.config/texstudio/texstudio.ini
Command configuration in TeXstudio:
PdfLaTeX (pdflatex) (r): pdflatex -synctex=1 -interaction=nonstopmode %.tex
Default Viewer (view): txs:///view-pdf
Makeglossaries (makeglossaries): makeglossaries %
Recompile Bibliography (recompile-bibliography): txs:///compile | txs:///bibliography | txs:///compile
Ps2Pdf (ps2pdf): ps2pdf %.ps
Latexmk (latexmk): latexmk -pdf -silent -synctex=1 %
PDF Chain (pdf-chain): txs:///pdflatex | txs:///view-pdf
PS Chain (ps-chain): txs:///latex | txs:///dvips | txs:///view-ps
Build & View (quick): txs:///compile | txs:///view
Metapost (metapost): mpost -interaction=nonstopmode ?me)
Default Index Tool (index): txs:///makeindex
Biber (biber): biber %
Makeindex (makeindex): makeindex %.idx
Asymptote PDF Chain (asy-pdf-chain): txs:///pdflatex | txs:///asy | txs:///pdflatex | txs:///view-pdf
SVNADMIN (svnadmin): svnadmin
Ghostscript (gs): gs "?am.ps"
PDF Viewer (view-pdf): txs:///view-pdf-internal --embedded
DviPdf (dvipdf): dvipdf %.dvi
PS Viewer (view-ps): xdg-open %.ps > /dev/null
Default Compiler (compile) (r): txs:///pdflatex
BibTeX 8-Bit (bibtex8): bibtex8 %.aux
DVI->PS->PDF Chain (dvi-ps-pdf-chain): txs:///latex | txs:///dvips | txs:///ps2pdf | txs:///view-pdf
Internal Precompile (internal-pre-compile): txs:///pre-compile | txs:///conditionally-recompile-bibliography
LuaLaTeX (lualatex) (r): lualatex -synctex=1 -interaction=nonstopmode %.tex
DVI Viewer (view-dvi): xdg-open %.dvi > /dev/null
Asymptote DVI Chain (asy-dvi-chain): txs:///latex | txs:///asy | txs:///latex | txs:///view-dvi
XeLaTeX (xelatex) (r): xelatex -synctex=1 -interaction=nonstopmode %.tex
Asymptote (asy): asy ?m*.asy
SVN (svn): svn
Default Glossary Tool (glossary): txs:///makeglossaries
DviPs (dvips): dvips -o %.ps %.dvi
DviPng (dvipng): dvipng -T tight -D 120 %.dvi
BibTeX (bibtex): bibtex %.aux
Texindy (texindy): texindy %.idx
LaTeX (latex) (r): latex -src -interaction=nonstopmode %.tex
External PDF Viewer (view-pdf-external): xdg-open %.pdf > /dev/null
Default Bibliography Tool (bibliography): txs:///bibtex
Precompile (pre-compile):
DVI Chain (dvi-chain): txs:///latex | txs:///view-dvi
DVI->PDF Chain (dvi-pdf-chain): txs:///latex | txs:///dvipdf | txs:///view-pdf
Additional Search Paths:
Command:
Log:
Pdf:
对我来说最奇怪的是那一PATH=/home/alex/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
行。当然,它与它应该有的不同:它缺少那/usr/local/texlive/2018/bin/x86_64-linux
部分,我相信,如果它有它,它将允许它加载正确版本的 PdFLatex
如果我进入配置,在“编译”下我可以找到“配置($PATH)”,并且我尝试/usr/local/texlive/2018/bin/x86_64-linux
以多种方式插入正确的路径,但没有任何变化。
您对我应该怎么做有什么想法吗?
答案1
当手动将内容添加到路径时,请记住也添加附加项.profile
(记得注销并再次登录)。通常,如果您从菜单启动程序,则永远不会看到您添加到 shell 的内容