只需最低安装即可克服“algorithm.sty”未找到错误

Try*_*yer 0 linux latex tex

在使用时,我收到未找到的\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文件,而不必安装它所属的整个包?

Ora*_*ire 5

texlive不幸的是,包并不总是以.sty您要查找的文件命名。但是 apt-file 搜索可以帮助指向包名称。

在这种情况下,algorithms(您可以在texlive-science latex/目录下看到)被识别。跑步tlmgr install algorithms对我有用。