[Tex/LaTex] Can’t get copied project to compile in Overleaf

overleaf

So I made a copy of a report template that was shared with me, and my copy will not compile, whereas the project I copied compiles just fine. This is the first error I get:

 /usr/local/texlive/2019/texmf-dist/tex/latex/subfigure/subfigure.sty, line 124
LaTeX Error: Command \c@lofdepth already defined.

Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.124 \newcounter{lofdepth}

Your command was ignored.
Type  I <command> <return>  to replace it with another command,
or  <return>  to continue without it.

I have no idea where the file the error is reading is even located so I'm rather confused.

Best Answer

(I'm on support staff at Overleaf.)

This can sometimes happen when copying an Overleaf project, because existing projects use the TeX Live version that was current when the project was created (to avoid the output changing when we update TeX Live on Overleaf). But new copies of projects will use a newer TeX Live version (to discourage use of outdated packages) if available.

This can lead to this behavior, if the packages you use in your document have changed between TeX Live versions. Previously support staff could adjust this, so users had to contact us to change it in their projects. We recently introduced a new feature where you can adjust this setting yourself in your projects if needed.

To do this, open the original working project, then click on the Overleaf menu in the upper left. Scroll down to the "TeX Live version" entry in the settings and note which version is in use for the working project.

enter image description here

Then you can open the new copy of the project and adjust the setting there to match the original project. More information about the feature is available here: https://www.overleaf.com/blog/new-feature-select-your-tex-live-compiler-version

Only make this change if your new project is not working or if you have special requirements to use a specific version of TeX Live. In general, it's better to move newer projects onto the newer version of TeX Live to benefit from the latest enhancements and bugfixes to packages in your documents.

Related Question