Stack Exchange Network

Stack Exchange network consists of 174 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.

1
vote
1answer
21 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
263 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
48 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 ...
0
votes
1answer
37 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
83 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 ...
1
vote
1answer
389 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
86 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 ...
0
votes
0answers
60 views

Specifying relative paths with fontspec

My goal is to specify a relative path when loading fonts with fontspec, so that I can provide custom fonts within my package. Otherwise, the user will be forced to install the font manually, which is ...
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
32 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
80 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
74 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
205 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
100 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
37 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
122 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
291 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
72 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
188 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
23 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 ...
1
vote
0answers
42 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
199 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
80 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
53 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
694 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
141 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
122 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
80 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
368 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
50 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
37 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] \...
0
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
60 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
259 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
110 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
104 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
64 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 ...
2
votes
1answer
86 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
421 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
201 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 ...
1
vote
2answers
390 views

How to declare several options for a package

I'm writing a package and already added two options with \DeclareOption. Then with \ExecuteOptions I set the default option. This works really well, but now I have to add a second option type and this ...
23
votes
0answers
598 views

Feedback on new package for creating on-line quizzes from latex

Arguably this question is either too broad or outside of the scope of TeX.SX, so I accept that it may be closed. As I only want feedback I'd also be happy if this was made a community wiki. I have a ...
2
votes
2answers
96 views

writing newcommands, user interface advice request

I'd like to develop some good habits in LaTeX coding. I understand I'm in the novice category and I'm interested to hear advice. We have a legacy document header that was created by some MS Word ...
1
vote
1answer
60 views

Using phantom labels to hold complex and dynamically defined macros

I have been trying to do this for a while now and seem to be getting errors I don't really understand. This is a followup trying to use the suggestions here but I figured this followup was a bit too ...
0
votes
0answers
237 views

Question About Loading Newly Made Package in TexStudio [duplicate]

So I was getting tired of having to create a preamble where I would load in several packages like amsmath, mathpazo, etc. and decided to create my own package. Nothing fancy; just wanted to have to ...
2
votes
0answers
60 views

Issue with ctanify on my texlive2017 (windows os)

I have problems to run ctanify on my TL2017, executing ctanify --help I have this message Can't locate File/Copy/Recursive.pm in @INC (you may need to install the File::Copy::Recursive module) (@...
0
votes
0answers
143 views

custom package and TeXstudio [duplicate]

I wrote a custom .sty file to put all my don't-want-to-carry-around definitions, which provides a new package for me. Now, if I want to use it with TeXstudio (that's what I use for typesetting), ...