Hi Rohit, you need nothing special to write a package. Whatever can go to a preamble can be in a package. You should only know that inside a package @ is a character, not a special symbol. If you define a general purpose macro which for whatever purpose has to call a package internal macro, you can use @ in its name, e.g. \my@intermal@macro. Packages often do it and it is recommended to use a short package identification followed by @ followed by a descriptive name for internal macros. For instance I use \zwpg@something type internal macros in my zwpagelayout. the reason is that internal macros are not documented and this convention prevents redefinition of someone else's internal macro by accident. It is also recommended to identify the package by
\ProvidesPackage{packagename}[YYYY/MM/DD Descriptive text] It will be visible in the log file, especially if you also request the list of packages used. And in \usepackage or \RequirePackage you can request a package of a specified date or newer. In such a case LaTeX will check YYYY/MM/DD in the square brackets and warn you if you have an old version installed. The package can have options but you should firsl try to make a simple package and learn \DeclareOption and \ProcessOptions later. And maybe you will never need options. If a package is not too complex, it is easier to do everything just by macros. Zdeněk Wagner http://ttsm.icpf.cas.cz/team/wagner.shtml http://icebearsoft.euweb.cz po 13. 4. 2020 v 12:18 odesílatel Philip Taylor <p.tay...@hellenic-institute.uk> napsal: > > RD Holkar wrote: > > This leads to the next question: where can I find a good resource to learn > how to write latex packages? I have, I would say, slightly more than working > knowledge of latex. However, when I looked at the packages, I could not > figure out how to create them. > > > Rohit, I don't use LaTeX, so have never created a LaTeX package, but this > page seems to be useful and informative. Someone more up-to-date with LaTeX > internals than I will need to comment on whether or not the advice given is > valid for the current release. > > Philip Taylor