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
96 views

\IfTargetDateBefore doesn't use dates from \DeclareRelease and \DeclareCurrentRelease

I am a little confused with the rollback mechanism in LaTeX. I want to let users test the future breaking changes of my package and also I want to keep the future changes in the same package file. So ...
user avatar
  • 7,714
1 vote
1 answer
21 views

Would like to get the geometry and titles packages in plain text, but CTAN downloading gives only unconvertible html [closed]

How can I convert CTAN packages geometry and titlesec, which download in unconvertible html, to ordinary text.
user avatar
1 vote
1 answer
55 views

package commercial fonts into custom latex package

For a corporate template I am building, I need to make the commercial fonts available, which our corporate design guide dictates. These fonts are availabe to me as truetype font files, which are ...
user avatar
  • 187
0 votes
0 answers
32 views

How to create a class that changes the word "Theorem" according to some chosen language as input?

I'm having some problems on creating a class that changes the word "Definition" in \begin{definition} according to a chosen language. For simplicity I will consider only the English language ...
user avatar
  • 269
0 votes
0 answers
20 views

\newtheoremstyle for use in various latex documents

Have made a number of \newtheoremstyle in my document. It is great, but would like my other documents to use them, rather than having to redefine them for every document I produce. Would I need to ...
user avatar
  • 103
0 votes
3 answers
55 views

scrbook redefining sections without titlesec package

I am editing a package (which I did not write myself) where the titlesec package was used in combination with the scrbook document class. This produces an error, as explained in this post: Conflict ...
user avatar
  • 692
2 votes
1 answer
145 views

Is there a \return command to end the current macro?

Is there a \return statement in Latex to end the current macro from being processed? \if some condition \PackageError{mypackage}{main text}{help text} \return \fi I just think it would be more ...
user avatar
4 votes
1 answer
45 views

Spaces removed from tikzlibraries' code when loaded within \ProvidesExplPackage

I'm playing with expl3 in a project and have a weird issue. I have a package that loads tikz and some tikzlibraries. If I use \ProvidesExplPackage, it seems that spaces are removed somewhere in the ...
user avatar
  • 3,429
0 votes
0 answers
31 views

Is it possible to run a script in e.g. Python in a LaTeX .cls?

For a package I'm writing, it would be very handy to use some programmed scripts, for example written in Python. Is there a way how I could add these to my .cls file? And if not, what is the usual way ...
user avatar
  • 749
0 votes
1 answer
46 views

Greek characters in Julia embedded code

I have a problem regarding jlcode package. The package documentation can be found here: https://github.com/m3g/jlcode_example/blob/master/jlcode.sty I have modified the default color theme to match my ...
user avatar
0 votes
1 answer
49 views

Issue with xkeyval package and special characters while compiling with LuaLaTeX

The following is the code of document myfile.tex. \documentclass{article} \usepackage{test} \begin{document} \begin{tabular}{|ccc|c|c|} \myPrint[trtext=Yes, fltext=No]{p,q,r}{stu} \\ \end{tabular} \...
user avatar
  • 1,411
1 vote
0 answers
26 views

how does the nested \def in \def\inst{\beamer@insttitle}\def\and{\beamer@andtitle}

