{etoolbox} is a package which provides several macros which take advantage of the {e-tex} extension of (La)TeX.

learn more… | top users | synonyms

9
votes
1answer
62 views

Using expanded macro as search pattern for \patchcmd

Is there any way to use the value of an expanded macro as the search pattern for etoolbox's \patchcmd (or xpatch's \xpatchcmd, etc), so that one can have some sort of a "dynamic" patch, by way of ...
6
votes
1answer
102 views

Modifying an existing environment, but keeping the name

In my document, I want to follow the advice that says that quotes should be indented and set in a smaller font. Obviously, this is easily done with: \begin{quote}\small ... \end{quote} But ...
3
votes
1answer
42 views

row color and a toggle

I'd like to create a new command that I would repeat in front of each row, and which would colorize the row if a toggle is true, and would leave it uncolored if the toggle is false. I would change the ...
12
votes
1answer
133 views

Understanding etoolbox macro \deflength

The etoolbox package documentation says about \deflength: This command may be used as a drop-in replacement for \setlength. I am having trouble getting it to work with the \minof macro from the ...
3
votes
2answers
47 views

overloading functions of the fp package

I have a document with several commands that store numeric variables inside an extra macro. This extra macro will highlight that text so I can track them in the printed document. Like so: ...
2
votes
1answer
40 views

Reordering KOMA-Script title (not titlepage) in custom class

I'm trying to define custom styles for the KOMA-Script title which is later inserted using the \maketitle command currently using a mix of the KOMA-Script \setkomafont command and the \patchcmd ...
4
votes
1answer
50 views

Loading packages in custom class based on option

I'd like to define a custom documentclass for assignments which can be optionally passed the minionpro argument to use the Adobe Minion Pro font; if it's not set, the Adobe Utopia font (fourier) shall ...
6
votes
1answer
61 views

Set page counter to account for implicit omitted pages

I recently added an etoolbox toggle to let me choose between the paper or electronic versions of my document. \newtoggle{papier} Primarily, this disables coloured hyperlinks and coloured code using ...
4
votes
3answers
66 views

Etoolbox: how to compare two lists?

My wish is to have two different lists: \listone{a,b,c} \listtwo{a,c,d,e} and to have two macros: \iflistincludedAND{lista}{listb}{<true>}{<false>} which returns true if every item ...
2
votes
1answer
31 views

Problems to properly append chapter without numering to the table of contents

In my document I have a number of chapters, that have their numbering suppressed. I know that to append them to the table of contents one should use the \usepackage{etoolbox} and subsequently define ...
1
vote
1answer
26 views

lstlisting breaks ifbool block

