{package-writing} is about writing packages. If your question is about choosing, installing, or using packages, choose {package} instead.

learn more… | top users | synonyms

100
votes
3answers
13k views

Where do I start LaTeX programming?

I'm interested in writing packages for TeX/LaTeX/XeLaTeX. I googled around, but all I found was guides or tutorials about how to prepare documents using LaTeX. I want to know how LaTeX works and how ...
86
votes
6answers
24k views

Style/class tutorials

What are some good tutorials on writing custom styles (classes) that clearly explain commands used and some of the features that TeX has to offer in the way of styles?
67
votes
5answers
1k views

How do package authors find the time?

Not sure if this question belongs here, on the main site, or not on TeX.SX at all. Let me know if it belongs somewhere else. I have recently made some leaps in my knowledge of LaTeX, in particular ...
55
votes
4answers
1k views

What is good practice when preparing a package for CTAN?

I'm thinking of submitting a package to CTAN, and would like some hints which will help keep the path as smooth as possible for me, the CTAN administators, and the final users. Please tell me what I ...
48
votes
4answers
6k views

Reference guide to begin writing a class and/or a package

Once a LaTeX user gets more and more skilled, and writes his/her own code, the question "Should I make a package (or a class) out of it?" will probably arise. My question is (you catch me: I'm one of ...
38
votes
3answers
2k views

Is it really bad to use \makeatletter and \makeatother in a package or class file?

In my answer to this question What do \makeatletter and \makeatother do? I apparently wrote: The commands should not be used within .sty and .cls files themselves as they may conflict with the ...
38
votes
4answers
2k views

Has the time come for a LaTeX3 successor to 'listings'?

I'm currently looking for a nice and challenging open-source project to work/collaborate on after my thesis. I don't have a Comp. Sci. background, but I'd like to learn more about compiler ...
37
votes
3answers
1k views

How to publish a package that includes scripts and/or executables?

I'm preparing to publish my first package, and am not sure about the best way to proceed. I understand the standard CTAN publishing approach, but I'm dealing with a somewhat atypical case since my ...
36
votes
2answers
663 views

When or why should I use %% as opposed to %?

I've noticed that many (all?) style and class files have "documentation blocks" with a double comment character at the beginning of the line, %% like so instead of the usual style of comments, % ...
34
votes
1answer
5k views

How do I create a LaTeX package?

I would like to jump into the cold waters of LaTeX package creation, mostly for procrastination reasons...but I haven't a clue how to start. For example, a previous question of mine got some nice ...
33
votes
1answer
4k views

Test if a package (or package option) is loaded

[french]{babel} (aka frenchb) is incompatible with some other packages, such as tikz, since it tries to insert \thinspace before semi-colons. In order to make these two play nice, you have to call ...
31
votes
2answers
400 views

What are the standards of TeX/LaTeX coding in order to obtain robust packages?

I have posted several questions ultimately involving various aspects of robustness, that have arisen in the context of other questions in risk of clouding the main point of the question in each case. ...
30
votes
2answers
2k views

TeX assistance in writing hidden acrostics

Here's a fun challenge. Try to come up with (and code) techniques through which (La)TeX can help authors to incorporate acrostics in their writing. The definition from Wikipedia: An acrostic is a ...
30
votes
2answers
836 views

Equation connected by lines

I have written a code that defines a new environment in which aligned equation are connected by lines as in the image: I think it is useful when, inside the align environment, there is the need of ...
29
votes
1answer
677 views

Macro naming best practice?

Is there a preferred or generally accepted idiom for naming user defined macros? I notice that in the change from Tufte 3.5.0 to 3.5.2, for example, the names of the debugging macros have change, for ...
29
votes
2answers
249 views

How do I gracefully retire a package?

I maintain a LaTeX package which is obsolete. All its useful commands are provided by other packages, possibly with different syntax, but still the point is there is no reason for anyone to use my ...
28
votes
2answers
793 views

Moving to LaTeX3 for package authors

I would like to write a package using as much of LaTeX3 stuff as possible (in particular expl3, xparse and xtemplate). What should I read to learn these? In particular: I know that there are good ...
28
votes
2answers
3k views

\newcommand vs \DeclareRobustCommand

I sort of understand the difference between the two. But that's not what I'm interested in—I just want to know, which one should I use? In general, when I'm creating commands in a package or class, ...
28
votes
1answer
3k views

How can I make a package that accepts an optional argument?

I am writing a package that has a bunch of values that are going to be the same most of the time, but that I might want to change in select cases. I want to do this by giving this package an optional ...
27
votes
4answers
535 views

Any suggestions/requests for features for a new package that allows disabling ligatures for (pre)selected words?

I'm starting to put together a LaTeX package, which I hope to distribute broadly, that provides lualatex code to disable ligation of character pairs and triplets for selected words (globally within ...
26
votes
3answers
742 views

When is it better to use \par than \endgraf?

Just yesterday I had to patch a package file (changing the description to indicate that the file had changed) to replace some \par to \endgraf because the code had bad interactions with non-\long ...
26
votes
7answers
2k views

What's a good editor for (La)TeX programming?

I've found several questions about editors for writing LaTeX documents ( LaTeX Editors/IDEs seems to be the definitive one). But I'd like to know which editors are out there that help you develop ...
25
votes
5answers
1k views

Side-by-side source and output when documenting a style file

When documenting a style file, it would be nice to be able to easily put side by side different examples of code, side-by-side with the output they produce. What recommendations to people have to do ...
25
votes
3answers
3k views

Create a symbol font from SVG symbols

Is it possible to create an own scalable font from a set of symbols (~700), all in SVG format. All of them are symbols (like Zapf Dingbats), so there would be no need for special settings like ...
25
votes
1answer
311 views

Wrote a new package. Is there some standard place to share?

So I finished writing my package for typesetting Begriffsschrift. I think it marks a marked improvement over the package begriff, which is the only other package for the same purpose, that I can find ...
22
votes
2answers
6k views

Make your own .sty files

Sorry to start a subjective question, but want to understand "own.sty" file. Other than all \usepackage{} what sort of other commands can be added to the makeyourown.sty file. Can you include \let ...
22
votes
1answer
2k views

tutorial for making tikz/pgf library

I am very impressed with the tikz/pgf libraries created by this community at http://launchpad.net/tex-sx. I would like to create my own too, but don't know where to start. I have tried to reverse ...
21
votes
1answer
518 views

When to use “.sty” extension and when to use “.def”

I'm new to this forum and a recent LaTeX user. I state that, before posting here, I searched all the web through, but I was not succeeded to solve a doubt. I'm writing my own class (myclass.cls), ...
21
votes
1answer
850 views

How do I document my style files?

I have many style files (and one or two class files) that I've written in my local texmf tree. Most were simple things that got me out of some trouble and which I put in to a style file in case I ...
20
votes
3answers
424 views

How to write a LaTeX package that bundles not only .sty and .cls files but also some logos in .pdf or .eps formats?

I would like to make a LaTeX package with the following subdirs: tex/latex/common (a common .tex file shared among beamer and letter) tex/latex/resources (lots of pdf and eps files with graphical ...
20
votes
1answer
344 views

What date should I specify in the optional argument of \NeedsTeXFormat?

Subsection 4.1 of LaTeX2e for class and package writers contains the following passage: \NeedsTeXFormat {⟨format-name⟩} [⟨release-date⟩] This command tells TeX that this file should be ...
20
votes
2answers
534 views

What is the gold standard of package documentation?

When writing documentation for a package aimed at CTAN, what should every manual contain? Specific examples of concise yet complete documentation are valued. This is one of those (hopefully) big list ...
20
votes
1answer
518 views

How would one design a math font?

There are (some very nice) text fonts which do not have math support. Though there are ways to 'remedy' this, such as the mathastext package and some others, these are hardly satisfactory. All accents ...
19
votes
1answer
282 views

When should I upload my new style?

I've been working lately in a new style for my university, which is heavily influenced by a pre-existing style (feupteses). However, feupteses was never meant for PhD dissertations, so I decided to ...
18
votes
4answers
832 views

Editing the package

I didn't find anything about this issue, but if I missed something, please point me to it. The documentation on the ctan.org site is usually about how to use the packages in a LaTeX document, but ...
18
votes
3answers
1k views

Customizing LaTeX - create a document class or a package?

Are there general rules for when to create a document class vs. creating a package to customize LaTeX? Does one have benefits over the other? My specific need is to create a customized page layout, ...
18
votes
2answers
847 views

Kleinberg-Tardos style of book writing

I recently read a book Algorithm Design by Jon Kleinberg and Eva Tardos, which is written in a very unique style. This book doesn't have any typical LaTeX environments such as theorem, lemma, and ...
18
votes
1answer
527 views

I have a dream: Using CSS to style a TeX document

I have no clue in LaTeX package developing but I have a dream! Consider following two files: % A LaTeX file \documentclass{article} \usepackage[style.css]{css} \begin{document} \begin{abstract} ...
17
votes
1answer
760 views

How does TeX actually work?

Lots of useful information for human beings, especially in academia. But, what is actually underlying the TeX engine? How does it really work? Does it parse everything and just put the stuff together? ...
17
votes
2answers
358 views

Defining a dimension with or without @

If I am writing a TeX package (as one can find such on CTAN), there are following approaches to define a new dimension length that should be changeable by a user of that package. Approach A: Define ...
17
votes
2answers
552 views

Write new package with LaTeX2e or LaTeX3

I’m planning to create a package and I wonder if it’s better do do this with LaTeX3 syntax or the „old“ LaTeX2e, which is the one I know. Will LaTeX2e packages be supported by LaTeX3? I can give ...
17
votes
1answer
766 views

How to write overlay-specification–aware macros that work w/o the beamer class

The LaTeX beamer class provides with \newcommand<> and \newenvironment<> an interface to define own commands that can deal with beamer's overlay specifications. Internally, commands ...
16
votes
2answers
677 views

Creating plasmid diagrams in TeX

I need to create a diagram of plasmid in TeX, which looks like that: The images above are slightly different but show pretty much the same thing so it would be great if I could create any of them ...
16
votes
2answers
609 views

How does one publish/promote a new package?

I just took all the wonderful information supplied here, and wrote a small package that makes it possible to use Unicode characters for section, subsection, subsubsection, paragraph, subparagraph and ...
16
votes
1answer
214 views

Write a package that is aware of the mainlanguage selected in babel or polyglossia

How can I make my package aware of the language choosen with babel or polyglossia, so that some auto-generated strings can be generated in respect to the current language? As an example, I have a ...
15
votes
3answers
3k views

A package template using xkeyval?

I would like to write a package offering a number of commands. The package should accept options, and some of these options should be available as command options. Usage should be as follows: ... ...
15
votes
3answers
625 views

How would you name these fraction macros?

I've got four macros now for typesetting fractions in text mode. The first writes them horizontally (shilling style, with a hyphen), the second writes them diagonally, the third writes them ...
15
votes
1answer
430 views

Guidelines: when is LaTeX3 too much LaTeX3?

This morning I found myself writing a document where essentially the same text is repeated several times. Because I've been mucking around a lot recently learning LaTeX3, it took absolutely no ...
15
votes
1answer
525 views

Automatic linking (aka code highlight) in Till Tantau's `codeexample`

I am writing docs for a tikz-based package, and I am trying to reuse Till Tantau's codeexample environment to output source code along with its output. However, I cannot manage to get syntax ...
15
votes
1answer
183 views

What are the established methods for filing and tracking bugs in packages?

My particular concern is in finding Polyglossia's author, Francois Charette, whose email address I could not find in Google. However, I think the issue is much more general. If you encounter a bug in ...