I have two questions about the error message described by the subject line.

My first question is why does Overleaf not have this error? And my second question is how do I solve this problem?

I was using Overleaf, but I wanted to change to software installed locally so I don't need internet or have to worry about Overleaf's compilation time limit.

I cannot provide all code here to recreate the problem, as it requires a bunch of other files to be recreated. Instead, here is a link to the template I used, which contains all of the files: https://www.overleaf.com/latex/templates/homework-solutions/xykkzgnbzmxp

I tried to include the code from packages.tex, but StackExchange couldn't detect the newlines and it all appeared as one line. But it is inside the Overleaf template.

I downloaded the project folder from my Overleaf account to my computer and tried compiling it in MiKTex/TeXworks (I installed MiKTex, but the software is called TeXworks after being installed). It gives the following error message:

Error Message

I have already done research into finding a solution. The following threads have the same error:

Command \algorithmic already defined For this one, the proposed solution is not apparent to me. I read it a few times, and could not find how they solved the problem/where the solution is described here.

algorithm2e Command \algorithm already defined For this one, the source of the problem is different, and I cannot figure out how to use their solution in my case. They are using a package called algorithm2e, but I am not using this package. I took a shot in the dark and tried changing "\usepackage{algpseudocode}" to "\usepackage[algo2e]{algpseudocode}", but nothing changed.

Can anyone help me? I would greatly appreciate any help!

  • if you add \listfiles and compare the list at the end of the log you will see which package versions are different Nov 10, 2022 at 20:34
  • you are using algorithm and algorithmx which is presumably the problem Nov 10, 2022 at 20:35
  • Please provide a Minimal Working Example so that people can test your code. Also, avoid screenshots and provide the log as text. Finally, Overleaf handles errors badly so make sure that it's not just ignoring errors.
    – Miyase
    Nov 10, 2022 at 20:35


You must log in to answer this question.

Browse other questions tagged .