I was wanting to write a package for personal use, however I do not know how to create a .sty file on Overleaf. Could someone please suggest to me how I might be able to do this?
Asked
Active
Viewed 1.2k times
5
Troy W.
- 151
1 Answers
3
The file/new menu option allows you to specify the filename as mypackage.sty or whatever you want to call the package. It is probably simplest to make the main document a simple test document
\documentclass{article}
\usepackage{mypackage}
\begin{document}
test
\end{document}
so that overleaf has something to run. You can add any specific tests of the commands you are defining to that package as you go along.
David Carlisle
- 757,742


@ping me in a comment under my answer if you want me to see the comment. You have the .sty as the main file so overleaf is running that (see my answer wheremain.texis first, I just asked in chat if there is an easy way to fix up your project – David Carlisle Apr 04 '20 at 18:59corrigan.styto be the main file??? – David Carlisle Apr 04 '20 at 19:02corrigan.styis abovemain.texwhen I go to menu,main.texis chosen as the main file. – Troy W. Apr 05 '20 at 00:35\cccto take three arguments, all mandatory so must be used as\ccc{one}{two}{three}but you have used it with one optional argument and no mandatory ones\ccc[...]so it is entirely a local package use error and unrelated to your original question. (You could perhaps revert your question edits so that my answer makes sense, that question is I think of general interest for overleaf users, but the question now just shows a coding error in your document and is unrelated to overleaf (or my answer) – David Carlisle Apr 05 '20 at 09:31