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

learn more… | top users | synonyms

2
votes
0answers
425 views

What is the use of @ and @@ in variables names in TeX/LaTeX? [duplicate]

Possible Duplicate: Why do LaTeX internal commands have an @ in them? What do \makeatletter and \makeatother do? What is the difference between \myname and \my@name while writing a .cls file? ...
0
votes
1answer
96 views

Creating a Matrixlist package

I haven't been able to find a suitable package that does what I want. The closest is parcolumns and I've spent several hours trying to understand TeX programming and the parcolumns style. While I got ...
0
votes
1answer
327 views

Adding border/frame around boxes [closed]

I'm trying to modify a package to suit my needs but since I'm not very familar with the tex macro language I would like to add a border around the boxes created by the package so I can see exactly ...
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, ...
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), ...
9
votes
2answers
245 views

Key Value option in package

I trying to write a package, and I'd like to specify whether there should be colour or not. I'd like to do: \usepackage[color=false]{foo} and have this set \RequirePackage[color=false]{hyperref} ...
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 ...
9
votes
1answer
293 views

Indexing Macros without a leading backslash in a dtx file

I'm documenting a file containing several biblatex bibmacros and booleans and would like to create an index via \EnableCrossrefs, but % \begin{macro}{mybibmacro} % \begin{macrocode} ...
7
votes
2answers
275 views

Emulate a “tuple” data structure (when you are free to choose the syntax)

How can a "tuple" data structure be implemented in LaTeX? The idea is to store several elements (possibly a predefined number) in one macro and then be able to extract each of these elements by index ...
6
votes
3answers
234 views

Emulate a “tuple” data structure when the syntax for creating a tuple is predefined and cannot be altered

Imagine I have a macro \createcontact that accepts three parameters. Now, instead of using these during the expansion, I would like to save them separately for later use and retrieval. The above macro ...
7
votes
2answers
490 views

Global key-value dictionary

Is there any package that implements a data structure that provides a key-value mapping (akin to Python's dict)? The keys will be user input and may contain spaces and non-ASCII characters. I would ...
10
votes
1answer
780 views

How to extend the \lstinputlisting command

With the answer from autogobble for lstinputlistings I've managed to create a command that gobbles \lstinputlisting and makes firstnumber to start by firstline. I would like to rewrite it as a ...
0
votes
0answers
95 views

Why package enumitem conflicts with Tufte-book and/or beamer [duplicate]

Possible Duplicate: Trouble combining enumitem and beamer I am trying to produce a package, combining tufte-book and beamer, in order to produce lecture slides and handout (with ...
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 ...
4
votes
2answers
290 views

Writing/Modifying Package

There is a package I'm trying to modify that essentially displays a grid. It uses counters to increment the distance. I want to change the distance each step instead of adding a constant value. In ...
6
votes
1answer
210 views

Is there a lipsum-like package for metadata?

I know about the lipsum, blindtext and kantlipsum packages. What I would need is a variant creating dummy metadata: author name/affiliation, title, thanks etc. Does anyone know of anything like ...
11
votes
1answer
130 views

How to prevent `doc` from indexing foreign macros?

The doc package, used for documenting LaTeX packages, has the ability to produce an index of all macros used in the package. Index entries can of of three types: where the macro is described, where it ...
0
votes
0answers
82 views

How to write TikZ packages [duplicate]

Possible Duplicate: tutorial for making tikz/pgf library I want to write a TikZ-based package. What TikZ/PGF-specific things should I be aware of? For those who've written such packages, ...
6
votes
1answer
155 views

Nested parameters lost when generating new macros from package options

I've created a package which I would like to take in options and turn these into new macros (one new macro for each option). I also want these new macros to produce new macros in turn. For example, ...
6
votes
3answers
252 views

What packages are actively maintained/developed on github/bitbucket?

I would like to improve my TeX skills by following the development of actively developed packages. I findingwould like to give back by taking on some of the low hanging fruit among the ...
0
votes
1answer
323 views

conditional commands in .sty file, conditional on \documentclass [duplicate]

Possible Duplicate: Which document class is being used? I'd like to include conditional formatting in a .sty file, conditional on the document class of the document that invokes it. For ...
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 ...
5
votes
1answer
170 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
546 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
387 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
231 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 ...
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, % ...
6
votes
3answers
374 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
266 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
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 ...
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 ...
4
votes
2answers
139 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
560 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
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 ...
3
votes
1answer
1k 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
604 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
276 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 ...
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 ...
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 ...
4
votes
1answer
630 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
243 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
443 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
204 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
533 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
381 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
140 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
263 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
378 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) ...