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

learn more… | top users | synonyms

15
votes
3answers
595 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 ...
5
votes
1answer
168 views

Version number for a bundle

I need some advice. I am going to bundle a package of mine (lets say its named foo, currently v2.0a) with two not yet released packages (therefore both v0.1). I am unsure which version number the ...
8
votes
1answer
503 views

Help wanted on \openout, \write and \closeout

Is there a way to test if a token is already associated with a writer? Something like this: \def\do@write#1{% \immediate\write\mywriter{something: #1}% } \def\@writesomething#1{% ...
14
votes
3answers
378 views

Advantages of a custom class over a package and environment

What are the advantages/disadvantages of defining a class over a package and environment? I have recently started to clean up some of the cruft in the preamble of my letters. The simplest solution ...
3
votes
1answer
225 views

float package: get list of all floats defined with \newfloat?

I develop a new package and as one functionality, I would need to get the list of all floats defined using the \newfloat command of the float package. I could of course modify this command in ...
35
votes
3answers
962 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
653 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, % ...
6
votes
3answers
365 views

Collaborating with the non-TeX-savvy

What tips do you have for collaborating on a LaTeX document with people who may not be as TeX savvy as you? For one example and potential problem case: Consider you have a set of new commands and ...
11
votes
2answers
263 views

biblatex: How to build a testing environment

Maybe the question is also of interest beyond biblatex but here's the thing: I recently published my biblatex style biblatex-fiwi and I'm always having trouble making sure that updates don't lead to ...
27
votes
4answers
529 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 ...
66
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 ...
4
votes
2answers
135 views

Recreate the conditions of the document preamble while loading a file in the document body

While in the document body I like to temporary switch back to the mode active in the LaTeX preamble, i.e. spaces between macros should be ignored. I don't mind whether I get the ! LaTeX Error: Missing ...
9
votes
1answer
501 views

Do any of the LaTeX variants support namespaces?

The scenario is that I'm writing a book and it looks like I'm going to need to do some munging as the document class Memoir has some wonderful features but Octavio has the presentation. Now, one of ...
17
votes
2answers
530 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 ...
3
votes
1answer
983 views

\RequirePackage without option clashes because of the package loading order?

I am writing a package which requires the xcolor package with table option. It is loaded in the package with \PassOptionsToPackage{table}{xcolor} \RequirePackage{xcolor} which works if my package ...
6
votes
1answer
564 views

Argument of setkeys

My motivation bases on the package listings (also my package mdframed). The package allows to define a style via \lstset{foo}{options}. Now I want to create a macro to expand the style foo. For ...
14
votes
2answers
271 views

Write to /dev/null?

I'm working on package that (among other things) writes an external file during compilation. I'd like to provide an option to the package to not write the external file. I know I can set up a ...
32
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 ...
15
votes
1answer
498 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 ...
4
votes
1answer
580 views

Create package with C/C++

How can I build a new LaTeX package written in C or C++? I'd like to add some new commands to LaTeX, but LaTeX is not for advanced programming, so I should write my commands in another language.
9
votes
2answers
227 views

Is it possible to abort loading a package if it's too old?

I'm working on a package that has to work on both TeXlive 2009 (Ubuntu, so updating TeXlive is a nonstarter) and later versions, and I'd like to be able to use fontspec with LuaLaTeX if we're on ...
7
votes
1answer
403 views

Disabling the draft option in a package

Within a package I'm making, I want ignore the default draft behavior and write my own. I have tried: \DeclareOption{draft}{ MYCOMMANDS ... \OptionNotUsed } \ProcessOptions If draft is used, my ...
8
votes
1answer
199 views

How to place a # character in a message?

How can I place a # symbol inside of a \PackageWarning inside of a macro definition? I tried: \PackageWarning{package}{# or \# or \string# or \hash} but either ## or unknown (for \hash) or Illegal ...
20
votes
2answers
511 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 ...
10
votes
2answers
351 views

