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

learn more… | top users | synonyms

14
votes
1answer
3k views

Comparing an argument to a string when argument is a result of a command with etoolbox

I've got an example like that: \documentclass{article} \usepackage{etoolbox} \newcommand{\ab}{a} \newcommand{\aORb}[1]{% \ifstrequal{#1}{a}{"a" was given}{not a}, % ...
1
vote
1answer
604 views

Modify chapter command (and KOMA-script addchap)

Is there something like etoolbox's \appto, that also works for \chapter and \addchap? edit: I intend to use it to re-enable page numbering (which may or may not be disabled using ...
24
votes
3answers
2k views

How can I use \patchcmd with commands with optional arguments?

This question led to a new package: xpatch This is likely a simple question, but I'm getting stuck on the small details. I have an internal command, defined by a package as ...
2
votes
3answers
895 views

TeX Nested Loops With \iftoggle

This forum has helped me understand how to use nested loops in TeX, but now I am having trouble using \iftoggle (from the etoolbox package) with loops. My goal is to have a toggle that can keep track ...
18
votes
3answers
674 views

Should LaTeX counters always be modified globally?

In this answer, egreg states that "LaTeX counters should always be modified globally". However, the etoolbox package provides the \defcounter macro which will assign a value to a previously ...
5
votes
1answer
664 views

Changbars to indicate location of conditional text

I am using etoolbox as per this question on LaTeX conditional expression, and would like to modify the conditional to print some sort of indicator (like a vertical change bar in the margin) to show ...
6
votes
2answers
982 views

Package incompatibilites: etoolbox, hyperref, and bm, standalone?

I am trying to transition to using the etoolbox package, but seem to have run into some difficulties and they appear related to the hyperref and bm packages which to me seem totally unrelated. The ...
8
votes
3answers
572 views

\expandafter, \csname issue related to test for macro being defined

Just when I think I starting to understand \expandafter I run into this problem where I am trying to test if \ConditionG, \ConditionH, etc are defined in a loop. I tried all the combinations I could ...
7
votes
1answer
352 views

Biblatex: Idiom for testing contents of list field

I am creating a Biblatex bibliography style for legal citations. In one particular case, I need to format the citation (of a court decision, i.e. jurisdiction) differently depending on the particular ...
10
votes
5answers
2k views

How to test if a number is negative

Is there an easy way to test if a number is negative? I don't need a general solution, but it does need to be able to handle a floating point value. I was using this solution from tex.ac.uk until I ...
6
votes
1answer
269 views

Using ted (or another package) instead of etoolbox for patching commands in memoir?

Another question related to my university's odd ToC style requirements. Regular chapters in the ToC need to have all-caps titles, and appendices need regular-case titles. I have a perfectly elegant ...
4
votes
1answer
608 views

Hyperref breaks my all-caps ToC entries

I started out on this earlier question. I now have a simple and elegant etoolbox solution to making all-caps chapter entries, but leaving appendix entries untouched. Simple, elegant, and incompatible ...
6
votes
1answer
881 views

Making memoir Chapter entries in ToC all-caps and Appendix entries regular case, without breaking hyperref

I have a thesis style working, but around 10% of my code is a copy of memoir's \def\@chapter that lets me put all regular chapter entries in all caps, and keep appendix entries in regular case. This ...
3
votes
2answers
426 views

Run macro before each slide in beamer

Following on from this question, is there an easy way to call a macro before each slide? So that question answers how to get at each frame, but I want finer control... I want a macro that sets a ...
4
votes
1answer
459 views

Booleans fail in tabular environment

I've got a workaround for this problem, but maybe someone knows a cleaner way to fix it. I'm using the standard packages in TexLive 2009. Here's the code that doesn't work: \documentclass{article} ...
6
votes
3answers
598 views

etoolbox conditional causes unwanted empty row in tabular

This code leaves an empty row at the bottom: \documentclass{article} \usepackage{etoolbox} \def\somedef{foo} \begin{document} \begin{tabular}{|l|} \hline First row, not important \\ \hline ...
16
votes
4answers
2k views

Making switch/case with etoolbox's \ifdefequal

I've got a define such as \def\doctype{SomeString}. \doctype can take on one of five values. I want to do something like a switch statement in a programming language, i.e. (pseudocode): switch ...