My OS is win10 enterprise.

VS Code Output: ! LaTeX Error: File `algorithms.sty' not found.

I had set system environment path for me and all users, and found `algorithms.sty' in E:\texlive\2018\texmf-dist\tex\latex\algorithms

Also, I press update filename datebase in TexLive Manager-actions

I have tried many methods but it didn't worked, thank you for your time

TexLive Manager


% !TEX program = pdflatex
\section{A section}
  \caption{Euclid’s algorithm}\label{euclid}
    \Procedure{Euclid}{$a,b$}\Comment{The g.c.d. of a and b}
      \State $r\gets a\bmod b$
      \While{$r\not=0$}\Comment{We have the answer if r is 0}
        \State $a\gets b$
        \State $b\gets r$
        \State $r\gets a\bmod b$
      \State \textbf{return} $b$\Comment{The gcd is b}

\lipsum[1-15]% dummy text

i can compile that code as shown below

% !TEX program = pdflatex

\author{Dongsheng Deng}
\title{Configuration of Visual Studio Code for \LaTeX{} Users}


Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, \cite{GraffZivin2018} sunt in culpa qui officia deserunt mollit anim id est laborum.



  • 1
    Did you try compiling by command line? – user156344 Apr 7 at 2:29
  • @JouleV i just tried pdflatex test.tex, and it still output: ! LaTeX Error: File `algorithms.sty' not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: sty) – GuikunChen Apr 7 at 2:39
  • Then it is not a problem with your editor. You probably installed TeX Live in a wrong way. – user156344 Apr 7 at 2:41
  • On that tlmgr screen run the top 3 ACTIONS quit test and if necessary try the lower option update all installed then the top3 actions again – KJO Apr 7 at 2:42
  • 1
    @KJO Thank u very much! I just compiled successful by take the 's' off! VS Code Editor promote {algorithms} automatically when I write down '\usepackage{algo...}' and {algorithm} are not available in the options, but there are no package named algorithms, I think that this is the problem I have encountered. – GuikunChen Apr 7 at 4:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.