{package-writing} is about writing packages. If your question is about choosing, installing, or using packages, choose {package} instead.

learn more… | top users | synonyms

0
votes
0answers
40 views

Writing modular classes

As an OOP programmer, I am very attracted to the idea of making separate files for independent features within a class definition, where each feature I feel is too long to be included inline in the ...
3
votes
2answers
58 views

Evaluate strings of key-value option in custom package by using a switch-case environment

I'm trying to write a custom package MyUnicodefonts where I'd like to store all my font settings for various math fonts and roman fonts (later also mono and sans). In my document I intend to choose ...
13
votes
2answers
179 views

Should expl3 code be used in packages intended to be compatible with multiple formats?

Maybe this question is just not a good idea in general, but, I'm curious. This could make package development simpler for some in the future. (Of course, this would not be forced on any package ...
4
votes
4answers
135 views

Help designing a package to use with personal notation

I am attempting to typeset a notation that I use for my own work, and I am struggling to create flexible commands. The notation involves placing mathematical symbols and expressions as if on the ...
6
votes
2answers
151 views

What is the difference between \@@par and \par?

In LaTeX internal code I came accross \@@par. How is this different from \par or \newline. When should I use \@@par if I am writing a package or class file? In general, there are so many other ...
4
votes
1answer
29 views

Problems using listxadd and xappto

I am a fairly experienced LaTeX user. Now, I am trying to get into learning the internals of LaTeX packages and classes. I do not know much about TeX coding. I thought a good beginning would be to try ...
3
votes
1answer
28 views

use multiple .dtx file to make only .sty file

I would like to split the voluminous .dtx of eledmac in multiple .dtx file. 1) one for the user handbook 2) many other for the package code + handbook. So my objectives are: 1) have multiple .dtx ...
3
votes
2answers
50 views

Writing a token list conditional with expl3

This is a follow-up question to LaTeX3 conditional with grouping fails to compile. I would like to write a token list conditional with expl3 that is fully expandable in order to use it as a predicate ...
3
votes
1answer
59 views

LaTeX3 conditional with grouping fails to compile

I am trying to write a LaTeX3 conditional using \prg_new_conditional:Nnn from the expl3 package. Since the code in the conditional needs to make assignments to some variables, I would like to use ...
8
votes
1answer
96 views

What is the most effective and efficient way to document a package?

I'm sure this must be a duplicate but the questions I've found don't quite address the question I have. Related questions include: How to modify package documentation How to document style files ...
4
votes
1answer
68 views

Define path for packages in the LaTeX file (analog of \input@path or \graphicspath for \usepackage)

How to specify path for additional packages in the LaTeX file itself? For graphics, you use \graphicspath{{a}{b}}, and then \includegraphics{file} finds b/file.pdf. EDIT: it should be ...
2
votes
0answers
79 views

advanced LaTeX course [duplicate]

I am looking for some tutorial or video-class or something like that about LaTeX advanced course. I want to know more about macros and the creation of packages. Thanks for the attention!
4
votes
2answers
39 views

How can I set contents in a box of zero width and specified height, optionally rotating, using expl3 syntax?

Using Steven B. Segletes's answer, I can centre something horizontally, optionally rotating it, using \centering \makebox[0pt]{\rotatebox{<angle>}{<contents>}} \par However, I would ...
5
votes
1answer
59 views

How can I override geometry's scale in the preamble? (E.g. if a class or package has set a default using geometry.)

With some geometry options, it is possible to override a previous setting in the preamble. For example: \documentclass{article} \usepackage{geometry} \geometry{hmarginratio=1:1} ...
0
votes
0answers
62 views

How to go about learning to program in Tex? [duplicate]

I have been using Tex for a few years now and enjoyed the work of others (e.g., ctan packages, templates, styles). My question sees to practical code to learn from. What would be a good primer, or ...
7
votes
1answer
368 views

How can latex help me format and present lots of data in a report?

At work I am responsible for creating information security reports that contain long narratives and reference what we refer to as "vulnerabilities". These vulnerabilities are presented in a table. I ...
7
votes
1answer
42 views

Patching/Preventing effective code in a package

