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

learn more… | top users | synonyms

14
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: ... ...
3
votes
1answer
1k views

LaTeX doesn't pick up changes to style file

I installed the widetext package and was happily using it until I decided to edit the style file widetext.sty. Happily, LaTeX immediately picked up the changes and compiled correctly. I then decided ...
3
votes
1answer
265 views

`hyperref` weirdness with simple custom package

Trying to retroactively get hyperref working for my thesis. Fun. Encountered the following weirdness... I have the following (hard earned) minimal-ish working example: \documentclass{article} ...
4
votes
2answers
393 views

Defining (optional) data in a class

I'm trying to learn how to write latex classes and am using my resume as a toy example. I am trying to separate style from content as much as possible so I am trying to define data fields such as ...
21
votes
1answer
809 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 ...
95
votes
3answers
11k 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 ...
27
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 ...
4
votes
4answers
262 views

Is it feasible to create a standalone package for fonts / styles / layouts?

For many of my recent documents, I have started using a rather specific set of packages, settings, fonts and configuration. In one rare case, I even adapted one of the included fonts (in my opinion ...
9
votes
2answers
708 views

How do I detect the options passed to the documentclass from my own style?

In the listings package, they note that "a global \documentclass-option draft is recognized, so you don’t need to repeat it as a package option" I tried looking into its source to see how it ...
15
votes
1answer
182 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 ...
16
votes
2answers
589 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 ...
5
votes
1answer
147 views

Is using `\input{}` in a user defined package to partition it into smaller ones a correct way?

I am writing my own package called mylisting.sty to format code inclusion for languanges: LaTeX, PSTricks, C#, and XML. To maintain mylisting.sty cleaner, I make a separate file for each language: ...
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 ...
4
votes
1answer
950 views

Use \newcommand with a variable inside a style file

I have the following code which I put inside the preamble of my LaTeX documents: \newcommand{\modulecode}{SESG6025} \newcommand{\lecturetitle}{Interpolation} In this case, that means that when I'm ...
5
votes
2answers
347 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
219 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
772 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
920 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 ...
47
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
896 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 ...
81
votes
6answers
21k 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?