I have the following piece of code: \documentclass{article} \usepackage{etoolbox} \usepackage{listings} \newbool{xyz} %\booltrue{xyz} \boolfalse{xyz} \begin{document} \ifbool{xyz}{ ...
3
votes
1answer
35 views

How can I prepend code to the \tableofcontents command using etoolbox?

This started by the need to have a table of contents entry in my PDF bookmarks. After accomplishing that, I decided that I wanted to have it always appear bold (supported as of PDF 1.4). I would like ...
3
votes
2answers
97 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
27 views

How to reduce the spacing for empty dates in title (when using the titling package)

I am looking for a marco which changes the behaviour of date (while using the titling package) in the case the date is empty. This MWE A should give a document as normal: \documentclass{article} ...
0
votes
0answers
24 views

Problem with \iftoggle and \notblank [duplicate]

I'm having a problem passing parameters through \iftoggle to a \newcommand using \notblank inside; it's much easier to explain by showing a small example: \documentclass{article} ...
1
vote
1answer
41 views

Detect first visibility in a Beamer frame

I'm manipulating a global macro, say \mytext, that I print on every slide. I would like to incrementally add data to that macro in a natural way: \frame{ MyText: \mytext ...
4
votes
1answer
67 views

Problem changing spacing for equation environment

My document needs a line spacing of 1.5, if I set this line spacing using the setspace's \onehalfspacing command, or using \linespread{1.5}, the equation environment is also affected. The effect of ...
2
votes
2answers
78 views

Set comment toggle to false, error: Undefined control sequence

I want to toggle comments of and on. Off works, but when I set toggle to true, then I get an error: ./main.tex:36: Undefined control sequence. \endtcolorbox ->\unskip \tcb@after@box ...
3
votes
1answer
49 views

Expanding code in etoolbox's \ifblank

I am trying to use the etoolbox \ifblank (and its cousin \notblank), but I want to expand any macros in its test statement. For example: \documentclass{article} \usepackage{etoolbox} ...
1
vote
0answers
39 views

Set comment toggle to false, error: There's no line here to end [closed]

I want to show/hide comments when toggeling the code below: \newtoggle{comments} %\toggletrue{comments} \settoggle{comments}{true} %set true to show all comments, set false to hide all comments ...
1
vote
1answer
63 views

REVTex-like affiliation& author command

I am trying to implement my own version of \affiliation and \author to use in my posters. I would like to have options to show indices of affiliations in the form of \arabic, \alph and \fnsymbol. ...
2
votes
1answer
96 views

Is “group=false” option from “standalone” package incompatible with “\addbibresource” from “biblatex”?

Edit. I edit my question in order to make it clearer. Preamble. Thanks to filecontents environment, the compilation of the following with pdflatex generates two subfiles: a bibliographic file: ...
7
votes
4answers
208 views

How to check if a macro expands to one of several strings?

I have the following problem: I am using the etoolbox package to check if a macro (say, \foo) expands to one of several possible strings (say, bar, baz, abc, or other). I need to execute different ...
16
votes
1answer
252 views

Patching commands in LaTeX3

Is there some facility in the LaTeX3 kernel to modify existing commands like etoolbox's \preto \appto and \patchcmd do?
4
votes
2answers
111 views

“Runaway argument?” just in the \input file

Update: Upon @egreg suggestion, the case shown below is the core of the problem and has nothing to do with include/input statements. I have a verbatim within toggle statements, which fails. A minimal ...
4
votes
1answer
145 views

MakeUppercase and chapter font

I'm using the \MakeUppercase command (from \textcase) (but also tried \MakeTextUppercase cos I thought the problem might be caused by the math-environment of the chapter number) and the ...
1
vote
0answers
27 views

Inverse Search with etoolbox

I have a collection of documents, all of which contain a common "sub-document" using the subfiles package. These different master documents all define various booleans using the functionality from ...
1
vote
0answers
92 views

sans serif math font selection using unicode-math

I am typesetting a document in XeLaTeX using a serif font for main text, and a sans serif for everything else (section titles, tables etc). For setting of mathematics, I use TeX Gyre Pagella Math. ...
3
votes
2answers
48 views

ifthen and etoolbox cause faulty index

I am using the ifthen package to include/exclude passages in my document. However, I have noticed that when I have two formatted index entries for the same term, one inside \ifthenelse and one ...
5
votes
3answers
203 views

Generate multiple PDFs for different document versions in a single build

I am writing a document for a software which has two versions. Most of the content in the document is the same except few specific details. Right now, I am using the conditionals to build the document ...
1
vote
1answer
48 views

why is adding `breqn` package breaks `etoolbox` command?

I was trying egreg nice answer here in my main document, and I found it does not work there. It turned out it is because I happened to be using another package which is breqn which I really need. I ...
2
votes
2answers
132 views

How to use bashful package from inside etoolbox list processing?

Given list of file names, I wanted to obtain the word count of each file, but by using either \forcsvlist or \docsvlist and pass the file name to bash from Latex without hardcoding the file name in ...
4
votes
3answers
74 views

\forlistloop of etoolbox reference requested

I am having a problem of using the command of \forlistloop of etoolbox unlike the way of typical C program where int a[5] for ( i = 0; i <5; i++) { a[i] } one could access i I am not sure ...
15
votes
6answers
954 views

Loop within another loop in LaTeX

I am trying to create a loop within another loop using some of the constructs in etoolbox but I am not sure how to create that. I want to get the output like in C. pseudo code for (i in the list) { ...
2
votes
1answer
74 views

etoolbox package explanation requested

I am trying to understand the following package etoolbox. I am unsure about the meaning of the following syntax since I am not sure what is the correct question to ask in google or in the book of ...
4
votes
1answer
79 views

\AtBeginEnvironment not accepting parameters in the code

etoolbox's docs say in the section on environment hooks: Parameter characters in the code argument are permissible and need not be doubled. However, this won't compile: ...
3
votes
1answer
37 views

Using apptocmd inside newenvironment

I try to produce a document containing an exam and the associated correction. I want automatic hyperlinks from the question to the associated answer and vice-versa. Using the solution given by ...
3
votes
1answer
76 views

Conditional section title [ifthenelse] not working

I have the following code: \documentclass{article} \usepackage{ifthen} \usepackage{amsmath,amsfonts,amsthm,amssymb} \newcommand{\probName}{}% \newcounter{probCounter}% \setcounter{probCounter}{1} ...
3
votes
1answer
400 views

Possible LaTeX package to maintain simultaneous text translations

Context: In the text of a document I am planning I will have numerous "strings" that are in a foreign language (foreign to me of course). My current plan is to use the glossaries package because ...
3
votes
1answer
41 views

How to set single spacing for all quotation environments? (Bug in etoolbox?)

I found an answer to the question here: Reduce the space between a quotation and a title. But for some reason the result is highly dependent on the code formatting and hence error prone as shown by ...
2
votes
1answer
70 views

Comparing strings in a class file

I am modifying a correctly functioning class file to add some capabilities. I need to compare two strings - a) \@stringtextfromuser and b) ABC. I have loaded etoolbox, and xtsring and have tried ...
5
votes
1answer
102 views

