Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [xpatch]

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

0
votes
1answer
29 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}...
0
votes
0answers
17 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?
0
votes
2answers
45 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 \...
2
votes
1answer
39 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}{.}{\...
2
votes
2answers
88 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 ...
0
votes
0answers
15 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 ...
0
votes
1answer
91 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:...
3
votes
1answer
48 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 ...
12
votes
2answers
622 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 ...
1
vote
0answers
42 views

regexpatch \xpatchcmd fails in patching command begins with space

The \xpatchcmd provided by regexpatch fails in patching command which begins with space. The same \xpatchcmd provided by xpatch works alright. Some version info: XeTeX 3.14159265-2.6-0.99999 ...
1
vote
1answer
97 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{\...
3
votes
1answer
47 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} \...
0
votes
0answers
65 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]...
3
votes
2answers
66 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} \...
1
vote
1answer
75 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 ...
1
vote
1answer
316 views

Override All Header and Footer Styles for All Chapter Title and Content Pages?

Closely Related: - Create Separate Footer and Header for Chapter Title and Content Pages? 1. Use Case - Decoupling Layout from Content: Content Authors will provide TeX content via a web portal, ...
3
votes
1answer
116 views

Difference between regexpatch and xpatch

I'm trying to put individual names within my bibliographic entries into brackets, and trying to patch biblatex bibmacros for that, using the facilities of (rege)xpatch. In particular, I'm trying to ...
5
votes
2answers
132 views

Biblatex - xpatch bibmacro with unbalanced braces

I'm trying to patch biblatex's bibmacro cite using xpatch's \xpretobibmacro and \xapptobibmacro in a way that would require (I think...) to give unbalanced braces to the patch commands. Namely, I'd ...
13
votes
1answer
363 views

Biblatex's bibmacros, bibliography drivers, formats - patch or redefine?

xpatch offers a series of patching commands specific to support patching of biblatex's bibmacros, bibliography drivers and field/names/list formats (not citation commands though, as far as I grasped). ...
1
vote
1answer
51 views

How to comment a package line before loading the package?

