Questions tagged [package-writing]

{package-writing} is about writing packages. If your question is about choosing, installing, or using packages, choose {packages} instead. If your question is related to package options, use {package-options} as tag.

is about writing packages.

If your question is about choosing, installing, or using packages, choose instead.

If your question is related to package options, use as tag.

A standard resource for writing classes and packages is the document "LATEX2ε for class and package writers", also know under its short name "clsguide".

570 questions
115
votes
2 answers

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 answers. I would like to take one of these answers…
Yossi Farjoun
  • 13,274
  • 10
  • 74
  • 96
59
votes
2 answers

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 command, and \newcommands in it. What sort of…
Aku
  • 11,026
35
votes
1 answer

How does \usepackage differ from a simple \include or \input?

What does \usepackage do that is different than \input or \include? Does it simply import the commands in the package file to the current document or is it more complicated?
jak123
  • 4,252
  • 5
  • 26
  • 49
27
votes
3 answers

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 resources) tex/latex/mybeamer (a custom beamer theme…
remus
  • 3,093
23
votes
2 answers

In 2016, what are the advantages and disadvantages of the different methods to create a package?

Now we need to make some choices between TeX, LaTeX2e, LaTeX 3, ConTeXt(LuaTeX), LuaLaTeX, XeTeX, XeLaTeX and... I don't specially like the syntax of L3 but recently I was impressed by very convincing examples with L3 and Lua so syntax or not it's…
Alain Matthes
  • 95,075
12
votes
1 answer

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 the things that really bugs me with LaTeX is that…
Jonathan
  • 121
10
votes
2 answers

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 macros with tests in a .tex file Fork the macro…
Andrew Stacey
  • 153,724
  • 43
  • 389
  • 751
9
votes
1 answer

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 can we make a conditional declaration…
Display Name
  • 46,933
9
votes
1 answer

How to check which command was used to load a .sty file?

I have a .sty file that may be loaded using the command \usepackage (in LaTeX) or the command \input (in LaTeX or Plain TeX). Is there any way that within the .sty file to check which command was used to load the file?
Tisha Shusho
  • 314
  • 1
  • 11
9
votes
1 answer

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…
Alex Lockwood
  • 731
  • 1
  • 8
  • 16
8
votes
2 answers

How to clean all personal commands?

I'm trying to improve the answers to my other question to create my personal package which provides some commands, like \alert to write in red color, or some options like lineno to turn on line numbering. But what should I do when I send the tex…
Sigur
  • 37,330
6
votes
1 answer

Where to start with creating a new package?

I want to create a new LaTeX package to assist myself, and other researchers working in the same field typeset their work. Currently, it is primarily done manually per paper, and while that mostly works, it's clunky, slow and a bit error-prone. My…
Jarak
  • 391
5
votes
1 answer

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: LaTeXSettings.tex for LaTeX,…
Display Name
  • 46,933
5
votes
1 answer

Packages `fighting' for the value of a length

I've recently written some macros for typesetting certain constructs used in linguistics (Discourse Representation Structures). I hit an issue whereby the svmono class was changing the value of \arraycolsep and so messing up the typesetting. (Cf.…
Mohan
  • 15,906
5
votes
1 answer

How to prepare two (or more) sty files for single CTAN package

I am the owner of the gurps package and recently I've been thinking of including a new sty file (called gurps-npccard.sty) which isn't full enough to be it's own package but seems too niche to be included in the main dtx/sty by default. The only…
1
2 3 4