How to specify an optional final argument with \newcommand?

I'm writing my first package, and I'm trying to work out how to create a new command with an optional final argument. In this instance, if an argument is omitted, it defaults to blank. This is ...
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 ...
6
votes
3answers
135 views

Class/package for German documentation

I’m writing the musuos class and I’m writing the documentation with ltxdoc.cls and doc.sty which seems to work. But the documentation is in German so it’s not very nice to get (environment) in the ...
11
votes
2answers
255 views

hyperref causes problem with doc.sty

Try the following code. Without hyperref everything is fine and there’s the right entry in the index. With hyperref this entry disappears. (The codeline entries which are not shown here ar not touched ...
14
votes
2answers
355 views

Multiple documents from a single dtx

The DTX format allows to generate both the package code (.sty file) and documentation (.pdf file) from a single dtx file. Is it possible to generate several PDFs (for example for different languages) ...
10
votes
1answer
268 views

Porting LaTeX packages to ConTeXt modules

From seeing quite a few questions here, it seems ConTeXt is often able to easily address problems that LaTeX has a hard time with. I'd be willing to give it a try, but there is one package that I ...
5
votes
1answer
123 views

Handle class options in the order they're given

How can I pass options of my package in a specific order to another loaded package? \ProvidesPackage{L10n} \DeclareOption{english}{\PassOptionsToPackage{\CurrentOption}{babel}} ...
6
votes
1answer
702 views

Creating a package of custom-made commands

I tend to use the \mathbb{...} command a lot, so I have made some commands to ease the amount of typing I have to do when I use LaTeX: \newcommand{\R}{\ensuremath{\mathbb{R}}} ...
2
votes
1answer
690 views

Extending the faktor package

I'm writing a script (topic ring theory) where I have to set lots of quotients of algebraic objects. Usually I simply write M/N. However there are some cases where this is no easy to read (M+N/N or ...
12
votes
1answer
290 views

CLI tool to upload to CTAN

This question led to a new package: ctanupload sty2dtx and ctanify are useful tools to prepare clean packages to CTAN. Is there also a tool to upload the package from a terminal?
6
votes
3answers
266 views

How to remove all dashes (-) using a macro?

In a package, I'm building macro names from the values of options passed to a function. Now, the values should also allow a - inside, but the command names I'm building with \csname do not. So, I need ...
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 ...
28
votes
2answers
751 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 ...
3
votes
2answers
214 views

Structuring a collection of patches for various classes and packages

I develop a package whose main part consists of fixes and patches to other document classes and packages. Naturally, I only want to apply a patch if the class or package in question has been loaded. ...
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 ...
9
votes
3answers
478 views

Mutually exclusive options in packages

Is there a standard way to define mutually exclusive options in a package? Could someone provide a simple example? Currently I am mostly intrested in LaTeX2e but it would be nice to see a LaTeX3 ...
7
votes
2answers
1k views

Can I specify that I only want the .sty file from a .dtx?

I've been trying to be good and make my proto-packages .dtx files (in particular, the files in the TeX-SX Package but that's not particularly relevant). My workflow goes a bit like this: Hack a few ...
22
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 ...
8
votes
1answer
203 views

LaTeX3: \ProcessKeysOptions hangs while processing global (class) option

The code of the trivial package mypkg.sty below defines key draft. If draft is given as a class option, LaTeX hangs at the command \ProcessKeysOptions. This seems to be a bug. Or is there something ...
6
votes
4answers
370 views

Signalling error in “expandable context”

I'm reviewing a few old macros of mine to make them fully expandable. One of the macros takes one argument, which should either be a two-digit or a four-digit integer (>1955). The macro then converts ...
32
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 ...
9
votes
3answers
201 views

Backward compatibility for command names

I have made a class file. It defines commands for use in document files. I want to change some of the command names, but I also want old document files to work without changing them. Here's an ...
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
264 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 ...