I can solve the issue bigfoot.sty:61: Package hyperref Warning: Option `hyperfootnotes' has already been used by commenting out the line 61: File: D:/User/Documents/latex/texmfs/install/tex/latex/...
2
votes
1answer
223 views

How can I modify a bibliography style to include annotations with xpatch?

I need to create an annotated bibliography using the biblatex-sbl package. I have managed to hack something together by creating a custom bbx file, but I was introduced to xpatch as a possible, more ...
1
vote
1answer
122 views

Use \xpatchbibmacro in ExplClass

I need to print the et al. output from \textcite{} (biblatex Pkg) in italics. As stated in this answer this can be achieved by using \xpatchbibmacro{} from the xpatch package. Having this command ...
0
votes
1answer
185 views

Why \PackageWarning is giving me LaTeX Error: Missing \begin{document} while patching standard latex list environment?

I wrote this code I started doing after on How to set \topsep=0pt on the latex standard list implementation inside an environment? I find out I could not change the standard latex \list{} environment ...
0
votes
1answer
350 views

How to set \topsep=0pt on the latex standard list implementation inside an environment?

Two attempts which not worked Herein there are 2 examples which did not work. Each attempt has written over it % Not works: \PassOptionsToPackage{brazil,main=english}{babel} \documentclass[10pt,...
2
votes
1answer
147 views

answerline command in exam class

I am trying to modify \answerline to do two things: have answer labels which could be different for each question; have the answers (just the answers and not the labels) done in a color of one's ...
0
votes
1answer
76 views

Conflict between titlesec and xpatch

I apologise if this question is too specific. I am trying to achieve centred 'part' titles in the toc (using xpatch) with a customised 'part-title-page' (using titlesec). I find that I cannot get ...
1
vote
1answer
133 views

How to have several list of figures (LoF) with KOMA?

There ist a great answer and solution to this question by Christian Hupfer, BUT it does not work with KOMA-Scriptwhich is a pity. The question is how to get several listof in one document? \...
1
vote
1answer
127 views

Patching commands does not work for /RenewDocumentCommands

I am using the moderncv class provided by TeXLive 2016 and in it the \section command is redefined as follows: \RenewDocumentCommand{\section}{sm}{% \par\addvspace{2.5ex}% \phantomsection{}% ...
4
votes
3answers
139 views

How to patch a macro with control sequences using regexpatch

I have partial success patching a macro with regexpatchcmd. I would like to patch a macro that calls another macros. The purpose is that every command in the patched macro becomes inside \string and \...
0
votes
0answers
28 views

Patch index entry

How do I patch a single index entry in Latex? My index file contains \targetindexentryy{Adorno, T. W.}} within the theindex environment. I would like to change it into \targetindexentryy{Adorno, Th. ...
4
votes
1answer
751 views

How to underline name of specific authors in biblatex?

My goal is to underline the name of specific authors in a bibliography processed by biber/biblatex. I can make them in bold following https://tex.stackexchange.com/a/73246/127979 and https://tex....
6
votes
1answer
267 views

Making `\AtBeginDocument{\pretocmd{\label}{##1}…` work

I want to patch \label, involving #1, and it seems that with hyperref, you have to do so after \begin{document} or using \AtBeginDocument. (The code should work without hyperref, too.) So this is what ...
4
votes
2answers
201 views

Error using `\verb` as the replace string on `\xpatchcmd`

On this code: \documentclass{article} \usepackage{catchfilebetweentags,regexpatch,verbatim} \tracingpatches \tracingxpatches \newcommand{\test}{testone (testtwo)} \begin{document} \xpatchcmd*{\test}{(...
3
votes
4answers
153 views

(x)patch a command the name of which is in another macro

I want to patch some command in a numbered list based on the current level (enumi, enumii, ...). Basically, I want to replace, in a command the name of which is stored in a macro, a macro the name of ...
2
votes
1answer
75 views

Add period after dashed authors, but comma after dashed editors (biblatex)

First I remove the parentheses around the year in the bibliography and add a period after the entry name with: \usepackage{xpatch} \xpatchbibmacro{date+extrayear}{\printtext[parens]}{\setunit*{\...
4
votes
1answer
106 views

xelatex and nag problem

Somet time ago xelatex stopped to compile my document. LaTeX Warning: You have requested package xpatch, but the package provides xparse. Package: xparse 2016/03/28 v6468 L3 Experimental ...
7
votes
2answers
158 views

Trouble with patchcmd and double #

I need to patch the following macro from gloss-greek.ldf (polyglossia): \def\greek@numbers{% \let\latin@alph\@alph% \let\latin@Alph\@Alph% \if@greek@numerals \def\greek@alph##1{\...
4
votes
1answer
262 views

xpatchcmd with placeholders

Is there an alternative to \xpatchcmd from the xpatch package which supports placeholders as in this virtual example: \newcommand{\mycommand}{this is important \foo this is not \bar but this is} \...
3
votes
1answer
141 views

Efficiently applying the same patch to several bibdrivers

In this answer to a question about getting Biblatex to print the ISSN field for books, I suggest a solution which uses the \xpatchbibdriver command of the xpatch package: \xpatchbibdriver{book}{% {\...
4
votes
3answers
210 views

Epigraph and fancyhdr: a patching problem

I would like to add epigraphs on my part pages using epigraph, but since I also use fancyhdr, I cannot get the proper page style on the part page using the solution given in the package documentation. ...
3
votes
2answers
541 views

How to patch with \xpretocmd and \xapptocmd a command by applying to it a macro with argument?

Suppose I'd like to patch a very complicated macro, say \autocite. For this, xpatch package is my friend. If the patch consists in applying a modal command which doesn't take arguments, such as \...
1
vote
2answers
273 views

Hiding headline when page contains \section

I use the {scrlayer-scrpage} package for headlines and footlines and want to hide the headline and headsepline when my page contains \section. I found a similar question here: Suppress headers when ...
2
votes
0answers
189 views

change or patch a command using parameters

Assume I want to use a command \foo from some package takes a number of arguments, let's say #1 to #5. I want to change the behavior of \foo in ways that might involve these arguments. For example ...
4
votes
2answers
1k views

temporarily patch a command (xpatchcmd)

for context: I'm writing a cv with moderncv. I like the looks of it, but the package doesn't appear to allow easy layout cusomitzations. What I want to achieve is one \section that formats a certain ...
6
votes
2answers
147 views

\xpatchcmd fails in a more complicate command

I've tried to patch the \minitoc@ command to add some additional vertical spacing after \mtctitle is used. (This is a question resulting from Adjust vertical spacing between minitoc title and contents)...
4
votes
2answers
197 views

Patching local commands defined within other macros

This is the follow-up - question, respectively the main cause which led to the (yet) unanswered question here: \xpatchcmd defines macros when applied to undefined commands I tried to patch some ...
10
votes
1answer
521 views

\xpatchcmd defines macros when applied to undefined commands

I stumbled over this feature (it's part of a bigger question, but I splitted it into two questions): Say, that we want to use \xpatchcmd (from xpatch) or \patchcmd (from etoolbox) and apply those ...
6
votes
1answer
242 views

How to patch a command from leipzig.sty

As shown in Issues with leipzig and glossaries used together, there is a problem when using the package leipzig with the glossaries package since the leipzig package relies on deprecated commands from ...
5
votes
1answer
150 views

biblatex: how to plagiarize a (book) entry type?

I'd like to provide a biblatex's entry type, bookreview, similar to the book one with the following differences: it supports an additional type=list,datatype=name field, reviewer (for the book's ...
1
vote
0answers
90 views

Biblatex \usepackage{xpatch} [duplicate]

In november i posted this question: @online bibliography biblatex The question was how to modify the bibliography to how i wanted it to look. I wanted the webpage reference to look like this: [#] ...