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

learn more… | top users | synonyms

7
votes
1answer
47 views

How can I generate precisely one warning within a tabularx environment?

I realise this is an unholy mix of expl3 and LaTeX-2e, but most of my code is like this at the moment, unfortunately. I want to be warned when I fail to set a particular variable. More specifically, ...
14
votes
1answer
139 views

What is exactly a hook in etoolbox

I understand well the \apptocmd and related tools of etoolbox package. However, I still not understand what \appto<hook>{<code>} and related do, even reading three time the handbook ? ...
19
votes
2answers
1k views

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 ...
5
votes
2answers
65 views

Giving numerical value to a package

I am playing around with making a package for some of my LaTeX commands and environments. The problem I am encountering is that the package will need to take a numerical value, which have a default ...
115
votes
7answers
41k 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?
3
votes
1answer
80 views

Modify page behaviour in a cookbook .sty file to manage complex recipes

I'm trying to edit a .sty file for the typesetting of recipe books. It's a modification by Alexis Flesch of cookybooky: link to the full package (with output) The problem is that the code is ...
3
votes
1answer
79 views

How to put the section head on the same location as a slide title when using slidepage

I am developing my own beamer theme. As part of the theme I want the section slides to have the section title on the same position as the other slides. At this moment the position is a little off. ...
6
votes
1answer
49 views

Package for special treatment of sequences of capitals

For linguistic writing, I frequently deal with input data where sequences of capitals should be typeset not as capitals, but should be treated specially, e.g. be typeset in lower case, small caps. ...
2
votes
1answer
43 views

How to check if a macro can be followed by a newline

I'm trying to create a class that allows you to define a name using \name{Whatever} This is defined as \newcommand{\name}[1]{\def\gsy@name{#1}} Whatever is passed to this is used in the header, ...
3
votes
0answers
44 views

Tikz version history information

I'm working on a package that works on top of tikz. It needs certain libraries (the tikz libraries quotes, positioning and intersections and the pgf library arrows.meta). Is there any way I can ...
4
votes
1answer
56 views

(is there/how to make) a package/macro like `enumerate` but for whole document sectioning

