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

learn more… | top users | synonyms

1
vote
1answer
21 views

\@currname not working in MikTeX

A few weeks ago (like maybe 5?) \@currname worked fine. Then I guess I updated MikTeX, which I do pretty often, and now it doesn't. MWE: % scrap.sty \title{1\@currname2} % scrap.tex \documentclass{...
0
votes
0answers
30 views

Call of a package in general. Access and visibility of stylefiles

i.e. the moderncv-package has several sty-files (i.e. moderncvbodyi.sty). Apparently, I can not call \usepackage{moderncvbodyi} from another document than a moderncv-document. This means, that the ...
2
votes
0answers
37 views

Conventions of package documentation

Are there guides on conventions when it comes to writing documentation for a package (especially one in a .dtx file as opposed to a separate document). I finished my first non-trivial package and ...
0
votes
1answer
50 views

Using Foundation icons in LaTeX document

I have the fontawesome package in mind when asking this question? In fontawesome you can invoke the given symbol by typing its code to get it in the document. For example, \faCircleArrowDown gives the ...
5
votes
0answers
114 views

Looking for someone to help me finalize and distribute a class file [closed]

I'm not sure this is the right place to ask but I don't know where else to go ! I've been working on the design of my lecture notes for a little while and now that I'm happy with the result, I would ...
0
votes
0answers
35 views

A template for documentation for ctan

I got my Fill-Pages-Package (hopefully bug free) ready, which is my first package. Now I want to upload it on ctan. But first there must be a documentation. I've been searching for a template for the ...
1
vote
0answers
42 views

What is this wacky definition of \@makefnmark trying to accomplish?

