Skip to main content

Questions tagged [package-writing]

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

Filter by
Sorted by
Tagged with
4 votes
1 answer
102 views

Why \IfPackageAtLeastTF{⟨package⟩}{⟨date⟩}{\PassOptionsToPackage{⟨option⟩}{⟨package⟩}}{} doesn't pass ⟨option⟩ to ⟨package⟩?

My current version of parskip is 2021-03-14 so: \IfPackageAtLeastTF{parskip}{2018-08-24}{\PassOptionsToPackage{indent}{parskip}}{} \usepackage{parskip} should pass the indent option to parskip. But ...
Denis Bitouzé's user avatar
4 votes
1 answer
90 views

How can I stop l3build deleting files generated by a custom target?

(Silly) MNWE: build.lua: ctanpkg = "mini" module = "mini" installfiles = {"*.sty", "*.cls", "*.sup"} tdslocations = { "tex/latex/mini/*....
cfr's user avatar
  • 207k
0 votes
1 answer
27 views

Double longtable

I need to use tabular for 2 cases: one for numbered data(table float) and other for text data(I named quadro). Now Im need to use longtable for both, the way I thought to do that is load the longtable ...
Leonidas's user avatar
4 votes
2 answers
109 views

How can I do the equivalent of \DeclareFontShapeChangeRule which tests 4 targets rather than 3?

If you don't care why I'm asking, skip the first section .... Problem: No small-caps italic shape was defined in LaTeX 2e. \textsc{\textit{small-caps italic}} did not produce small-caps italic even ...
cfr's user avatar
  • 207k
2 votes
0 answers
77 views

How should I have diagnosed this? Figuring out when to insert code into hooks to alter third party package behaviour

This question seems very confused to me, so I'm not sure you will be able to make sense of it. I know how to solve this problem (now). What I would like to know is how I should have diagnosed and ...
cfr's user avatar
  • 207k
2 votes
1 answer
72 views

ProvidesPackage with semantic versionning

I uploaded (right before TexLive 2024's freeze :-( ) a package, switching to semantic versioning like: \ProvidesPackage{zx-calculus}[v2.2 A package to typeset ZX calculus and circuits directly in ...
tobiasBora's user avatar
  • 8,944
0 votes
0 answers
40 views

Leave blank lines in expl3 packages for better code clarity

Leaving empty lines in the code of a package is usually not recommended. But for packages written with expl3 new lines, as spaces, are ignored. So, could blank lines be safety used to aerate the code ...
jlab's user avatar
  • 3,911
10 votes
1 answer
384 views

Moving from pgfkeys to latex3 key-val system to handle package options

I have been advised in this question to move from pgfopts to latex3 to handle package options. I would like to do that but I must admit that I am a little lost. Examples with the patterns I'm using ...
Vincent's user avatar
  • 5,327
4 votes
2 answers
94 views

Difference betwen .is family and .cd in pgfkeys in the context of package writing?

I am using pgfopts to create my own packages and handle options. .family and .cd can be used to group the package options together, but I am not sure to understand the pros and cons of each approach, ...
Vincent's user avatar
  • 5,327
0 votes
0 answers
110 views

expl3 in package

I've read in interface3.pdf that expl3 is natively supported in LaTeX2e since February 2020. However, I cannot make the following work: % test.sty \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{test} \...
Gargantuar's user avatar
  • 1,184
1 vote
1 answer
44 views

Mixing package options and family options?

The question I am asking here is a follow-up to the question Macros to change pgfkeys package options on the fly and define custom sets of options. I was used to specify package options using the ...
Vincent's user avatar
  • 5,327
1 vote
1 answer
33 views

Initial style definition before and after ProcessPgfPackageOptions?

The following great post, provides the following answer to a question about managing package options: https://tex.stackexchange.com/a/707285/17200 \begin{filecontents*}[overwrite]{mypackage.sty} % ...
Vincent's user avatar
  • 5,327
7 votes
1 answer
180 views

Why do I get "unused global options warning" for options forwarded to a package except for the first option?

I am working on a custom package for my macros and shortcuts, and a custom class for my preferred style of the document. I am using DeclareKeys to define key-value options in my package, and then my ...
Shai Avr's user avatar
  • 909
0 votes
1 answer
61 views

Can't pass choices option to package

I am trying to make a custom package to contain all my personal macros and a custom class for my personal style. I wanted to pass a keyword argument notation which can take a value of math or physics ...
Shai Avr's user avatar
  • 909
8 votes
2 answers
382 views

Weird error in custom package instead of the error I tried to throw?

I am making a custom package for all my personal commands, and I am trying to pass some keyword arguments to the package as described in section 4.4 of clsguide. My use case is that I take math and ...
Shai Avr's user avatar
  • 909
3 votes
0 answers
131 views

Best practices for setting package options mid-document

I am currently working on a package where the user can set the package options mid-document or within a local group. Currently, the user can do this via the user commands \set<package>keys or \...
User23456234's user avatar
  • 1,886
3 votes
3 answers
147 views

"Undefined control sequence" in option of own package, but not within the document

It's my first question, sorry if there are any mistakes! I'm trying to create a package with the clsguide. In the package, I define an own command and I want to use this to set an option (storing a ...
Serdar Uludağ's user avatar
3 votes
1 answer
54 views

Can I use \substitutecolormodel{hsb}{rgb} rather than \selectcolormodel{rgb} to draw PGF/TikZ paths with a hsb-defined colour series?

Consider the following MNWE: \documentclass{article} % \usepackage[rgb]{xcolor} \usepackage{tikz} \definecolorseries{xcolor g2}{hsb}{grad}[hsb]{.575,1,1}{.987,-.234,0} \definecolorseries{xcolor s2}{...
cfr's user avatar
  • 207k
1 vote
1 answer
49 views

Create package for CV with options given separately

I wrote my CV in latex and I want to share it with the world but now it's a mess of a code. I want to write a package so that the user could just do \addjob{1}{Job title 1} \addshortdesc{1}{short ...
M.O.'s user avatar
  • 316
8 votes
2 answers
138 views

Use l3build to build and package a font package

I would like to use l3build to build and package a support package for a TrueType/OpenType font. File Layout truetype/MyFont.ttf build.lua my-font-package.dtx my-font-package.ins File Contents build....
Stephan Lukasczyk's user avatar
6 votes
1 answer
115 views

How can I disable shadows (and similar preaction/postaction effects) in TikZ or PGF?

Is there a general way to disable preactions/postactions in TikZ on which effects such as shadows depend? If not, is there a straightforward way to enable users to add options to an existing style so ...
cfr's user avatar
  • 207k
0 votes
0 answers
35 views

Adding a page in the end of a document with preamble

I am working on a special style package for a company and one of templates must include a special blank page in the end of a document. In order to do it I could make a command like \makeEndPage that ...
Daniel Neskorodov's user avatar
2 votes
0 answers
41 views

Options in style files [duplicate]

How can I have an option to require some packages in a style file I am writing ? For instance, I can have a Science and Technology Option that makes available certain symbols. And another option to ...
Mahavir's user avatar
3 votes
1 answer
124 views

LaTeX for Companies

I work with a small company (10 people). I've been a LaTeX user for roughly 20 years. We have been trying to implement LaTeX as the primary document preparation system in our company with varying ...
cole's user avatar
  • 31
0 votes
0 answers
26 views

How to manually space two images in a environment defined by a personal package

I am trying to create a package in order to be able to write in Ithkuil (it's an artificial language). To do this, I need to have an environment \begin{ithkuil} ... \end{ithkuil} in which the ...
Emanuele Lorica's user avatar
1 vote
1 answer
28 views

Errors setting up a custom equation environment using \tcbhighmath

Currently, I'm writing a Macros package to store my custom environments and macros for my homework sheets. I'm trying to create a custom environment which I can define within my package (a .sty file), ...
Ammardian's user avatar
0 votes
0 answers
98 views

How to write my own TexLive package?

I want to create my own latex package with a .sty file in it, and install it via tlmgr command. I've looked it up in Google, and found only this page https://tug.org/texlive/pkgcontrib.html, where I ...
OrthoPole's user avatar
  • 113
2 votes
1 answer
58 views

Why can these custom commands from packages not be seen in the main document?

I am using TeX Live (MacTeX) 2023 with all updates (as of this morning). Consider two packages called packageone.sty and packagetwo.sty. packageone.sty contains a redefinition of \vec to include a ...
LaTeXereXeTaL's user avatar
1 vote
0 answers
48 views

Are header guards necessary for LaTeX packages? If so, how to implement one?

A header guard is used in some programming languages to avoid repeatedly importing the same file. Here's one example of this scenario in LaTeX: Let's say we have header1.sty, header2.sty and main.tex ...
Long Horn's user avatar
  • 115
0 votes
1 answer
35 views

xkeyval keys not resetting after execution of the command with luatex

The following tex document is compiled with LuaLaTeX engine. \documentclass{article} \usepackage{luakeytest} \begin{document} \myAddFunction[c=30,d=40]{10.1}{20} \myAddFunction{1}{2} \end{document} ...
user61681's user avatar
  • 1,769
1 vote
1 answer
70 views

Macro without arguments to define macro with arguments

I'm trying to use xparse and generic TeX/LaTeX commands to write a macro (that takes no arguments) to define another macro that does take arguments: \documentclass{minimal} \RequirePackage{xparse,...
Ben Zelnick's user avatar
3 votes
0 answers
78 views

How to implement some functions in C++ for Asymptote?

I implemented some special functions in pure Asymptote language and they are useful. But one recommends me to implement them in C++ instead. I'd like (and I already have these functions in C++) but I ...
Stéphane Laurent's user avatar
3 votes
0 answers
89 views

Passing optional arguments to LaTeX commands with Lua

The following tex document is compiled with LuaLaTeX engine. \documentclass{article} \usepackage{keytest} \begin{document} \myAddFunction[c=30,d=40]{10}{20} \end{document} This works fine and output ...
user61681's user avatar
  • 1,769
1 vote
1 answer
180 views

My first package stopped to work!

some years ago I wrote the simple package PSBao.sty. I stopped using it two years ago and now it doesn't work any more. I'm not able to find the cause. Can someone help me? Unfortunately it was my ...
nino_user183677's user avatar
1 vote
2 answers
92 views

LaTeX3 dynamic generation of \prg_new_conditional

I have multiple pieces of redundant LaTeX3 code that creates new conditionals: \bool_if:nT { \cs_if_free_p:N \mypkg_if_package_loaded_p:n && \cs_if_free_p:N \mypkg_if_package_loaded_T:n &...
Neveda's user avatar
  • 43
1 vote
1 answer
58 views

AUCTeX auto style files for .dtx and .tex with the same base name

In a LaTeX package using DocStrip with pretty standard structure one could have the following files: mypackage-code.tex mypackage.dtx mypackage.ins mypackage.tex mypackage.dtx is the main file where ...
gusbrs's user avatar
  • 14k
1 vote
1 answer
73 views

l3build testing several tcolorbox theorems: what would be the best way?

(I'm (still) in the process of trying to understand how l3build tests work.) Suppose I'd like to l3build a test for a class (based on standalone class, but I guess it is of little importance here) ...
Denis Bitouzé's user avatar
3 votes
1 answer
130 views

\AtBeginDocument and packages

Here is a very puzzling behaviour of the (Lua)LaTeX compiler. In the situation below, the output depends on whether some code in put in a package or directly in the main file; asking for an extra \...
Rémi Peyre's user avatar
1 vote
1 answer
195 views

Who are the people behind the CTAN packages? [duplicate]

I am sorry for my naive question but the more I get acquaint with LaTeX packages, the more I wonder who are those people behind the packages. Some of them are very complex, with exhaustive 1000-pages ...
Rubem Pacelli's user avatar
0 votes
0 answers
68 views

How can I to pass options (or Load) class to a new package? Is it possible?

I'm planning to build a new package, which I call abntstyle, that can implement Brazilian norms of writing academic works. There is already a class called abnTeX2 that does this. This class is ...
lucenalex's user avatar
  • 331
0 votes
1 answer
44 views

Trouble writing new package for a numbered 'tcolorbox' style with option for 'number within'

I am writing a new package to define a numbered box style (using tcolorbox) that I use in multiple documents. I want to take the numbering convention of the box as a package option. By default, I want ...
Zxcvasdf's user avatar
  • 1,755
1 vote
2 answers
77 views

How to use catcodes in a macro/environment

I want to use catcodes in an environment and the catcodes shall be changed for a very short part in the document. MnWE: \documentclass[a5paper, 11pt]{scrartcl} \usepackage{environ} \NewEnviron{Lied}[...
MaestroGlanz's user avatar
  • 2,348
1 vote
0 answers
76 views

Condition in Writing New Environment with pgfkeys

I'm writing a new environment in LaTeX where pgfkeys package is used to give the key interface. Source Code: \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{noteframe}[2023/01/01 Version 1.0] \...
Future Liang's user avatar
1 vote
1 answer
99 views

How to use \pgfkeys properly in \newenvironment based on xcolor and tcolorbox?

I'm trying to create a new environment called noteframe that is based on tcolorbox. Supposedly, the noteframe environment should allow the user to change the theme color of the box using the name of ...
Future Liang's user avatar
0 votes
1 answer
51 views

``key-one=value one'' versus ``key-one={value one}'' in l3keys or package options

I just noticed that key-one=value one and key-one={value one} seem equivalent as \keys_set:nn arguments but not as package options. In next minimal example, the same key-value argument is parsed as a ...
Jérôme LAURENS's user avatar
3 votes
1 answer
191 views

Typesetting Non-Latin Unicode Characters with LaTeX

I am writing a package in LaTeX, and would like to have basic macros (e.g. \vulture) for printing almost all the Egyptian hieroglyphs (e.g. U+13150 𓅐 - Egyptian Hieroglyph G14 - Vulture). As far as I ...
aralto's user avatar
  • 71
3 votes
1 answer
485 views

How to create an `expl3` package?

By a expl3 package I mean a package that includes some commands that uses expl3. The point is that I want a document to be able to \usepackage{} that package and avoid the need of \usepackage{expl3} ...
youthdoo's user avatar
  • 871
0 votes
1 answer
280 views

How to save a style file in TeXShop?

When I try to save a .sty file in TeXShop, I get the message "You cannot save this document with extension “.sty” at the end of the name. The required extension is “.tex”." Of course, I ...
Ishaidc's user avatar
  • 101
2 votes
1 answer
186 views

Expl3 syntax generate error and warning messages for class and LaTeX

When I do \msg_new:nnnn { module } { errorname } { explenation } and then \msg_warning { module } { errorname } i get Package module Warning:. How can I get it to say Class module Warning: or LaTeX ...
Vebjorn's user avatar
  • 1,884
0 votes
1 answer
86 views

Produce error when document exceeds a page length

I tried making an fatal error when the document exceeds a set pagelimit. I think there is some problem with my if statement, because although the document exceeds the limit there is no error. The idea ...
Vebjorn's user avatar
  • 1,884

1
2 3 4 5
12