15

I would like to use my own classes and packages in all my projects and I wonder if it's possible to do that, working with Overleaf or ShareLatex.

Of course, I don't want to paste my personal .cls and .sty in each project.

Thanks for helping me

5
  • 5
    On Overleaf your custom .cls and .sty files still need to be in each project you want to use them with, either by uploading them to the project directly or by the "Add file from other project" function as a linked file. To make the process easier, you can first create a project that contains all your usual .cls and .sty files, and then use "Open a Copy" from your Overleaf dashboard to create clones from it. Each newly created project like this will then contains the custom .cls and .sty files.
    – imnothere
    Sep 18, 2016 at 15:00
  • It is a lot easier just to input a .tex file containing all your definitions in the preamble. Sep 18, 2016 at 15:14
  • Lim : do you know if some change in an original .cls will be effective in the cloned .cls ? John : this is not just that simple. I regularly create several types of documents (articles, books...) in differents sizes (a4, a5, a6) and different constraints, thus a single .tex is not the best choice.
    – damien
    Sep 18, 2016 at 19:33
  • @LianTzeLim Do you want to write up an answer?
    – Johannes_B
    Jul 30, 2017 at 9:09
  • Thanks @Johannes_B, added an answer with some links to help articles on OL.
    – imnothere
    Jul 31, 2017 at 7:15

1 Answer 1

10

On Overleaf, your custom .cls and .sty files still need to be in each project you want to use them with, either by uploading them to the project directly or by the "Add file from other project" function as a linked file.

Alternatively, you can first create a project that contains all your usual .cls and .sty files, and then use "Open a Copy" from your Overleaf dashboard to create clones from it. Each newly created project like this will then contain the custom .cls and .sty files.

3
  • Once everything is finished with the merge, can you post an answer to Comparison: ShareLaTeX vs Overleaf (formerly WriteLaTeX)?
    – Johannes_B
    Aug 12, 2017 at 13:45
  • @Johannes_B Thanks, will remember to do that :-)
    – imnothere
    Aug 14, 2017 at 6:35
  • Question: where must the .cls and .sty files be located? I put mine in a styles folder, but Overleaf does not see them. Must everything go in the project root? It would be nice if Overleaf allowed one project to be in the search path of another, so I could just make a new project for each of my class directories and tell a project that I want them in my search path. Jul 9, 2022 at 11:23

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.