A journal style file that shall remain nameless contains this code: \def\thestandardf@@tnote{\@arabic\c@footnote} \def\@makefnmark{% \hbox{% \ifx\thefootnote\thestandardf@@tnote \@...
1
vote
1answer
25 views

How do I write a basic .sty to call a custom Type 1 font I have installed?

I have installed several custom Type 1 fonts for use with pdflatex. The fonts work normally if I call them with \renewcommand{\<rmdefault/sfdefault/ttdefault/etc>}{<fontname>} I ...
3
votes
1answer
38 views

Use temporary length \dimen255, temporary count \count255

This Question is mainly important for package writing: I read in the TeX-Book that \count255 and \dimen255 are traditionally used for temporary. Now the number of registers has risen (see this ...
7
votes
1answer
51 views

How can I generate precisely one warning within a tabularx environment?

I realise this is an unholy mix of expl3 and LaTeX-2e, but most of my code is like this at the moment, unfortunately. I want to be warned when I fail to set a particular variable. More specifically, ...
15
votes
1answer
153 views

What is exactly a hook in etoolbox

I understand well the \apptocmd and related tools of etoolbox package. However, I still not understand what \appto<hook>{<code>} and related do, even reading three time the handbook ? ...
21
votes
2answers
1k views

In 2016, what are the advantages and disadvantages of the different methods to create a package?

Now we need to make some choices between TeX, LaTeX2e, LaTeX 3, ConTeXt(LuaTeX), LuaLaTeX, XeTeX, XeLaTeX and... I don't specially like the syntax of L3 but recently I was impressed by very ...
6
votes
2answers
68 views

Giving numerical value to a package

I am playing around with making a package for some of my LaTeX commands and environments. The problem I am encountering is that the package will need to take a numerical value, which have a default ...
118
votes
7answers
43k views

Style/class tutorials

What are some good tutorials on writing custom styles (classes) that clearly explain commands used and some of the features that TeX has to offer in the way of styles?
3
votes
1answer
81 views

Modify page behaviour in a cookbook .sty file to manage complex recipes

I'm trying to edit a .sty file for the typesetting of recipe books. It's a modification by Alexis Flesch of cookybooky: link to the full package (with output) The problem is that the code is ...
3
votes
1answer
81 views

How to put the section head on the same location as a slide title when using slidepage

I am developing my own beamer theme. As part of the theme I want the section slides to have the section title on the same position as the other slides. At this moment the position is a little off. ...
6
votes
1answer
50 views

Package for special treatment of sequences of capitals

For linguistic writing, I frequently deal with input data where sequences of capitals should be typeset not as capitals, but should be treated specially, e.g. be typeset in lower case, small caps. ...
2
votes
1answer
43 views

How to check if a macro can be followed by a newline

I'm trying to create a class that allows you to define a name using \name{Whatever} This is defined as \newcommand{\name}[1]{\def\gsy@name{#1}} Whatever is passed to this is used in the header, ...
3
votes
0answers
52 views

Tikz version history information

I'm working on a package that works on top of tikz. It needs certain libraries (the tikz libraries quotes, positioning and intersections and the pgf library arrows.meta). Is there any way I can ...
4
votes
1answer
58 views

(is there/how to make) a package/macro like `enumerate` but for whole document sectioning

I just discovered the enumerate package, what excited me because some time ago I was wondering about something similar (options where a stands for \alph{<counter>}, A for \Alph{<counter>}, ...
4
votes
0answers
27 views

Consolidating similar packages [closed]

Are there any efforts being made towards consolidating packages with overlapping features? If I created a package that could provide extra features to another package, is it expected that I share this ...
2
votes
0answers
33 views

List of package requests?

I have recently entered the realm of package development and uploaded my first package to CTAN. Is there a master crowd-sourced list somewhere of issues/abilities that people would like to see solved/...
6
votes
1answer
51 views

l3doc adds unwanted backslash in margin box of {function}

I'm using l3doc for documenting some packages (I know it is not officially stable, but I like it …). I came to the problem that {function}{<list>} adds a backslash for every item in <list> ...
3
votes
1answer
43 views

“Extra \fi” error when defining mutually exclusive package options with conditionals

I have been trying to create a package, which loads the babel package and sets the language with an option. I've been getting strange errors when trying to define mutually exclusive package options, ...
2
votes
1answer
117 views

Fixing a LaTeX thesis style issues with formatting section headings

I am fairly new to LaTeX, but I decided to take it upon myself to use the .sty file the computer science department at my school had for the university's thesis style. As it turns out, there are a ...
16
votes
2answers
124 views

What is the simplest way to extract a URL from a .bib entry for use in \href{}{} (probably using Biblatex)?

I am trying to define a new macro with the following syntax: \citeimg*{<bibkey>} The unstarred form should simply produce \citeauthor{<bibkey>}, \citetitle{<bibkey>}, \citeyear{&...
29
votes
3answers
940 views

When to use TeX vs LaTeX for package writing

So I got into the whole idea of learning plain TeX (or what I think is plain TeX) and it's been very fun and rewarding. I also started writing some macros/packages for my personal use for now. Since ...
4
votes
1answer
174 views

Option argument for Beamer section slide

I am creating my own Beamer theme with a custom section slide. Ideally I would like the command \frame{\sectionpage} to have an additional, optional argument, that specifies the color of the ...
4
votes
1answer
60 views

How to display the dates in the \PrintChanges' changes?

An information I'm often missing when I have a look at the "Change History" of a package/classe is the dates of the changes because, IMHO, just the version number is not informative enough: if I could ...
1
vote
1answer
293 views

thmtools: “Your backend doesn't allow styling theorems” warning

I'm writing a package. Here is a part of it which should be enough for people to try reproducing my problem: %[…] \ProvidesPackage{mworks} %[…] \RequirePackage{amsmath,amssymb,amsfonts,nicefrac} \...
14
votes
1answer
159 views

Determine File Name and Line Number Where a Macro is Invoked From

Wondering if there is any way to print out (for debugging purposes) the file name and the line number from where a macro is invoked (not where it is defined). My attempt to use the currfile package ...
0
votes
0answers
41 views

Create your own style [duplicate]

I know this question has been asked many times, but I could not find a good answer for my question, yet... I wanted to develop my own thesis style i.e. \usepackage{harthesis}, which I did, but when I ...
0
votes
1answer
23 views

Placing the abstract on titlepage in custom class

Imagine I want to include my abstract to my titlepage. I would do something like this: \documentclass[10pt,english,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \title{My ...
3
votes
1answer
114 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 "...
4
votes
1answer
50 views

Are dynamic defaults possible with kvoptions?

I'm writing a package with two options; one of the defaults should change, depending on the other option. Currently, the definitions are: \SetupKeyvalOptions{family=gitlog,prefix=gitLog@} \...
5
votes
1answer
57 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 ...
28
votes
1answer
612 views

How does \usepackage differ from a simple \include or \input?

What does \usepackage do that is different than \input or \include? Does it simply import the commands in the package file to the current document or is it more complicated?
6
votes
1answer
44 views

Is it possible to implement a package dependency which is version specific?

This question should really ask what is the best way to implement a version-specific package dependency. However, if I try to ask that, the system threatens to close my question. In this answer, ...
22
votes
1answer
1k views

What date should I specify in the optional argument of \NeedsTeXFormat?

Subsection 4.1 of LaTeX2e for class and package writers contains the following passage: \NeedsTeXFormat {⟨format-name⟩} [⟨release-date⟩] This command tells TeX that this file should be ...
19
votes
2answers
713 views

Write new package with LaTeX2e or LaTeX3

I’m planning to create a package and I wonder if it’s better do do this with LaTeX3 syntax or the „old“ LaTeX2e, which is the one I know. Will LaTeX2e packages be supported by LaTeX3? I can give ...
7
votes
1answer
293 views

Creating a ConTeXt/LaTeX hybrid module

I have a simple titlepage, which I want to make available for ConTeXt- as well as LaTeX users. Each should just type \usemodule[myTitlepage], or \usepackage{myTitlepage}, respectively. I want to do ...
132
votes
4answers
20k views

Where do I start LaTeX programming?

I'm interested in writing packages for TeX/LaTeX/XeLaTeX. I googled around, but all I found was guides or tutorials about how to prepare documents using LaTeX. I want to know how LaTeX works and how ...
8
votes
2answers
250 views

Encrypt and decrypt parts of text in a LaTeX source file

Assume that you have some text in parts of your LaTeX document that you only want people with a password to see. A reason could e.g. be a case with an guiding answer. You want to make the case public ...
1
vote
1answer
167 views

Has anybody implemented Society of Automotive Engineer (SAE) style bibliographies with a biblatex/biber solution?

There already exists an SAE class on CTAN contributed by Axel Franke, which although it is 15 years old (last update 2000-11-14) is still workable with a few tweaks, I think. The problem I am facing ...
13
votes
2answers
181 views

The following code compiles without error. How can I change that?

Unlike most questions on this site, my problem is that my code compiles without error and I do not want it to. I want to be able the check whether \command is defined and to do something if it is ...
3
votes
1answer
199 views

change title page margins ONLY without packages

I am trying to prepare a package for students that offers a uniform standard title page for their work (homework, reports, theses, and probably more). I have the title page laid out as it should be. ...
1
vote
1answer
38 views

How to \clist_set in \msg_new?

Is it possible to process a comma separated list within a LaTeX3 error message? For example I want to define a message for unknown values to a .choice key like in the following example. I use \test ...
4
votes
2answers
85 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 ...
1
vote
0answers
87 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 ...
5
votes
4answers
146 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 ...