Questions tagged [package-writing]

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

1
vote
1answer
33 views

Use unexpanded macro in package options

When I try to put in my package options with not yet defined macro (even if I use noexpand), the document fails to compile (even if I don't use the macro!). Any idea if it's fundamental or not? (I ...
0
votes
0answers
50 views

How to make a new pdfLaTeX font family (package)?

I know how to make a simple .sty file and use my custom package inside my document. However, I also know of some packages like times or inconsolata which provide many different font families to use ...
0
votes
0answers
41 views

How to create your own class for a very specific usage?

I have created my resume in Latex and honestly, I like it a lot. I was thinking of making a template and publish it somewhere so that people can use it. But it's rather complicated and it would be ...
0
votes
0answers
46 views

doubts about the process of creating The TikZlings package

I would like to know what techniques were used by @samcarter to draw the figures from the package https://ctan.org/pkg/tikzlings. If you have some sample code to show I will also be grateful.
0
votes
1answer
30 views

I can't use \CurrentOption in commands that are not package specific [closed]

I am making a preamble package and I want to give bibfiles as options : preamble.sty: \RequirePackage{biblatex} \DeclareOption*{ \addbibresource{\CurrentOption} \PackageInfo{preamble}{\...
2
votes
1answer
89 views

Conditionally add options to tcolorbox highlight math style

I have defined the following package: % Configuration \NeedsTeXFormat{LaTeX2e}[1994/06/01] \ProvidesPackage{eqbox}[2018/01/01 Boxed Equations] \RequirePackage{xcolor} \RequirePackage{pgfopts} \...
1
vote
1answer
34 views

Local variable to a package

I am defining my own latex package mypackage.sty. How to define a local command such that: mycommand If mycommand is already defined elsewhere it will be locally redefined just inside the package If ...
3
votes
1answer
52 views

Standard test documents for new packages

I'm putting together a package that offers general functionality that I think would be helpful for lots of LaTeX users and in lots of documents. I've rolled my own test cases, but I can't help but ...
0
votes
0answers
18 views

How to document LaTeX custom packages and document classes? [duplicate]

While I can use something like Doxygen to document a C library (functions, constants and structures defined/written by me), I couldn't find something equivalent in LaTeX to document \newcommand(s) \...
4
votes
2answers
92 views

How to resolve clashing definitions of \comment in comment.sty and changes.sty without affecting either's interface?

I'm writing a package that uses both changes (v3.1.2) and comment (v3.8), and I'd like to expose their functionality to consumers of my package without having to modify either one's interface. The ...
0
votes
0answers
49 views

Commands vs keys/values for setting up a document: what an own document class should provide?

This question somehow extends the question "Package option vs setup command". I'm currently writing a class dedicated to students reports for both academic projects and internships. This class ...
1
vote
0answers
29 views

`\show` for macro arguments

For debugging purposes, I want to write to the log what is actually passed to a macro as argument. A naive \newcommand\test[1]{\show#1} obviously doesn't do the job. So how can I printout a list of ...
0
votes
0answers
26 views

Reporting LaTeX error at custom location

I'm familiar with \PackageError as a way to cause LaTeX to report a custom error message when the command is run. But I'm wondering, is there a way to cause LaTeX to report an error, with a custom ...
1
vote
0answers
32 views

Conditionally include a line based on an option with pgfpackages

I am trying to design a small package, mostly for test purpose. Currently the package looks like this: % eqbox.sty \NeedsTeXFormat{LaTeX2e}[1994/06/01] \ProvidesPackage{eqbox}[2019/01/01 Boxed ...
4
votes
2answers
61 views

Renewcommand with ensuremath and brackets

I'm making a .sty file (which is called my-macros.sty and is in my home /texmf directory) where I define some commands that I constantly use. Among these commands, there are the following \newcommand{...
23
votes
0answers
384 views

Physics replacement effort

I'm currently considering writing up some macros in order to provide a somewhat more reasonable alternative to what the physics package does. This is heavily inspired by Alternatives to the physics ...
14
votes
0answers
472 views

Alternatives to the physics package

The physics package is useful A lot of my LaTeX documents make heavy use of the physics package. Aside from it overloading several standard commands (e.g. \sin, \abs, etc.), it also makes a few ...
3
votes
1answer
68 views

Using pgfopts to set up a tcolorbox style

Consider a package file eqbox.sty: % Preamble \NeedsTeXFormat{LaTeX2e}[1994/06/01] \ProvidesPackage{eqbox}[2018/01/01 Boxed Equations] % Packages \RequirePackage{xcolor} \RequirePackage{pgfopts} \...
2
votes
1answer
41 views

Replacing ^^J with ^^J%% within DocTeX's first pass of a DocTeX document?

Question Is it possible to perform text replacement during the first pass of a document by DocTeX ? Specifically, how can I replace ^^J with ^^J%% in a \edef'd macro ? Background I had recently ...
0
votes
1answer
28 views

Isodate package: package loading vs. \AtBeginDocument

In order to have iso dates on my class-generated title page, I would have to load isodate before calling \AtBeginDocument since this MVE \documentclass{scrartcl} % ...
1
vote
1answer
54 views

How does the file name database, in MikTeX, resolve the files it catalogs?

I recently updated my MikTeX distribution (The new interface is really nice by the way, Thank You to the contributors/developers) and I got curious about the path resolution of files when compiling a ...
1
vote
1answer
30 views

Software Documentation Dot-Operator/Period Hyphenation

I'm still new-ish to latex, and I'm trying to document some software using the tool. I'm referencing local terms that are long and contain periods/dot-operators. I know how/why Latex doesn't like to ...
14
votes
1answer
284 views

Does LPPL allow package development with pull requests etc.?

Many packages are nowadays developed on github or similar platforms and if I want to contribute a bugfix to some package (of which I'm not the author), my usual workflow is to fork the repo, develop ...
2
votes
1answer
58 views

Where are basic mathmode symbols stored

What I want to do: I want to take two basic LaTeX mathmode characters, take their vector picture file, and edit them together to form a new symbol, which I want to behave as any other mathmode symbol ...
9
votes
1answer
216 views

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 ...
0
votes
1answer
39 views

Defining colors in style file by forcing immediate expansion

I am writing a template for a poster (using beamer/beamerposter) package for students that I intend to distribute as a folder. It will contain a .tex file that the students can start editing, and a ...
0
votes
3answers
110 views

How to use “Kpathsea” to open a sty file for users modifications

I have a package to create exam paper sujet.sty, in this package I have defined some commands like school which expand to the name of school. \def\school{name-of-school} I thought about using a ...
3
votes
2answers
1k views

Windows MikTeX can't find my .sty file

I posted a question like this earlier but I'm re-asking because I didn't ask properly before. I created a .sty file (preamble.sty) to help clean up my preamble but I'm having trouble actually using ...
3
votes
0answers
105 views

Software Architecture and xtemplate

When writing a package, there may be the situation that several things need to interact to make a complete product. When using xtemplate, I can define each part as an object. This means that the ...
1
vote
1answer
33 views

What do the labels (such as <*dircheck>) mean in `source2e.pdf`?

I am studying source2e.pdf and I have encountered something such as <*dircheck>, <*initex>, <*2ekernel>,<latexrelease>. I thought that they might be some sort of label to mark ...
3
votes
1answer
74 views

Trouble with newtcolorbox title positioning and optional arguments in .sty file

I'm trying to recreate this info box, but I'm having trouble making optional arguments for the title of the box and the position of the title. This is what I have so far. Aesthetically it is almost ...
2
votes
1answer
106 views

Configuring a section alias in LaTeX

Every week I produce a couple of A5 booklets (A4 folded) for my wife, an active colleague in church ministry, from which I am recently retired. I call the booklets a pulpit manuscript, as it includes ...
0
votes
0answers
29 views

Need a way to nest line breaks in tabularx environment for Calendar

I am trying to make an academic calendar package. I know there's a veritable horde of them out there and I've looked through many of them but can't seem to find one I like. Since I am (usually) pretty ...
5
votes
1answer
82 views

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 ...
2
votes
3answers
379 views

How to change the directory of my own .sty files in MacOS?

Right now, I save my own packages in the shown 'standard' directory. I can use this package in MacTeX with a simple \usepackage{} command. I want to backup my styles in iCloud without to copy it ...
4
votes
1answer
120 views

How to define a string variable with diacritics to my own package (.sty)

I try to add a variable title string to my own package 'MyStyle.sty'. 'MyStyle.sty' just contains some used packages, pdf settings and commands for a style guide / corporate identity. Document.tex \...
0
votes
1answer
41 views

Custom Package: Combine Options

Suppose I have the following custom package where I have my various titlesec setups defined: \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{mytitles}[2018/06/01 Custom Titles Package] \RequirePackage{...
2
votes
1answer
41 views

Comparing package version dates

Is it safe to use the LaTeX commands \@ifpackagelater, \@ifl@t@r and/or \@parse@version to compare/parse dates in the format used with \ProvidesPackage (YYYY/MM/DD)? Or is there a package providing ...
9
votes
1answer
142 views

Package option vs setup command

Traditionally, LaTeX packages will use package options (I mean the options in \usepackage[...]{package}) for setup. However, I have noticed in some modern packages, e.g. siunitx, unicode-math, ctex, ...
9
votes
2answers
302 views

Easiest way to create TeX macro/code to access symbols from particular font?

I would like to use CASIO fonts here. 1 - I would like to create a way to use LaTeX to get these "icon"s. For example, use \On for the ON button, and ect. Assuming we have to do some more work here ...
2
votes
0answers
121 views

Setting up kvoptions with a setup command [closed]

The hyperref package (for example) provides a \hypersetup command where key-value options can be provided as an alternative to \usepackage[key=value]{hyperref}. I'm trying to do the same, using ...
4
votes
1answer
221 views

Statistics on package usage

Is there any way I can get an overview or at least any indication on how many people downloaded/installed a package from CTAN, MiKTeX and/or TeXLive? I'm asking because I have recently made several ...
1
vote
0answers
69 views

Feasibility of a Latex “Computation Verifier”

This may be more appropriate on stackoverflow, but as it pertains specifically to the existence of a utility for LaTeX, I thought I should ask it here. In my experience as an undergraduate, it's very ...
0
votes
0answers
54 views

Package to select exercises by difficulty

I'm new to this community, I'm sorry if the question is not appropriated. I'm looking for a package to create Exercise Sheets like probsoln, with exercises loaded from an outside .tex file, but that ...
7
votes
2answers
221 views

Creating package options which are mutually exclusive and choosing a default

I want to automatize some of the code that I usually include to setup my theorem environment functionality into a package. So here is what I do to control within which counter my theorems are numbered:...
1
vote
1answer
105 views

Checking if certain package option is declared inside .sty

I'm writting a package in which the user may choose between three types of documents through declared options when issuing the \usepackage command: undergraduatethesis, technicalreport and ...
1
vote
1answer
61 views

Find out the math font used in a document (so I can write a package to make adjustments depending on the math font)

This is a follow-up to this question. The problem was that if tikz-cd is used with the command \tikzcdset{arrow style=math font} in order to make the arrow heads fit the math font, the stems of the ...
2
votes
2answers
971 views

Latest MiKTeX: suggestions on how to install new fonts using the MiKTeX Console

MiKTeX has changed its look by introducing the MikTeX Console: In the past I have always updated and added fonts not included in the MikTeX distribution using the mask Settings, Update and Package ...
0
votes
1answer
248 views

'Unknown option' errors in custom package

I am playing around a little with creating a custom package for theorem environments and related functionality. Consider the following MWE: \RequirePackage{filecontents} \begin{filecontents}{test.sty}...
4
votes
1answer
127 views

Need advice for design decision: class or style

When implementing LaTeX support for company documents, a decision must be made prior to the initial release: is the support implemented as class or as style? While there is a heap of information about ...