Skip to main content

Questions tagged [xpatch]

{xpatch} is for questions addressing issues related to the generalization of the macro {patching} commands.

Filter by
Sorted by
Tagged with
0 votes
1 answer
37 views

Does IfPackageLoadedTF neutralize xpatch?

This is an admittedly strange question. The background is the suggestion from StackExchange to use package xpatch to keep latexmk running a TEX file although included graphic files or in this case ...
user2609605's user avatar
2 votes
1 answer
46 views

How to prefix and wrap title line text in a ToC (for chapters) in the book class? [duplicate]

I am searching for a way to include the text "Chapter" as a prefix to the chapter numbering in a ToC for a book class AND have the chapter title wrap to the left-most edge in the ToC listing....
Jeffrey J Weimer's user avatar
2 votes
1 answer
71 views

Package conflict between regexpatch and newpxtext

The new version of newpxtext seems to load xpatch, which would conflict with packages that use regexpatch. Is there some way to fix this? For example, is it possible to prevent xpatch from being ...
Jinwen's user avatar
  • 8,618
0 votes
1 answer
53 views

Cannot make index referring to line numbers list more than one instance

I cannot wrap my head around the existing examples like this. I am using the ekdosis package, which depends on the verse, and ultimately lineno to generate line numbers for a long verse based document....
Dotno's user avatar
  • 3
0 votes
0 answers
38 views

questions about \xpatchcmd, \ProcessKeysOptions in l3keys2e package, \ProcessKeysOptions in kvoptions package and \widowpenalties

i use nowidow package and \setnowidow, but some case it work not fine: for example, i hope paragraph can do page break at red place, but it doesn't. Then I test, if I change nowidow.sty, make \...
redmoon's user avatar
  • 101
0 votes
1 answer
25 views

How to use xpatch to replace some lines of the codes in "blx-caspervector-base.def"?