Section Title in thmtools List of Theorems

The thmtools package provides a \listoftheorems command that generates a list of theorems/definitions/etc. Here's a MWE: \documentclass[12pt]{article} \usepackage{amsthm,thmtools} ...
3
votes
0answers
41 views

etoolbox: problem with the last row in an table automated

I want to automate a long table as follows \documentclass{article} \usepackage{etoolbox} \newcounter{test} \newcounter{count} \begin{document} \begin{tabular}{|c|c|}\hline \whileboolexpr{test ...
0
votes
1answer
119 views

Here is a short bit of Latex code that keeps crashing. Why?

\documentclass[12pt]{leter} \usepackage[paperwidth=2.25in, paperheight=4in, margin=1mm, textwidth=1.85in]{geometry} % Define paper stock size here \special{papersize=2in,3.75in} \usepackage{etoolbox} ...
11
votes
1answer
292 views

what is the equivalent of \reserveinserts in latex 2015

The release 2015 of LaTeX has included features of the etex.sty package. However, it does not have included the \reserveinserts command. My questions is very simple: what is the mechanism to use to ...
4
votes
2answers
77 views

Problems with tikz-cd and etoolbox

I have started using tikz-cd and it seems there is a problematic interaction with toggles. In particular, when I try to add a second "column" to the diagram, the code breaks. More specifically, this ...
5
votes
2answers
237 views

Define a list variable

I am using etoolbox for list processing, specifically \forcsvlist. When passing the comma-separated list directly to \forcsvlist, it is able to parse each item in the list. However, if I define the ...
1
vote
0answers
81 views

Selectively add legend entries to plot on large CSV

I have a plot with 63 lines, only some of which I would like legend entries for. The full legend takes up half a page, and using the \ref method does not give me consistency with the surrounding ...
3
votes
1answer
92 views

\ifstrequal in tabular produces spurious spaces

I'm working on a LaTeX class for my university's thesis format, which requires signature lines on the title page. The sig lines are labelled differently depending on what kind of a thesis it is, so ...
10
votes
1answer
156 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 ...