Consider a command being defined in a package (or used from another package), say \somethingstupid and being used before \endinput within the package, doing some non-typesetting setup (coloring, ...
7
votes
1answer
140 views

How do counts differ from numexpr

To do basic arithmetic on numbers, one can utilize TeX counts, \newcount\c \c=2 \advance\c 3 \typeout{\the\c} LaTeX counters \newcounter{c} \setcounter{c}{2} \addtocounter{c}{3} \typeout{\thec} ...
1
vote
1answer
43 views

Beamer style file: footline drops out of slide if used only from slide 2 on

I'm in the process of creating a style file for a Beamer presentation. Most things are straight forward but I have some issues with the footline. In particular, I don't want a footline on the title ...
1
vote
1answer
41 views

option for title page in custom package

I have made my own package which loads some packages and setup a custom title page using the following % Title and author \makeatletter \def\@maketitle{% \newpage %\vspace{-\topskip} % ...
2
votes
0answers
57 views

HowTo create a LuaLatex package

I would like to develop LuaLatex packages. I am very interested by the scripting capability of LuaLatex, so I'd like to use it as much as possible instead of Latex or Tex. Is there a "standard" or ...
12
votes
3answers
250 views

What to put into the dtx file?

Many packages are written as a single dtx file from that everything that composes the package is extracted. Apart from documentation and package code (the sty or cls), the installation instructions ...
2
votes
0answers
91 views

Throw error if font is not defined

I need to throw an error, should a certain font not be installed. I have a font in a subfolder: /font/NinjaFont.ttf. This must be installed via certain commands (not important for this - but here: ...
4
votes
1answer
59 views

Boolean option in style file does not work

a while ago, I learned on StackExchange that I could create a style file to contain my preamble and, in particular, to include Boolean switches so as to select certain parts of the preamble as needed. ...
0
votes
0answers
45 views

Help with making a package

I'm trying to design a package so that I can 'theme' a document quickly. I've done this, but as a sort of academic exercise I'm trying to design an option compact that adjusts margins, title, and ...
6
votes
2answers
310 views

Problem with catcode of @ (at-sign) in a package

I have put the following in example.tex: \catcode`\@=13 \let@\IND The problem is when I want to use my package eexxample.sty that contains example.tex, the comand @ won't come out, it will turn ...
3
votes
1answer
49 views

Custom .sty warning on specific command

I am writing a custom .sty file and I notice that it can break if a certain command, native in Latex, is called. I would like to throw a warning to the user and say "Don't use this command!". I know ...
4
votes
1answer
80 views

How to automatically detect encoding of the tex-file?

I have a custom .sty-file in cp1251 encoding which is defines \RequirePackage[cp1251]{inputenc}. I use it for compile with pdflatex in the same encoding, But when I try to compile some file with other ...
1
vote
1answer
64 views

How to install a package written by myself? [duplicate]

I have a question. How can I install a package written by myself with MikTeX? I first made a .txt file than I wrote my package (code) in there. Then I renamed the .txt file to .sty . What should I do ...
3
votes
1answer
67 views

Checking the mainmatter

I need to check where the text (from package .sty), if it is in the mainmatter section, then include some headers \pagestyle{LL}, if the other then \pagestyle{plain} or some other. Construction ...
4
votes
1answer
45 views

Macro call from options declaring part of the package

I need to call my macro inside DeclareOption, but my macro is defined later (this is the main condition). \NeedsTeXFormat{LaTeX2e}[1994/06/01] \ProvidesPackage{MyBook}[2014/12/12] ...
3
votes
1answer
45 views

How to include package by some condition in custom package

I have my custom made package. I need to include (or activate) other package by some condition. \NeedsTeXFormat{LaTeX2e}[1994/06/01] \ProvidesPackage{MyPackage}[2005/01/22] ...
2
votes
1answer
54 views

Converting preamble file to the package .sty-file

I have a preamble.tex file which I use for my purposes in different documents. %description: Basic Article in Cyrilics % Based on a TeXnicCenter-Template by Gyorgy SZEIDL. ...
2
votes
1answer
187 views

Using Babel inside my own package produces option-clash error

I want to write my own package which provides an \affidavit command which produces some standard text in two languages (ngerman and english). Minimal working example of this package: ...
6
votes
1answer
92 views

Package versioning and backward compatibility

The third major curse of computer programming is backward compatibility. You have to fix bugs which will unavoidably be found. Some syntax is not really a good idea, and has to be modified to be less ...
2
votes
0answers
48 views

Creating an .sty file that is equivalent to \input{file}?

I'm trying to get the flashcard program Anki to accept my LaTeX shortcuts that I always include in the preamble through \input{...}. It seems like the software has now forbidden this practice as you ...
14
votes
1answer
265 views

What is the recommended way to respond to bug reports for font packages where the bug is caused by characters missing from fonts?

I received a bug report for ebgaramond-maths. Although the issue is clearly caused by my package in one sense, it is not clear to me whether there is anything which I should do about it beyond ...
18
votes
2answers
931 views

Kleinberg-Tardos style of book writing

I recently read a book Algorithm Design by Jon Kleinberg and Eva Tardos, which is written in a very unique style. This book doesn't have any typical LaTeX environments such as theorem, lemma, and ...
2
votes
1answer
442 views

Package Keyval Error: allcolors undefined

I am using the following template for writing a document in Latex but i am getting an error Package Keyval Error: allcolors undefined.. ...
4
votes
1answer
95 views

How to create a a package that can be installed by tlmgr?

I want to be able to use a proprietary font on a number of Linux machines for which TeXLive is installed locally (not through the package manager). I have followed How do I use TrueType Fonts with ...
1
vote
0answers
20 views

Where do I put custom packages in a directory structure for a large document? [duplicate]

I am writing a large document (thesis proposal) that I would like to break into separate files, with the following directory structure: . |-- ch/ | |-- chapter1.tex | |-- chapter2.tex | |-- ...
29
votes
2answers
299 views

How do I gracefully retire a package?

I maintain a LaTeX package which is obsolete. All its useful commands are provided by other packages, possibly with different syntax, but still the point is there is no reason for anyone to use my ...
3
votes
1answer
57 views

Something wrong with subscript code in sty file

Consider the following .sty file: % Den krævede LaTeX-version. \NeedsTeXFormat{LaTeX2e}[2014/05/01] % Pakkens navn. \ProvidesPackage{standardopsaetning}[2014/10/16 standardopsaetning] ...
3
votes
2answers
58 views

Command not 'legale' in .sty file

Consider the following style file goat.sty: \NeedsTeXFormat{LaTeX2e}[2014/05/01] \ProvidesPackage{goat}[2014/10/16 goat] \DeclareOption{mammalbirdfish}{ \makeatletter \begingroup ...
8
votes
2answers
107 views

How can I prevent LGR encoding from switching font size?

I am using 12pt fonts with what is essentially the article class. (That is, I'm using a custom class which is parasitic on article.cls.) In order to set an appropriate headheight for fancyhdr using ...
4
votes
1answer
248 views

Declare package options and loading packages leads to “options section” error

I'm trying to create a package with some options. However, whenever I declare options and load other packages, I receive the following error: LaTeX Error: \RequirePackage or \LoadClass in Options ...
3
votes
1answer
46 views

Add newcommands to a package with arguments

I want to make a package that has a bunch of commands that I define in all of my Problem Sets. I'm running into an issue where the compiler does not recognize commands that I define that have an ...
5
votes
1answer
73 views

In a package or parasitic class, when is it better to redefine a command and when is it better to define a new one?

When I'm working on a document for which I need special layout, I tend initially to accumulate a very long preamble. At some point, if I need to reuse similar layout regularly, I decide that I really ...
3
votes
1answer
140 views

\usepackage for \newenvironment

I am trying to create a package called lessonPlanner in which I declare some new environments via \newenvironment So I have something like ... mwe.tex \usepackage{lessonPlanner} \begin{document} ...
3
votes
0answers
38 views

How can solides3d know when one object is behind another?

pst-solides3d has an impressive graphics engine behind its design. I'm interested in knowing how it is able to know when an object is behind another object. Disclaimer: I am not sure this is an ...