I just discovered the enumerate package, what excited me because some time ago I was wondering about something similar (options where a stands for \alph{<counter>}, A for \Alph{<counter>}, ...
4
votes
0answers
26 views

Consolidating similar packages [closed]

Are there any efforts being made towards consolidating packages with overlapping features? If I created a package that could provide extra features to another package, is it expected that I share this ...
2
votes
0answers
32 views

List of package requests?

I have recently entered the realm of package development and uploaded my first package to CTAN. Is there a master crowd-sourced list somewhere of issues/abilities that people would like to see ...
6
votes
1answer
47 views

l3doc adds unwanted backslash in margin box of {function}

I'm using l3doc for documenting some packages (I know it is not officially stable, but I like it …). I came to the problem that {function}{<list>} adds a backslash for every item in <list> ...
3
votes
1answer
40 views

“Extra \fi” error when defining mutually exclusive package options with conditionals

I have been trying to create a package, which loads the babel package and sets the language with an option. I've been getting strange errors when trying to define mutually exclusive package options, ...
2
votes
1answer
94 views

Fixing a LaTeX thesis style issues with formatting section headings

I am fairly new to LaTeX, but I decided to take it upon myself to use the .sty file the computer science department at my school had for the university's thesis style. As it turns out, there are a ...
16
votes
2answers
119 views

What is the simplest way to extract a URL from a .bib entry for use in \href{}{} (probably using Biblatex)?

I am trying to define a new macro with the following syntax: \citeimg*{<bibkey>} The unstarred form should simply produce \citeauthor{<bibkey>}, \citetitle{<bibkey>}, ...
29
votes
3answers
891 views

When to use TeX vs LaTeX for package writing

So I got into the whole idea of learning plain TeX (or what I think is plain TeX) and it's been very fun and rewarding. I also started writing some macros/packages for my personal use for now. Since ...
4
votes
1answer
159 views

Option argument for Beamer section slide

I am creating my own Beamer theme with a custom section slide. Ideally I would like the command \frame{\sectionpage} to have an additional, optional argument, that specifies the color of the ...
4
votes
1answer
58 views

How to display the dates in the \PrintChanges' changes?

An information I'm often missing when I have a look at the "Change History" of a package/classe is the dates of the changes because, IMHO, just the version number is not informative enough: if I could ...
1
vote
1answer
289 views

thmtools: “Your backend doesn't allow styling theorems” warning

I'm writing a package. Here is a part of it which should be enough for people to try reproducing my problem: %[…] \ProvidesPackage{mworks} %[…] \RequirePackage{amsmath,amssymb,amsfonts,nicefrac} ...
14
votes
1answer
157 views

Determine File Name and Line Number Where a Macro is Invoked From

Wondering if there is any way to print out (for debugging purposes) the file name and the line number from where a macro is invoked (not where it is defined). My attempt to use the currfile package ...
0
votes
0answers
41 views

Create your own style [duplicate]

I know this question has been asked many times, but I could not find a good answer for my question, yet... I wanted to develop my own thesis style i.e. \usepackage{harthesis}, which I did, but when I ...
0
votes
1answer
21 views

Placing the abstract on titlepage in custom class

Imagine I want to include my abstract to my titlepage. I would do something like this: \documentclass[10pt,english,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \title{My ...
3
votes
1answer
107 views

HowTo create a LuaLatex package

I would like to develop LuaLatex packages. I am very interested by the scripting capability of LuaLatex, so I'd like to use it as much as possible instead of Latex or Tex. Is there a "standard" or ...
4
votes
1answer
42 views

Are dynamic defaults possible with kvoptions?

I'm writing a package with two options; one of the defaults should change, depending on the other option. Currently, the definitions are: \SetupKeyvalOptions{family=gitlog,prefix=gitLog@} ...
5
votes
1answer
57 views

How can solides3d know when one object is behind another?

pst-solides3d has an impressive graphics engine behind its design. I'm interested in knowing how it is able to know when an object is behind another object. Disclaimer: I am not sure this is an ...
28
votes
1answer
592 views

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?
6
votes
1answer
43 views

Is it possible to implement a package dependency which is version specific?

This question should really ask what is the best way to implement a version-specific package dependency. However, if I try to ask that, the system threatens to close my question. In this answer, ...
21
votes
1answer
1k views

What date should I specify in the optional argument of \NeedsTeXFormat?

Subsection 4.1 of LaTeX2e for class and package writers contains the following passage: \NeedsTeXFormat {⟨format-name⟩} [⟨release-date⟩] This command tells TeX that this file should be ...
19
votes
2answers
698 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 ...
7
votes
1answer
288 views

Creating a ConTeXt/LaTeX hybrid module

I have a simple titlepage, which I want to make available for ConTeXt- as well as LaTeX users. Each should just type \usemodule[myTitlepage], or \usepackage{myTitlepage}, respectively. I want to do ...
132
votes
4answers
20k 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 ...
8
votes
2answers
220 views

Encrypt and decrypt parts of text in a LaTeX source file

Assume that you have some text in parts of your LaTeX document that you only want people with a password to see. A reason could e.g. be a case with an guiding answer. You want to make the case public ...
1
vote
1answer
142 views

Has anybody implemented Society of Automotive Engineer (SAE) style bibliographies with a biblatex/biber solution?

There already exists an SAE class on CTAN contributed by Axel Franke, which although it is 15 years old (last update 2000-11-14) is still workable with a few tweaks, I think. The problem I am facing ...
13
votes
2answers
176 views

The following code compiles without error. How can I change that?

Unlike most questions on this site, my problem is that my code compiles without error and I do not want it to. I want to be able the check whether \command is defined and to do something if it is ...
3
votes
1answer
174 views

change title page margins ONLY without packages

I am trying to prepare a package for students that offers a uniform standard title page for their work (homework, reports, theses, and probably more). I have the title page laid out as it should be. ...
1
vote
1answer
37 views

How to \clist_set in \msg_new?

Is it possible to process a comma separated list within a LaTeX3 error message? For example I want to define a message for unknown values to a .choice key like in the following example. I use \test ...
4
votes
2answers
79 views

Writing a token list conditional with expl3

This is a follow-up question to LaTeX3 conditional with grouping fails to compile. I would like to write a token list conditional with expl3 that is fully expandable in order to use it as a predicate ...
1
vote
0answers
87 views

Writing modular classes

As an OOP programmer, I am very attracted to the idea of making separate files for independent features within a class definition, where each feature I feel is too long to be included inline in the ...
5
votes
4answers
146 views

Help designing a package to use with personal notation

I am attempting to typeset a notation that I use for my own work, and I am struggling to create flexible commands. The notation involves placing mathematical symbols and expressions as if on the ...
40
votes
4answers
2k views

Has the time come for a LaTeX3 successor to 'listings'?

I'm currently looking for a nice and challenging open-source project to work/collaborate on after my thesis. I don't have a Comp. Sci. background, but I'd like to learn more about compiler ...
3
votes
2answers
139 views

Evaluate strings of key-value option in custom package by using a switch-case environment

I'm trying to write a custom package MyUnicodefonts where I'd like to store all my font settings for various math fonts and roman fonts (later also mono and sans). In my document I intend to choose ...
13
votes
2answers
233 views

Should expl3 code be used in packages intended to be compatible with multiple formats?

Maybe this question is just not a good idea in general, but, I'm curious. This could make package development simpler for some in the future. (Of course, this would not be forced on any package ...
6
votes
2answers
271 views

What is the difference between \@@par and \par?

In LaTeX internal code I came accross \@@par. How is this different from \par or \newline. When should I use \@@par if I am writing a package or class file? In general, there are so many other ...
4
votes
1answer
51 views

Problems using listxadd and xappto

I am a fairly experienced LaTeX user. Now, I am trying to get into learning the internals of LaTeX packages and classes. I do not know much about TeX coding. I thought a good beginning would be to try ...
3
votes
1answer
47 views

use multiple .dtx file to make only .sty file

I would like to split the voluminous .dtx of eledmac in multiple .dtx file. 1) one for the user handbook 2) many other for the package code + handbook. So my objectives are: 1) have multiple .dtx ...
8
votes
1answer
127 views

What is the most effective and efficient way to document a package?

I'm sure this must be a duplicate but the questions I've found don't quite address the question I have. Related questions include: How to modify package documentation How to document style files ...
3
votes
1answer
75 views

LaTeX3 conditional with grouping fails to compile

I am trying to write a LaTeX3 conditional using \prg_new_conditional:Nnn from the expl3 package. Since the code in the conditional needs to make assignments to some variables, I would like to use ...
5
votes
1answer
514 views

Define path for packages in the LaTeX file (analog of \input@path or \graphicspath for \usepackage)

How to specify path for additional packages in the LaTeX file itself? For graphics, you use \graphicspath{{a}{b}}, and then \includegraphics{file} finds b/file.pdf. EDIT: it should be ...