9

I have just downloaded texmaker to make a local copy of a tex file from overleaf but when I try to generate the pdf I get the following error

Latex Error: File 'algorithm.sty' not found.

My computer runs Ubuntu a fix online says to run the following command in the terminal

sudo apt-get install texlive-science

That hasn't worked either.

If anyone can help that would be much appreciated thank you

6
  • Welcome to TeX.SX! Probably there is just a typo. The quoted error message sais algorthim while, you propably wanted to use algorithm.
    – leandriis
    Commented Jun 18, 2020 at 19:17
  • @leandriis: Is this a typo contest? :o)
    – Bernard
    Commented Jun 18, 2020 at 19:19
  • 1
    You might want to install apt-file, then run sudo apt-file update and then apt-file search algorithm.sty, this will tell you exactly which Ubuntu deb package provides this file (if any)
    – daleif
    Commented Jun 18, 2020 at 19:20
  • @leandriis The output was this, I will be honest I have no idea what to do with it. 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
    – MP34
    Commented Jun 18, 2020 at 19:38
  • do not use the distro package manager; install texlive from tug.org/texlive/quickinstall.html Commented Jun 18, 2020 at 20:01

1 Answer 1

17

I was having the same issue and installing texlive-science package solved the issue:

sudo apt-get update -y

sudo apt-get install -y texlive-science

3
  • thank you, this works for me too.
    – arilwan
    Commented Apr 20, 2021 at 9:26
  • I have windows and I have the same problem. Texlive-science doesn't seem to exist for windows. How can I solve this problem?
    – Bruno
    Commented Dec 13, 2021 at 13:44
  • This certainly works, but on my machine, it indicates that upward of 100 MB will be used up in installing texlive-science It seems rather excessive. What is the point of everything else in texlive-science if you need only a few files from it(?) Is there a more parsimonious/cheaper way to install just the sty files that you need? See my question stackoverflow.com/questions/74216080/… as well.
    – Tryer
    Commented Oct 27, 2022 at 5:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .