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.

Filter by
Sorted by
Tagged with
2
votes
1answer
30 views

Detecting stale aux file in a custom package

I am writing custom package, and attempting to use aux file for some two-pass typesetting. The punch line is that my package renders some blocks of text which all need to have width equal to the width ...
0
votes
1answer
25 views

pgfopts .unknown does not handle key-value pairs?

I would like my custom class to forward unknown keys to the base class, or in this case, a package. The following works (to make the example smaller, this forwards only one key; expanding it to a ...
0
votes
1answer
49 views

Check whether a command from package is used and modify the style

I am trying to create a pagestyle, where \guideNameA is mandatory and if \guideNameB is used then I want modify the page style accordingly. Also I need to modify the document content by checking ...
2
votes
1answer
66 views

How to delete a counter?

I am trying to delete a counter in my ".sty" file. Right now I have a few ".tex" files that use the same ".sty". They use the same ".sty" file to use \newcommands. However, when I go to make a new ...
4
votes
1answer
82 views

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

Custom Package Parameters

I am writing a custom, package using Texmaker with Pdftex. I have a function, which I would like to change a certain delimiter to whatever the user wishes if my provided delimiters are not good, or ...
1
vote
1answer
46 views

Custom package error ! Missing = inserted for \ifnum

I am trying to create a very basic package for use with a font called HEJI2 (which provides some music symbols to use in-line). My code looks like this: \ProvidesPackage{heji}[2019/12/9 v1.0] \...
0
votes
0answers
66 views

Can we make a better shaded/framed/boxed environment?

I have grown quite fond of Donald Arseneau's framed package. However, there are a few tweaks I would like to add, but not sure how. Whether to merge the two environments framed and shaded, or modify ...
2
votes
0answers
42 views

Writing a package: Best practices regarding dependencies

Some dependencies may be obvious and necessary for the basic function of a package. But what about secondary features which would require loading additional external packages? To clarify: I understand ...
1
vote
0answers
36 views

Problem using custom package

The problems occur with the following two example files. The first file is called sty1.sty. It is located in ~/Library/texmf/tex/latex/packages/sty1 I created all of the folders below ~/Library. ...
4
votes
1answer
42 views

Strange catcode setting at beginning of unravel package

At the beginning of the unravel package source code we can find some cryptic catcode settings: \begingroup\let\c\catcode\fam32\c\fam10\advance\fam5\c\fam14\c45 12 % \c54 12\c55 12\c56 12\c57 12\c58 ...
0
votes
0answers
34 views

Allow kvoptions with spaces in String

I try to write my own package + class. The package is supposed to offer some option like so: options -> class -> package -> custom command For this I use the kvoptions-package, and my files ...
2
votes
2answers
92 views

How to check for errors when creating package/class

Short: How can you find errors in a package/class without importing the .cls/.sty file to your project/without using the package? Note: I'm looking for a general way of checking package/class errors, ...
4
votes
1answer
47 views

Help with makedtx — DocInput undefined

I am trying to generate a CTAN .dtx/.ins files for a package I have and I stumbled upon a problem that I can't solve nor find a way around. I am on a Ubuntu 18.04, with a LaTeX Live 2017. Consider ...
0
votes
1answer
66 views

Creating language package options

This is essentially the same question: Write a class with language dependent strings. But I didn't find any solutions that worked. I'm trying to create a package where languages are package options, ...
5
votes
1answer
75 views

New package or class: way tho share it

My prime question is: is there a proper way/website to share a package or a class of our own? If the question is too generic, I can try to refine it a little bit: what is the best way to get some ...
0
votes
0answers
68 views

Isn't it wise that LaTeX package developers, make an option in all their math packages…?

Question: Isn't it wise that LaTeX package developers, make an option in all their math packages something like \usepackage[opt-cmd[user-define]]{math-package-name} such that we able to use only ...
1
vote
0answers
50 views

What is the correct way to place keys and messages without repeating too much code (expl3)

I am trying to put error messages for invalid keys in a package, some keys are available for the package, others can be accessed with the command \mypkgset and others are only available as options of ...
2
votes
1answer
38 views

Can I get a PDF from `.lvt` files to visually verify the output?

I'm trying to write regression tests with the l3build system. I know how to use l3build save to make a .tlg file from an .lvt file so that future tests can be compared against what's presumed to be a ...
5
votes
2answers
121 views

Typesetting a comma unless before a line break

I'm trying to create a template (.sty file) that will typeset [value of macro 1], [value of macro 2] if this expression does not exceed the length of the line, and [value of macro 1] [value of ...
1
vote
0answers
29 views

Code review for a self created .sty file

I will start to write my masterthesis in the next weeks with LaTeX. I have build my own .sty and integrated it into my document. Everything works fine and it looks like it should but it would be great ...
2
votes
1answer
54 views

Change command in package

Im trying to use the venndiagram package but i want to change the colour it fills in the areas. Currently if you use the code for example \begin{venndiagram2sets} \fillOnlyA \fillNotAorB \fillA \end{...
0
votes
2answers
92 views

Passing boolean key value from one package to another with kvoptions

The source document below first writes two packages, each using keys and kvoptions; the first package passes a boolean option to the second and calls the second. Despite the preamble line \...
2
votes
2answers
56 views

Overspacing for a text [duplicate]

In the book I'm writing there are some parts with math-mode spaces and math-mode inline spaces that are too excessive for me. The first and the second image that I am reporting are taken directly from ...
1
vote
1answer
67 views

writing functions and wrapping commands for abstraction

Can i write a little function (or macro or whatever) that wraps two commands (functions?) into one; united under a single alias? Specifically I want to wrap \input{} and \includegraphics{} into a ...
3
votes
1answer
112 views

How to add new ornaments to psvectorian?

I've been using the package pst-vectorian (https://ctan.org/pkg/pst-vectorian) in order to customise part, chapter and section headings. I, however, would like to add new ornaments by using other ...
0
votes
0answers
48 views

! LaTeX Error: Command \@ptsize already defined

I've written a LaTeX class file and created a dtx file by sty2dtx tool. The tex file that using the class file which I have written before is successfully built & compiled without error. However, ...
1
vote
1answer
43 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
68 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
43 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
62 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
48 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
127 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} \...
2
votes
1answer
119 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
55 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
24 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
577 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
53 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
32 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
30 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
36 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
98 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{...
28
votes
2answers
861 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 ...
24
votes
0answers
1k 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
97 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
49 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
37 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
92 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
37 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
337 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 ...

1 2 3 4 5 9