在使用时,我收到未找到的\usepackage{algorithm}
错误。algorithm.sty
目前,我解决这个问题的方法是首先通过以下方式搜索这个包:
$ apt-file search "algorithm.sty"
latexml: /usr/share/perl5/LaTeXML/Package/algorithm.sty.ltxml
texlive-lang-arabic: /usr/share/texlive/texmf-dist/tex/lualatex/simurgh/simurgh-algorithm.sty
texlive-science: /usr/share/texlive/texmf-dist/tex/latex/algorithms/algorithm.sty
Run Code Online (Sandbox Code Playgroud)
这告诉我texlive-science
包含algorithm.sty
. 然后我发出
sudo apt-get install texlive-science
这表明安装此软件包将占用大约 100 MB 的磁盘空间。(如果我继续安装texlive-science
占用 100 MB 磁盘空间的软件包,则该.tex
文件可以正常编译。)
我不清楚我是否需要使用 100 MB 的磁盘空间才能编译我的.tex
文件\usepackage{algorithm}
是否有一种更节省/更便宜的方法来仅安装丢失的.sty
文件,而不必安装它所属的整个包?
texlive
不幸的是,包并不总是以.sty
您要查找的文件命名。但是 apt-file 搜索可以帮助指向包名称。
在这种情况下,algorithms
(您可以在texlive-science
latex/
目录下看到)被识别。跑步tlmgr install algorithms
对我有用。