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

learn more… | top users | synonyms

5
votes
2answers
340 views

Processing the body of an environment multiple times

Dear all, I am new to package writing (LaTeX2e) and to this forum, and I probably read to much of the TeXBook and not enough on LaTeX. My package works, except that verbatim is verboten. Given a user ...
6
votes
1answer
217 views

When writing a user defined package, how can I decide whether the \documentclass using it is book or article?

I want to write my own package as a collection of other packages I often use. Some declarations in my package only work for book, some for article, and the remaining work for both. In (La)TeX, how ...
11
votes
2answers
2k views

How do I declare an option that takes an input value?

I know I can declare and execute an option for my package using \DeclareOption{myoption}{\typeout{I did it!}} \ProcessOptions but now I'd like to give the option a value: ...
13
votes
2answers
764 views

Multilingual class/style file?

I'm writing some templates and class files that need to use some strings of text, say names for theorems, lemmas, etc., and I would like to provide the ability to easily switch the language in which ...
13
votes
3answers
903 views

How can I word-wrap LaTeX warning/error output?

This question led to a new package: hardwrap In writing error messages and warnings for a package/class, I find it a pain to manually insert \MessageBreaks so that words don't get cruelly ...
46
votes
4answers
5k 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 ...
8
votes
2answers
864 views

Using non-ASCII characters in packages

What is the best way to use non-ASCII (say, Cyrillic) characters in a .sty file? If it's used in a LaTeX file that uses \inputenc[utf8]{inputenc}, than one can just use utf8 encoding in the .sty file ...
73
votes
6answers
19k 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?