How to use xpatch to replace some lines of the codes in blx-caspervector-base.def from here, i.e., replace lines 55, 56, 70, 72 by the following codes respectively: andmore = {\bbx@cetext{\bbx@cnetal}{...
M. Logic's user avatar
  • 4,333
0 votes
1 answer
55 views

Add patch that define own font to a command

Can a new patch be added to the \mathit command to use fonts that are not controlled by math mode. I want math mode to use TeX Gyre Termes Math and v controlled by \mathit to use Computer Modern Code: ...
Мақсат's user avatar
0 votes
0 answers
221 views

Format fullcite of papers with highlighted own names and reduced author list

I want to print my own publications and show that I am an author by highlighting my own name. As some of the publications have over 100 authors I do not want to print all of them (would be ok with ...
Mareike's user avatar
3 votes
1 answer
97 views

Possible incompatibility between xpatch and hyperref package

I have lately been creating custom classes, and found that one of my desired commands, \xpatchcmd, did not work on some occassions. I spotted that loading of package hyperref is the culprit. For ...
marc's user avatar
  • 701
0 votes
1 answer
82 views

How to expand a macro argument into a string, remove all the spaces, then append and prepend the string inside a \NewDocumentCommand macro definition?

I want to expand a macro argument into a string, remove all the spaces, then append and prepend the string inside a \NewDocumentCommand macro definition. Here's my MWE using LuaLaTeX. \documentclass[...
Farrel Ahmed's user avatar
0 votes
0 answers
47 views

Patching a math command using regexpatch

I want to allow my inline math to break lines after \sim, which I'm using a lot. To this end, I've tried: \usepackage{regexpatch} ... \xapptocmd{\sim}{\allowbreak}{SUCCESS}{FAIL} ... $X \sim N(0, 1)$ ...
Migwell's user avatar
  • 143
2 votes
1 answer
61 views

Help with xpatch-ing a command from xkeyval: \setkeys

I'm trying to patch \setkeys from xkeyval, so that it includes a mask of keys to ignore completely when \setkeys is called. Note that \setkeys in called in various macros, and there is a lots of them, ...
artagnon's user avatar
  • 131
1 vote
1 answer
117 views

How can I patch `minted` to use `soul`s higlighting

I'd like to highlight code with a gray background like StackExchange does. I know that I can set bgcolor in minted to put a solid background color on inline code. However, this makes minted use ...
Eric's user avatar
  • 683
0 votes
0 answers
29 views

xpatch + listing + realboxes + mathmode gives wrong spacing

I stumbled upon a problem that was quite hard to reproduce as it seems it required a very specific combination of several packages to make the code compile and yet produce the problem. The problem is ...
SerkerN's user avatar
  • 73
0 votes
1 answer
214 views

Biblatex - changing pages and publisher/address fields. Inproceedings/incollection

I'm looking to change the order of the fields in biblatex for @inproceedings and @incollection so that the pages field comes before the publisher and address fields. This ordering for book chapters ...
Grey's user avatar
  • 27
1 vote
1 answer
348 views

How to create more options for \tkzTabLine?

I use \usepackage{tkz-tab} to create sign tables. For example, to determine the solutions of the inequality below we use the table: which is generated by the code: \documentclass{article} \usepackage{...
Chilote's user avatar
  • 189
2 votes
1 answer
175 views

Patch command by adding new (optional) arguments (and turn `newcommand` into `NewDocumentCommand`)

In a package, I'd like to customize an existing macro by adding an optional argument to control the size of an image. However, I've no idea how to patch a command to add arguments. Ideally I'd love to ...
tobiasBora's user avatar
  • 8,964
0 votes
1 answer
76 views

IEEEtrantools breaks restated theorems (thm-restate)

I really like this question/answer ("patched theorem defintion" in the minimal example) and I wanted to adapt it to my custom dissertation class file. However, I ran into some problems with ...
Robert Seifert's user avatar
0 votes
1 answer
160 views

Split the \@author list at \and without redefining \author or \@author

In trying to answer another question, I would like to split the \author command by author (that is, at each \and) and then for each author give author and affiliation separate fonts---without using ...
Fredrik P's user avatar
  • 1,418
3 votes
2 answers
269 views

Patching \usepackage / \RequirePackage

I want to implement automatic benchmarking for the packages I load (some of which are my own). Right now my preamble takes 15 seconds to load, much longer than the rest of my document seems to take to ...
r0uv3n's user avatar
  • 33
1 vote
0 answers
45 views

cdcalendar error : Undefined control sequence [closed]

I'm trying to compile cdcalendar code download from: https://github.com/liantze/cdcalendar I and using texlive2020 and keep getting the errors shown in: How can I begin to fix the errors ? Thank you!
Manh's user avatar
  • 11
0 votes
2 answers
84 views

How to escape #1 using xpretocmd

Take this MWE: \documentclass{article} \usepackage{acro} \DeclareAcronym{ram}{short=RAM, long=random access memory} \newcommand{\test}[1]{RAM} \usepackage{xpatch} \begin{document} \test{ram} % This ...
bers's user avatar
  • 5,464
6 votes
2 answers
354 views

How to use \xpatchcmd with a macro containing \@

I have the following reduced example: \documentclass[a4paper]{report} \usepackage{xpatch} \def\foo{Foo} \def\bar{Bar} \def\mycommandA{i.e.\ \foo{}} \def\mycommandB{i.e.\@ \foo{}} \tracingpatches \...
jrtc27's user avatar
  • 161
1 vote
1 answer
113 views

xpatch bug in texlive 2019?

I am running the slightly modified example with pdflatex and then makeindex (makeindex -s nomencl.ist -o myfile.nls myfile.nlo) \documentclass[]{article} \usepackage{xpatch} \usepackage{nomencl} \...
pluton's user avatar
  • 16.5k
1 vote
1 answer
68 views

Expl3 syntax breaks biblatex xpatch patching

Using \ExplSyntaxOn breaks \xpatchbibmacro. Can this be fixed, or will I just need to use xpatch commands elsewhere? MWE: \documentclass{article} \usepackage{expl3} \usepackage{xpatch} \usepackage[...
TakingItCasual's user avatar
0 votes
2 answers
58 views

Why is code appended to \endabstract still indented?

I'm trying to automatically append "keywords" (defined in the preamble) to the end of the abstract environment. The keywords should not be flush with the abstract, but flush with the body ...
jessexknight's user avatar
  • 2,824
0 votes
0 answers
95 views

xpatchcmd patch to makeindex

I want to use zhmakeindex to generate indexes in the language of Chinese, with an investigation of the package imakeidx, I try to patch the \imki@exec as \xpatchcmd{\imki@exec}{\imki@program}{...
user19832's user avatar
  • 1,585
3 votes
1 answer
291 views

Patch `pmatrix` with optional arguments

I need to patch the math command pmatrix with optional arguments. For example, I'd like to patch the following code, while treating it as immutable. \[ \begin{pmatrix} & a & b\\ c &...
Zlatko-Minev's user avatar
1 vote
1 answer
55 views

Add code before/after H type floats only

I would like to patch my [H] floats with some vertical space as it appears inconsistent with [h] and other type floats. I am using KOMAscript Is there a good way to put code before/after the ...
likethevegetable's user avatar
1 vote
1 answer
672 views

Using Koma-script for defining ToC for each chapter

I try to use solution suggested by @esddd in the question "Replacement minitoc package style by KOMA-script possibilities", but unfortunately I came across the following problem: As you can see above,...
JardaFait's user avatar
  • 3,974
0 votes
1 answer
80 views

\xpatch fails if \PassOptionsToPackage{french}{babel} is used

Everything works fine if I do not use \PassOptionsToPackage{french}{babel}. My document class abntex2 already loads babel, then, to load the french language I need to use \PassOptionsToPackage{french}...
user's user avatar
  • 4,815
0 votes
1 answer
98 views

How to replace a command argument as #2 with something else?

I am trying to patch this macro: \xshowcmd\addcontentsline > \addcontentsline=macro: #1#2#3->\begingroup \let \label \@gobble \ifx \@currentHref \@empty \Hy@Warning {No destination for ...
user's user avatar
  • 4,815
0 votes
1 answer
79 views

How to increase memoir table of contents spacing between appendix and its hyphen?

After patching (manually, i.e, directly editing memoir's code), this: It should look like this: I tried to patch the memoir using xpatch. This patch I did would work if it was finding the correct ...
user's user avatar
  • 4,815
1 vote
1 answer
209 views

Shedding light on `\patchcmd` and `\@gobble`

In the code below I expected \@gobble to replace \@makechapterhead inside \@chapter, and thus gobble its argument (#2), so that the associated feature, make a chapter head, is disabled. But it doesn't....
Erwann's user avatar
  • 2,130
2 votes
1 answer
188 views

Using xpatch to alter \sectionlinesformat to change format for appendices headings with KOMA-Script

I'd like to change the way appendix section headings appear with KOMA-Script. I can achieve the behaviour I want by manually patching the \begin{appendices}... with a \renewcommand{\sectionlinesformat}...
likethevegetable's user avatar
1 vote
1 answer
138 views

How to use regexpatch with packages loading xpatch?

I have come to love the regexpatch package. However, the enotez package loads xpatch, and it seems you cannot load both xpatch and regexpatch. So how do I resolve this? Can I load regexpatch and mark ...
bers's user avatar
  • 5,464
0 votes
1 answer
67 views

Why xapptocmd is reducing the vertical space between \partname and \parttile?

Running this example: \documentclass[ 10pt, a5paper ]{memoir} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{xcolor} \definecolor{ultramarine}{RGB}{0,32,96} \RequirePackage{xpatch}...
user's user avatar
  • 4,815
1 vote
0 answers
156 views

How to patch each environment only within another environment?

I know how to patch environments using xpatch. But is there a way to patch environments only within a certain environment? For example, all tabulars only within sidewaystable?
Daniel's user avatar
  • 1,807
0 votes
2 answers
646 views

Problem patching by appending to \footnote command. "Missing \endcsname inserted"

I want to test whether a macro is (a) outside or (b) inside a \footnote command, similar to what's asked in (i) How to test if I'm currently in a footnote or not, (ii) Detect whether I'm in a \...
Jim Ratliff's user avatar
  • 1,049
2 votes
1 answer
1k views

How to include \noindent to a proof environment

I'm using amsthm to get the proof environment and xpatch to modify it a bit: \usepackage{amsthm} \usepackage{xpatch} % we need to substitute . with a generic command \xpatchcmd{\proof}{.}{\...
Mundron Schmidt's user avatar
3 votes
2 answers
741 views

Capitalize first letter of words in chapter mark

I would like to capitalize the first letter of several words in the chapter and the chapter mark. While text in the chapter itself is capitalized, in the chapter mark it is not. Here is a MWE of my ...
bonanza's user avatar
  • 2,181
0 votes
0 answers
29 views

Too many bookmarks for hyperref and xpatch [duplicate]

I use a lot of "Lists of" in my document, some of them are generated by \listoftheorems. To include these lists in my PDF-bookmarks, I use this answer. But actually this crashes, when too many ...
user1's user avatar
  • 2,226
0 votes
1 answer
2k views

biblatex & biber : \textcite without parenthesis around year

I should submit a paper with lots of math, but there is not an available latex class for the journal. However I want to use latex and biblatex (with biber). The journal specifies, in particular, that:...
Fabio's user avatar
  • 101
3 votes
1 answer
128 views

Why does this patch to multicol have no effect?

Update 19/12/18: I've now turned this into a full package to manage decorative rules, called multicolrule. I was trying to extend the solutions here and here, which replace the ordinary rule between ...
Karl Hagen's user avatar
  • 1,538
19 votes
2 answers
10k views

How to improve machine-readability of a CV created in LaTeX with moderncv?

Some background story. I recently send my CV to a free online evaluation. The reply showed that although the document looked visually appealing, it was bad for ATS (Applicant Tracking System). These ...
phollox's user avatar
  • 554
1 vote
1 answer
193 views

Patching tikzscale

I'm trying to patch the package tikzscale. Specifically, I want to remove the following lines from the package, as it does not constitute a useful error in my usecase[1]. \tikzscale@ifSizeDifference{\...
Firnagzen's user avatar
  • 111
4 votes
1 answer
284 views

Using different counter for Index (makeidx)

I have a question similar to this question: I'm using makeidx and I want the index to use a different counter than \thepage. My code looks like this: \documentclass{scrbook} \usepackage{makeidx} \...
Jo Arno's user avatar
  • 71
0 votes
0 answers
81 views

Forcing cleverref to use another numbering system

I am fighting with this problem for a while now and all my partial solutions just don't fit together. I have to manage quite a few lists in a latex document and each entry has a certain ID like [X1234]...
Moraxno's user avatar
  • 33
2 votes
2 answers
208 views

xpretocmd: Why are my arguments not working?

I just tried to keep track of my current chapter name, because I use the first letter for certain namings in my document, so I wrote this code to save it: \documentclass[12pt,a4paper]{scrreprt} \...
Moraxno's user avatar
  • 33
1 vote
1 answer
331 views

Customizing chorus in songs package

I'm trying to customize the chorus of the songs package but I can't figure out why the first line isn't aligned properly. the R should be at the same position as the verse number (1.). I used xpatch ...
EverydayNormalGuy's user avatar