Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

4
votes
2answers
40 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{...
21
votes
0answers
201 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 ...
15
votes
0answers
225 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
54 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
34 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
23 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
43 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
25 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
272 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
52 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 ...
8
votes
1answer
207 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
38 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
90 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
639 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 ...
2
votes
1answer
91 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
30 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
43 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
90 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
26 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
76 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
263 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
105 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
38 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
37 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 ...
7
votes
1answer
127 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
294 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
90 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 ...
3
votes
1answer
202 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 ...
0
votes
0answers
24 views

Detect the presence of a package [duplicate]

As a package author, I need to detect the presence of a certain package. Is there a standard way to that? Some kind of \is_loaded{package_name} command? (If not, could you help me finding another way ...
1
vote
0answers
66 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
47 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
203 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:...
0
votes
1answer
92 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
55 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
805 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
188 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
124 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 ...
0
votes
0answers
81 views

How to update my own packages?

At the moment I am starting to organize my documents a little bit better. For this reason I want to externalize some of my code into packages. Some of these are rather stable but some have to be ...
4
votes
1answer
456 views

key-value syntax in package options

I want to create a style file capturing my layout for theorem environments. In particular, I would like to pass an option to the package specifying the level of the theorem counter. So here is a ...
1
vote
1answer
52 views

Transfer all options of “geometry” to my package

In my package I need to use all of geometry package options, I can define one option landscape like this \DeclareOption{landscape}{ \geometry{landscape} } \ProcessOptions\relax My hope is ...
1
vote
1answer
39 views

Define a required option with pgfopts

I would like to define a required package option with pgfopts. So far I've done the following: \begin{filecontents}{\jobname.sty} \ProvidesPackage{\jobname}[2018-01-24 v1.0 Test package] \...
-1
votes
0answers
29 views

How can I use my custom style in LaTeX? [duplicate]

I'm currently trying to create a custom bibliography and citation style by copying, renaming and modifying existing .bbx and .cbx files. (Following this article http://biblatex.dominik-wassenhoven.de/...
2
votes
2answers
62 views

Environment that conditionally shows it's contents is not working. Missing \endgroup

I tried to make an environment that shows its contents if @showtrue and doesn't otherwise. When I try to run the MWE below, I get an error message: ! Extra }, or forgotten \endgroup. \...
8
votes
1answer
283 views

How can I negate the 1 inch TeX margins and still use TikZ?

So I noticed when \hoffset or \voffset is changed, TikZ no longer finds the correct origin. Is it possible to help TikZ find the correct origin? (like a global shift or something?) Also, why does the ...
2
votes
0answers
122 views

App inventor blocks in LaTex

My question is very simple... Is their a package to write the scratch like blocks in LaTeX. So I can make worksheets for my students. (There is a wonderfull scratch-package that I already use for ...
1
vote
2answers
106 views

Using tikz within an expl3 package or class (2017 edition)

This question follows the question Using of \usetikzlibrary in an expl3 package fails. While the linked question worked some time ago, its answers seem not to be working anymore. The question: How ...
0
votes
0answers
66 views

LaTeX3 choice keys that set other choice keys

I'm trying to set up choice keys that can implicitly set other choice keys. In both the "parent" and "dependent" keys, the set of choices have the same values. The code below does more-or-less what I ...
3
votes
1answer
90 views

Setting default values for LaTeX3 keys

I've written the following code for setting values of a key as part of a package I'm working on, and for some odd reason the default doesn't seem to work. When the package this is part of is specified ...
19
votes
2answers
423 views

Recommended means of testing packages while writing them

What is the recommended way of writing a package in the .dtx format? Do package authors usually just write the .dtx first, or use some kind of tool to create a .dtx from the .sty files? I know both ...
0
votes
1answer
249 views

Detecting section depth

Is it possible for an environment to detect which sectioning level it is at? I'm in the process of creating a package which defines a numbered environment of question/answer pairs, and I want to ...