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

learn more… | top users | synonyms

4
votes
3answers
98 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
31 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
62 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
44 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 ...
14
votes
6answers
822 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
60 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
38 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
24 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
30 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
129 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
22 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
40 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 ...
4
votes
0answers
63 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} ...
2
votes
0answers
30 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
90 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} ...
9
votes
1answer
156 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
65 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
104 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
53 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
58 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
113 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 ...
2
votes
1answer
55 views

Why is \glueexpr used in etoolbox's \deflength instead of \dimexpr

Consider the following snippet from etoolbox: \newrobustcmd*{\deflength}[2]{% \ifundef{#1} {\etb@noglobal\etb@err@nolen{#1}}% {#1\glueexpr#2\relax}} Maybe I do not understand the ...
5
votes
3answers
109 views

Comparing calculated real numbers

"\ifdimless" can compare two real numbers. But, how can we feed the result of a calculation to this function ? \documentclass[]{article} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{etoolbox} ...
5
votes
2answers
63 views

How to determine if a macro argument contains the macro itself?

I would like to have a way to detect if a particular macro's argument contains that particular macro itself. Consider the following MNWE: \documentclass{article} \usepackage{etoolbox} ...
0
votes
0answers
35 views

etoolbox conflict with bm package [duplicate]

I found a conflict between bm an etoolbox because later one redefines \@@end. It happens when it patches \enddocument command. Code from etoolbox: \patchcmd\enddocument {\deadcycles} ...
2
votes
3answers
73 views

Multiple \if condition using etoolbox

First: I've found "Checking if two conditionals are met" but I don't know how to change it do suit my needs. Wanted: I have eight different predefined values and I want different definitions of a ...
4
votes
2answers
68 views

N ary switchs (selectors / conditionnals / toggles) to handle mailling list

Suppose I want to address the same letter to 10 persons. The letters should be the same, except of course for the recipient's name and address. Moreover, I want to enclose the name of all the other ...
4
votes
0answers
118 views

Scrreprt indent after chapter heading after patchcmd

In the following example, I've added a patch to the \chapter as an attempt to fix hyperref links. (See Hyperref chapter in twocolumn mode (without using multicols).) ...
3
votes
1answer
54 views

Customized list of elements using etoolbox

I need to have several lists with access by index (array-like). My minimum non-working example follows: \documentclass{minimal} \usepackage{etoolbox} \newcounter{listAcounter} ...
3
votes
1answer
241 views

Color of enumerate/itemize items in alertblocks and exampleblocks (beamer theme Torino)

I'm working with the Beamer theme Torino (see http://blog.barisione.org/2007-09/torino-a-pretty-theme-for-latex-beamer/), I' doing presentations using it, but changing the colors defined by default. ...
6
votes
1answer
70 views

Headline adjustment doesn't work after new installation

Half a year ago, the following code \documentclass[ fontsize=12pt, % monochrome, a4paper, parskip=half, ngerman, headinclude=true, footinclude=false, ...
4
votes
1answer
47 views

List Parsing the ascii space character

I have been using the list parsing functionality from etoolbox and I have a weird use case in which I want a space separated list. \usepackage{etoolbox} ...
4
votes
2answers
127 views

Use toggles in biblatex `printbibliography`

Consider the following: \documentclass{article} \usepackage[backend=bibtex8]{biblatex} \begin{filecontents*}{bib.bib} @mastersthesis{toto, author={Toto}, title={My thesis}, year={2009}, school={Paris ...
0
votes
1answer
88 views

Short caption in margin

Is it possible to insert the short caption of a figure in the margin next to it? I tried to get it working with etoolbox but without success. Additionally it has to work with the package subcaption ...
11
votes
3answers
171 views

Use a macro to define a \NewDocumentCommand macro without backslash

Or as, Werner simplified it: "How to define a command without backslash in xparse". Background: I am trying to set up a macro to define a macro for me (which will also do some other things which ...
5
votes
3answers
69 views

Retrieve link caption of hidden label

What I wish to do is create a (hidden) label in which some text is stored, and retrieve the text by referencing to it, without getting an actual link. For example: \customlabel{refname}{some text} ...
6
votes
2answers
139 views

Run a command at end of each Frame

I want to run a command (writing page ranges to a file) at the end of each frame. I can capture the page the frame started with at the beginning with ...
4
votes
2answers
52 views

Redefining a Command in a Loop Over a Comma Separated List

I want to redefine the glossaries package’s \gls commands to include an index entry and an optional argument for formatting the index entry. However, there are so many variants of this command (\gls, ...
1
vote
2answers
126 views

How to create labels and references automatically in LaTeX?

I have defined two custom macros: \translation{ORIGINAL}{TRANSLATION} \printtranslations The first macro prints out the translation and puts the original and the translation into a list. The list ...
4
votes
1answer
61 views

whileboolexpr with arrayjobx arrays generates unwanted whitespaces in output

While improving on a class file of mine, I found that I used the multido package in just a single line of code and naturally I set out to remove that dependency. My class uses several counters and ...
7
votes
1answer
112 views

Does LaTeX3 have something for patching (or appending code to) commands?

Item #12 of http://tex.stackexchange.com/a/148734/18401 suggests that LaTeX3 maybe has something for patching (or appending code to) commands, à la etoolbox or xpatch. Is it the case?
3
votes
1answer
100 views

How to append colored text to a macro in a loop?

I'm trying to append a couple of colored numbers to a macro in a loop. That is, I'm hoping to achieve the following but with a loop: \documentclass{article} \usepackage{tikz} \colorlet{color1}{red} ...
2
votes
1answer
39 views

\csuse inside a \NewEnviron using the environment parameter

I am trying define a environment that displays a text specified by the parameter of the environment. The following example demonstrates it: \documentclass{article} \usepackage{environ} ...
1
vote
0answers
30 views

Why can't I use \ifstrequal to check the \jobname? [duplicate]

I want to use the same source file to compile various target files using the -jobname option. I want to ensure that the option is not forgotten, so my approach was to check whether the \jobname is ...
4
votes
0answers
122 views

Errors when loading a package with AtEndPreamble hook

Consider the following (not so) MWE: \documentclass{article} \usepackage[style=authoryear-comp,backend=biber]{biblatex} \addbibresource{biblatex-examples.bib} \makeatletter % Load xpatch and ...
4
votes
1answer
199 views

Patch \insertshorttitle in beamer

In this answer @cfr showed me how to preserve short title color in beamer while allowing hyperlinks to work. His solution was to modify the \insertshorttitle command (defined in beamerbasetitle.sty) ...
4
votes
2answers
97 views

Using forcsvlist with macros that take more than one argument

I'd like to compact this code sample with \forcsvlist (provided by the etoolbox package). \newcommand\mycmd[2]{ \pagestyle{#2} \csname tit#1\endcsname \cleardoublepage } \def\DOtitlepages{ ...
8
votes
1answer
267 views

How to translate \ifthenelse from “ifthen” to “etoolbox”?

Trying to make conditional expressions that inspect the total page count of the document (see this question), I've found this solution using ifthen package: \documentclass{article} ...
0
votes
0answers
46 views

Output two files

I'm tiring of maintaining two different CV and resume .tex files and want to combine them into a single file. I'm considering etoolbox as a way of combining my CV and resume into the same. Then I ...
8
votes
1answer
211 views

biblatex-chicago etoolbox error: Invalid boolean Expression

I am using bibtex as the backend for my biblatex bibliography but there seems to be some clash between it and the etoolbox package that I don't understand. This is on a fresh install of TeXlive 2014. ...