Skip to main content

Questions tagged [hooks]

{hooks} are macros (or placeholders) stored at specific locations inside other macros that can be redefined to the user's specifications, thereby "hooking into" the macro at that specific point.

5 votes
2 answers
177 views

Consider the following MWE, where I use a custom class test which loads the libertinus fonts and sets up selecting StylisticSet=2 in order to obtain a more harmonious italic J, as proposed in this ...
schtandard's user avatar
  • 17.9k
2 votes
1 answer
99 views

For context, I want a/some function(s) to only be defined in certain environments. I found (after much failed bodging on my part) the delightful function \AddToHook so I can use \AddToHook{env/myenv/...
grepgrok's user avatar
  • 225
1 vote
1 answer
68 views

I want to assemble some boxes onto the page through which text should flow. I know that there are already some packages that solve this, but I would like to better understand the underlying logic of ...
Jasper Habicht's user avatar
2 votes
1 answer
76 views

Description: I make a colorful ornament line style switch with new chapters: First Chapter: red Second Chapter: blue Third Chapter: red Fourth Chapter: blue I manage to use hook as below, but it ...
Explorer's user avatar
  • 8,745
10 votes
1 answer
156 views

After the June update of TeX Live, the catcode of `return' (^^M) in the shipout hook changes from 5 to 9. Is this intentional behavior or a bug? If intentional, what is the purpose of this? Here is an ...
hair-splitter's user avatar
6 votes
2 answers
178 views

The following MWE worked perfectly in the past with TeX Live. \documentclass{article} \usepackage{pgfornament} \AddToHook{shipout/foreground}{\pgfornament[anchor=north west]{31}} \begin{document} text ...
hair-splitter's user avatar
0 votes
0 answers
36 views

If I specify some settings for a every display style listing via \lst@AddToHook{\lstset{...}}, it will be impossible to overwrite this setting by passing local options to the listing. \documentclass{...
Gargantuar's user avatar
  • 2,446
3 votes
2 answers
147 views

I'm trying to locally change some frame settings in beamer. For example, the code \documentclass{beamer} \begin{document} \AddToHookNext{env/frame/before}{\bfseries} \AddToHookNext{env/frame/after}{\...
Gargantuar's user avatar
  • 2,446
3 votes
2 answers
189 views

I would like to change the bottom margin on the first page of a two-column article (that can sit somewhere in the document, so is not necessarily the first page of the document) without inserting a ...
Jasper Habicht's user avatar
3 votes
2 answers
126 views

I am trying to output some material (e.g., a character) at the begin of every paragraph. That is, if the paragraph begins with the letter 'A', then there should be first my material (e.g. the letter '...
Binarus's user avatar
  • 453
6 votes
1 answer
123 views

Setup Windows11; TeXLive2024; WinEdt11; PDFLaTeX. The statement of my problem I intended to apply this method to insert one blank page after every current page of document partially(locally). As is ...
JohnsonL's user avatar
5 votes
2 answers
200 views

In the following, I'm adding a label to a caption thanks to \AddToHook{cmd/caption/before}. This works well, except if the caption package is used: LaTeX Warning: Reference `foo1' on page 1 undefined ...
Denis Bitouzé's user avatar
-1 votes
1 answer
191 views

This is an MWE distilled from a quite big system where the error messages are even more cryptic. MWE: \documentclass{article} \usepackage{MyStyle} \begin{document} \PopDefaultHookLabel Case 0: %\...
DLyons's user avatar
  • 545
1 vote
2 answers
152 views

For reasons, I have code that puts a hook in cmd/par/after (for this MWE, this will be the stupid \vskip 2cm). I know that many parts of LaTeX interact and redefine \par and this can break hooks, as I ...
ysalmon's user avatar
  • 1,304
0 votes
1 answer
96 views

I have a command that typesets source code, and the text it produces ends with \par. For simplicity, let say we have \NewDocumentCommand{\commandFromAPackage}{}{line1\par line2\par} Sometimes, I ...
ysalmon's user avatar
  • 1,304

15 30 50 per page
1
2 3 4 5
��
10