I am trying to understand the following code: \def\author{\@dblarg\beamer@author} \long\def\beamer@author[#1]#2{% \def\insertauthor{\def\inst{\beamer@insttitle}\def\and{\beamer@andtitle}#2}% } ...
user avatar
2 votes
2 answers
108 views

Undefined control sequence when passing 25 arguments

Before I start to ask my question I would like to mention that I am well aware that the following may be non-standard or even frivolous LaTeX. I want to improve it and am open for suggestions. Some ...
user avatar
0 votes
1 answer
37 views

Using virtual font files in .sty package

I'm using virtual fonts to generate a "script-r" symbol, exactly following the accepted answer of this post. I am assembling together a .sty file containing code I frequently use, and would ...
user avatar
1 vote
0 answers
49 views

How to know what variant expl3 functions to provide in a package?

This question stems from a bug report to my package, pdfoverlay. The function in question is: \cs_new_protected:Nn \pdfoverlay_set_pdf:n { \file_if_exist:nTF { #1 } { \str_gset:Nn \...
user avatar
  • 23.6k
1 vote
1 answer
38 views

How to add a backslash in an expl3 message?

In my package there are several messages like this: \msg_new:nnn { my-module } { something-not-define } { "#1"~cannot~be~defined,~a~command~with~the~same~name~has~already~existed. } ...
user avatar
  • 4,752
1 vote
1 answer
31 views

How to define synonym or opposite keys with l3keys2e?

In my package, there are several bool-valued options that are interrelated. How should I reflect the relations in \keys_define? Take a concrete example, with the following code, does it define the key ...
user avatar
  • 4,752
0 votes
0 answers
32 views

What is the correct way to produce package warnings and errors with expl3?

While reading interface3.pdf, I don't quite understand the usage of the message system. It seems that one should first define the message using \msg_new:nnn or \msg_new:nnnn, and then use \msg_warning:...
user avatar
  • 4,752
1 vote
2 answers
125 views

On the improper expl3 syntax in the code of "crefthe"

As I'm very new to expl3, the first package I wrote with it, crefthe, has a lot improper syntax. Thanks to Joseph Wright's answer and @egreg's answer, I've managed to corrected a few, but surely there ...
user avatar
  • 4,752
0 votes
2 answers
75 views

usepackage, absolute path, and github development

I've forked the github repo for a package that is on CTAN and distributed with TeXLive. I'd like to do some development on it, and use it locally before committing back. This seems a pretty standard ...
user avatar
  • 163
2 votes
1 answer
25 views

Is there any difference between \endinput and \tex_endinput:D?

In a few of my packages there is a fast mode, which usually begins with \if@...@fast and contains some minimal version of the commands, then ends with \endinput\fi. Since I am trying to re-write these ...
user avatar
  • 4,752
2 votes
1 answer
85 views

Seeking help to improve the quality of some code written in expl3

I'm starting to write new packages with expl3. As there are less learning resources and examples comparing to the usual LaTeX2e, I really don't have much idea on the quality of my code (formatting, ...
user avatar
  • 4,752
0 votes
1 answer
46 views

Latex class deployment

I have several *.cls files that serve as a template for our company documents. It will create titlepages, copyright notices, add company logos to standard-formatted headers/footers, etc. How can I ...
user avatar
  • 309
2 votes
1 answer
39 views

The `macrocode` environment not working in a normal use of the `l3doc` class

I am writing a package with .dtx and .ins pair. I want it's documentation to be bilingual, but I don't want to complicate my .dtx file by having the documentation to have two languages and the source ...
user avatar
  • 2,203
2 votes
1 answer
100 views

LaTeX3 package internationalisation

I am working on a package for redacting names in minutes of meetings. The idea is that a name 'John Doe' is replaced by '<person 1>'. However, this package may be used both in English and in ...
user avatar
2 votes
0 answers
35 views

automatically setting LaTeX package version for a release

Making a release of a CTAN package sometimes requires updating the version in several places, which is error-prone. Is there a tool/macro to support automation of this, e.g. from a git tag, or from a ...
user avatar
2 votes
1 answer
47 views

Correct way to/best practice for using a custom class for my university?

I've written a really nice, pretty comprehensive class for my particular department's particular way of doing things. I've also got biblatex citation and bibliography styles. Once I have them a bit ...
user avatar
4 votes
0 answers
99 views

What are the available macros for algebra and calculus?

The polynom package can provide all the steps of a long division of polynomials if I just provide the polynomials: \documentclass{article} \usepackage{polynom} \begin{document} \polylongdiv{x^4-3x^3-...
user avatar
  • 189
0 votes
0 answers
31 views

Is there a way for a package to know the extension (e.g. `.tex` or `.dtx`) of the real file processed?

Is there a way for a (LaTeX) package to know whether the real file which is run by (say) pdflatex is ⟨file name⟩.tex or ⟨file name⟩.dtx?
user avatar
2 votes
1 answer
44 views

macros avoid space if macro expands to nothing

(preface: this lua stuff is just the motivation the real issue is with pure LaTeX) I'm currently in some package writing in particular with LuaLaTeX. Since I'm often having a/some commands which ...
user avatar
  • 393
7 votes
3 answers
208 views

Are there any LaTeX commands (including in packages) where the argument will be in math/text mode based on context?

As I work on the parser for finl, I'm contemplating how I'm dealing with command parameters and wondering if my current setup is sufficient. Right now, a parameter has a type which would either be ...
user avatar
  • 12.9k
2 votes
0 answers
86 views

Is the starred version of \ccref really necessary?

UPDATE: New syntax has been adopted, and the package ccref has been renamed into crefthe. The \crefthe now decides whether to pass the preposition to all definite articles depending on current ...
user avatar
  • 4,752
1 vote
1 answer
45 views

Passing options across multiple style files

I load a package, say aaa.sty, from a main document. In aaa.sty, I also load a package, say bbb.sty. The reason why I maintain two style files is that aaa.sty is in the TeX default folder, and bbb.sty ...
user avatar
1 vote
0 answers
93 views

How to generate representation of a tensor in an equation using nested matrices

In general a tensor is defined as an object with N superscripts and M subscripts. Each superscript and subscript can take a range of values 1,2,...,n. For example, a tensor M^[ij]_[klm] can have i=1,2,...
user avatar
  • 103
1 vote
2 answers
61 views

DeclareOption inside a \foreach loop

I'm making a new package, and want to simplify the following lines in a .sty file using \foreach \DeclareOption{aaa}{ \def\x{1} } \DeclareOption{bbb}{ \def\x{2} } \DeclareOption{ccc}{ \def\x{3} } I ...
user avatar
3 votes
1 answer
133 views

LaTeX more "basic" commands

Currently learning how to write packages & define custom environments. In many examples I come across unfamiliar commands (such as \oalign). I so far have had no luck finding their meaning online. ...
user avatar
0 votes
0 answers
44 views

How to create a table of contents with sections and subsections side by side?

I need to write a package that provides a LaTeX template according to the graphical charter of my company, but I have issues with the appearance of the table of contents. The graphical charter is ...
user avatar
0 votes
0 answers
48 views

Institutional style for simple documents in CTAN - folder structure

I developed a very basic style for simple documents for University (https://github.com/baracunatana/docsimplepuj). I'll like to contribute it to CTAN so other people can use it, but this is my first ...
user avatar
0 votes
1 answer
221 views

\NeedsTeXFormat for LuaLaTeX or LaTeX2e

I work on some "homemade" packages that work with LaTeX2e and eventually with LuaLaTeX for some optional features. What is the standard way to use \NeedsTeXFormat in that kind of situation?
user avatar
  • 11.4k
3 votes
1 answer
26 views

Executing only specific options

I'm pretty new to advanced LaTeX coding and therefore may not have a perfectly specific question. I hope you can help me anyway: I want to maintain different preambles at once. They can be seen as ...
user avatar
  • 366
3 votes
0 answers
68 views

Class/package: design vs code

LaTeX3 team often reminds us: "Classes really should be about formatting/style/etc., not functionality. The latter should be added by packages, which ideally would be independent of the classes ...
user avatar
2 votes
1 answer
98 views

Continue to load xparse in new packages?

I am writing a package and intend to use the command NewDocumentCommand, which is available for newer installations of LaTeX (since 2020). Should I still load the xparse package with \RequirePackage{...
user avatar
1 vote
1 answer
53 views

Have option conditionally require package [duplicate]

I want to declare an option in my package that, if provided, will require another package. However, just doing \DeclareOption{requiresomething}{ \RequirePackage{somepackage} } does not work, as ...
user avatar
  • 13
3 votes
1 answer
205 views

Extending package: undefined control sequence

I'm trying to add custom blocks in addition to the ones already defined by scratch3 I made a top-level file customblocks.sty that currently contains \ProvidesPackage{customblocks} \RequirePackage{...
user avatar
1 vote
2 answers
468 views

Error: use of macro doesn't match its definition

I'm trying to write a package to provide some shortcut commands for common linear algebra operations (for my intro to linear algebra course at least). However, I'm getting weird errors under certain ...
user avatar
  • 167
3 votes
1 answer
203 views

Renewing `\tableofcontents` in LaTeX

From this answer, I tweaked it a little bit to redefine \section as follows: \let\oldsection\section \renewcommand{\section}[1]% { \begin{tcolorbox} [ colback=gray!50!white,%...
user avatar
  • 285
6 votes
1 answer
226 views

Making a conditional statement in LaTeX

I am trying to make a style file for me to simplify note-taking, especially subjects involving Math. I want to make the \delim command, having one mandatory argument for the expression, and an ...
user avatar
  • 285
2 votes
1 answer
112 views

Using latexrelease's \IncludeInRelease in packages?

Reading the docs on the latexrelease package I see that there is a system for the latex kernel which lets users simply pass a date argument (presumably the date their document was successfully ...
user avatar
0 votes
1 answer
56 views

Package for a comprehensive grade book?

Good afternoon, I'm wondering if there is some package for LaTeX that would enable one to enter and calculate grades, and additionally to create grade sheets to print. If not, does anyone have any ...
user avatar
0 votes
1 answer
41 views

Should loading a package with no options behave the same as calling a macro with no options using pgfopts and pgfkeys?

This is a followup to my previous question Why does pgfkeys .initial not work in these cases?. In that question I created a macro with a key-value interface using pgfkeys and it works perfectly. Now, ...
user avatar

1
2 3 4 5
11