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
187 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 ...
0
votes
0answers
32 views

LaTeX can't find my .sty files despite following lots of advice on here

I wrote a .sty file to help condense my preamble but I can't get LaTeX to find the file in my computer without copying the .sty file into the folder for each document I am trying to make. I've tried ...
2
votes
1answer
52 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
40 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
28 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 ...
2
votes
1answer
27 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
72 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
24 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
73 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
150 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
91 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
33 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
36 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
118 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
282 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
54 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
170 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
22 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
59 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
41 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
193 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
75 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
51 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 ...
1
vote
2answers
615 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
98 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
119 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
78 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
287 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
49 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
28 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
58 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
238 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
103 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
97 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
85 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
409 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
162 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
254 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 ...
20
votes
0answers
532 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
95 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
59 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
190 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
57 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
97 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), ...
2
votes
1answer
271 views

'Novel' package

As an author writing in a LaTex environment, using the novel package currently included in MacTex, I now understand that the package author (?) has withdrawn the package on the 7th May. However, the ...
0
votes
0answers
43 views

How to customise the title page [duplicate]

I want to customise the title page like the format in the following picture. This title page is a part of the smfart.cls, which I will attach to below. Now I just want to use that title page ...
1
vote
0answers
120 views

Package or solution to implement a color palette system [closed]

I would like to know what solutions are available for color palette handling in LaTeX. This is needed for a custom package I want to write. (I plan to use tikz and luatex, so any tikz- or lua-solution ...
3
votes
0answers
155 views

How to package .bib files?

I have written some biblatex styles and provide them in the biblatex-archaeology package. I would like to have some .bib files with @STRING replacements for journals and serieses and example entries ...