Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [etoolbox]

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

Filter by
Sorted by
Tagged with
0 votes
2 answers
34 views

Compile two times with boolean set to true first and then false

I just received some tex files where there is a boolean defined at the beginning of the document with the etoolbox package. Changing the boolean produces a slightly different pdf. To produce the other ...
User's user avatar
  • 1
2 votes
3 answers
84 views

How to detect pgfkeysnovalue with csname?

To simplify the programming of a package, I want to generate multiple similar commands (\test, \testb, ...) with a single command \NEWCOMMAND. Each key needs to be linked with an unique command name. ...
Sam's user avatar
  • 310
1 vote
1 answer
29 views

How to create a list with descriptions in pdftooltip

What I wish is simply to create a list in latex which contains variable names and a description and use it for pdftoolTip. This should be seen in the context of \begin{equation} enviroment. So the ...
Michael's user avatar
  • 13
2 votes
1 answer
69 views

Using etoolbox package to resize box automatically

I have hundreds of latex tables I generated using Stargazer. Almost all of these tables can be rectified by wrapping tabular as such \resizebox{\textwidth}{!}{ \begin{tabular} ... \end{tabular}}. I ...
r-learning-machine's user avatar
0 votes
1 answer
45 views

titlesec interferes with addcontentsline/addtocontents (adding Parts and Chapters to lot and lof)

For my lot and lof i am using something i found here, so that the parts and chapters show in them (lot and lof). And for my Titles (Part, Chapter, Section ...) i am using titlesec, so they look (imo) ...
Gabriele Di Toma's user avatar
2 votes
0 answers
35 views

Unable to patch `\hyper@normalise` command with `\patchcmd`

Is it possible to add a hook to \hyper@normalise command without overwriting all the macro. I wish to add a hook at the end of macro just before \hyper@n@rmalise that I could add custom definitions ...
Linuxss's user avatar
  • 957
0 votes
1 answer
54 views

Using defined macro inside csdef

I have defined new font size switches using the following code. \makeatletter \newcommand{\vi@mult}{2.986} \newcommand{\HUGE}{\normalsize% \@setfontsize\HUGE{\vi@mult\dimexpr\f@size pt\relax}{\vi@...
Einreinfall's user avatar
1 vote
1 answer
30 views

Skipped line in `\iftoggle` gives error: paragraph ended and too many }'s

I'm trying to make a new command that outputs the first or the second argument depending on a toggle (with a specific counter -- it's basically to output question and answer for an exam). However, if ...
Nora NICOLAS's user avatar
0 votes
1 answer
81 views

Unwanted offset when using biblatex's printbibliography and author bolding via xstring+etoolbox

I'm trying to bold my name in a publication list. After an embarrassing amount of time/experimentation I have something I'm happy with via etoolbox and xstring: \renewcommand{\mkbibnamegiven}[1]{\...
daknowles's user avatar
  • 103
2 votes
1 answer
43 views

\AtBeginEnvironment does not work for the questions environment in the exam class

Please see the following MWE. \documentclass{exam} \usepackage{etoolbox} % The following does not have any effect on the output \AtBeginEnvironment{questions}{\setcounter{question}{4}} \begin{...
Masroor's user avatar
  • 17.9k
0 votes
0 answers
21 views

How to include numbered and unnumbered chapter to list of figures automatically with etoolbox

In https://tex.stackexchange.com/a/52747/232319 they describe how to include numbered chapters (with number and title) in LOF only if the chapters contain at least one figure. The key idea is to patch ...
vepain's user avatar
  • 23
0 votes
0 answers
37 views

iftoggle or ifthenelse within a bibtex file, author field not expanded

I am trying to put a conditional statement within a bib file, namely in the author field. I tried with both the ifthenelse and the iftoggle commands, but to no avail. The condition is respected, but ...
ferdymercury's user avatar
1 vote
1 answer
45 views

How to patch `\LoadClass` in a LaTeX class to change the parent class without modifying the .cls file?

I am currently experimenting with .dtx files to develop a little style for my university documents. Doing so, I use l3doc class as a document class in the documentation counterpart of my dtx file. ...
samulus's user avatar
  • 25
2 votes
1 answer
102 views

Check if the text of a label is empty

I'm trying to check if a text label is empty. For this purpose, I tried to use the \ifblank command from the etoolbox package. On the following MWE, I would expect that \refdescx{\nameref{lab2}} would ...
ZoKaP's user avatar
  • 35
0 votes
2 answers
71 views

Which way to alter commands is more robust/sustainable

I have a general question. If I'm writing a .cls file (or a package file, as well), what's the best way to edit standard commands like \section which are defined by the used standard class or latex....
lukeflo's user avatar
  • 1,597
4 votes
2 answers
104 views

conflict between scrbook and dynkin-diagrams

I find a strange conflict between scrbook and dynkin-diagrams, here is the code \documentclass{scrbook} \usepackage{dynkin-diagrams} \begin{document} \chapter{One} Here is one \dynkin A2 \end{...
Gau-Syu's user avatar
  • 473
2 votes
1 answer
70 views

Missing endcsname when passing command to hypersetup

I'm trying to manually process a list of authors. The logic works in the document, but not it does not seem to work when I pass it to hypersetup. \documentclass{article} \usepackage{authblk} \...
dikdirk's user avatar
  • 73
1 vote
1 answer
54 views

Comparing pgfkey variable against a string

I want to check a mutable variable against many possible values, so that a macro will behave differently based on that value. Since there are many variables, they are stored using pgfkeys. Testing ...
eduardofischermath's user avatar
4 votes
2 answers
64 views

Problem with macro expansion when making a custom queue container

I'm trying to make a simple queue using the etoolbox package by making my own custom macros \listfront and \listfrontpop. This is my very first time using TeX code to this level, so my understanding ...
daedsidog's user avatar
  • 154
4 votes
2 answers
127 views

Unexpected behavior with etoolbox

I would like to separate blocks of text (stories) via a horizontal line inserted automatically between the blocks, but not before the first or after the last. I tried to achieve this by creating a ...
Matt's user avatar
  • 43
1 vote
3 answers
94 views

Using Macro Inside Description List Label

I made a macro using xparse for formatting the month with optional day and year. Except the appended optional argument doesn't work inside a description label for the description list---unless I ...
User23456234's user avatar
  • 1,864
1 vote
0 answers
30 views

memoir: Add "part space" before backmatter chapters

I would like the vertical space before the backmatter chapters in the table of contents to be the same as before a part. I would have thought that the code below would have resulted in this, but the ...
Fredrik P's user avatar
  • 1,418
4 votes
1 answer
193 views

Using \ifblank to check more than one parameter

I have been reading through mathtools' docs, and they provide an example that declared a paired delimiter that has a default behaviour if blank, using etoolbox: \DeclarePairedDelimiterX\norm[1]\lVert\...
TimeTravelPenguin's user avatar
4 votes
1 answer
101 views

System to avoid doubling up of spacing after a custom environment

Below is a very simplified example to illustrate a problem with spacing before and after environments: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{amsthm} \usepackage{amsmath} \...
Harry's user avatar
  • 938
1 vote
1 answer
45 views

Removing spacing between adjacent sections and subsections (titlesec)

I am building out sections and subsections. The beforesep on subsections is desirable generally, but not if a subsection is invoked directly following a section. Is there any way to take care of this? ...
Harry's user avatar
  • 938
2 votes
1 answer
79 views

Using \def to output boolean true/false values - Usage in Tasks Package "Resume" Function

I am attempting to use a \def (or any equivalent) to give a boolean output, but unable to do so. Compilation of below results in the following error: \documentclass{amsart} \usepackage{tasks} \begin{...
Harry's user avatar
  • 938
0 votes
1 answer
47 views

Using foreach to add variable number of rows to a bytefield inside a TikZ node?

I'd like to loop over a list of fields to be added to a bytefield, to be shown inside a TikZ node. MWE: \documentclass[tikz]{standalone} \usepackage{bytefield} \usepackage{etoolbox} \begin{document} ...
Holger Karl's user avatar
0 votes
0 answers
26 views

Cannot use \aa in \eappto with pdfLaTeX [duplicate]

I'm working on a Swedish language file to fmtcount. There I have to concatenate strings to form numerals. As the Swedish words for two and eight ("två" and "åtta") contain the ...
Fredrik P's user avatar
  • 1,418
2 votes
2 answers
138 views

\eappto and \aa doesn't work with pdflatex without fontenc

I'm trying to use \aa in an \eappto command. The minimal code below works just fine in XeLaTeX and LuaLaTeX but fails with pdfLaTeX unless I include the fontenc package. This confuses me as \aa works ...
Fredrik P's user avatar
  • 1,418
3 votes
1 answer
90 views

Use `\ifblank` as a test for `\ifstrequal`

To carry out checks on some parameters passed to an environment, I would need to: check if the parameter is blank or not; pass a default value or the one supplied; compare the final value with a ...
Datboi's user avatar
  • 85
5 votes
2 answers
144 views

Wacky Behaviour for \csdef

I am using \csdef{} to define a meaning to a given open/close bracket: \csdef{Bracket Meaning \CsToStr{\lvert}}{Left |} \csdef{Bracket Meaning \CsToStr{\rvert}}{Right |} \csdef{Bracket Meaning \...
Peter Grill's user avatar
0 votes
0 answers
30 views

Conditionnal CSV prompting

I'm asking for your help for a specific problem I have no clue about. My goal is to have conditionnal CSV printed in a table (did not include that print part) : \usepackage{csvsimple} \usepackage{...
Clem105's user avatar
0 votes
1 answer
47 views

Interaction of „Showonlyref“ and „Subequations“ Workaround?

A workaround suggested by Daleif (see below) solves the problem of incorrect numbering when e.g. one set of subequations is not referenced. However, if none of the equations of a specific set of ...
user288158's user avatar
2 votes
2 answers
66 views

List numbering issue in latex

Suppose that I have this simple code \begin{theorem} \begin{enumerate}[nolistsep] \item[(1)] This is the first item \item[(2)] This is the second item \end{enumerate} \end{theorem} My question is:...
Hussein Eid's user avatar
6 votes
2 answers
219 views

Why does an empty command not return an empty string?

I want to check if a command returns something or not. I tried the following but it is not working. Why is the output of the following code false? \documentclass{article} \usepackage{etoolbox} \...
Yannic's user avatar
  • 205
4 votes
1 answer
124 views

How to use the \appto across the environments?

In the following code: \newtheorem{myans}{Answer} \def\myword{Word: } \newcommand{\addword}{first, } \begin{myans} ... \appto{\myword}{\addword} ... \end{myans} \renewcommand{\addword}{second, } \...
Ngiap's user avatar
  • 89
1 vote
0 answers
50 views

Solution for using latexdiff on files with toggles

I have different versions of a latex file that use toggles (from etoolbox). When I use latexdiff to compare the different versions, I can see that latexdiff is (practically) oblivious to changes in ...
Cyriac Antony's user avatar
0 votes
1 answer
73 views

How make, that every page with section start have an empty style

There is some problem, that I can't understand. I want, that each page with start section has empty style \appto\section{\thispagestyle{empty}} I get an error ! Argument of \thispagestyle has an ...
Igor Yukhimenko's user avatar
2 votes
3 answers
89 views

Creating a list that can hold multiple values per entry

I wand to create a list which can hold different values per entry. As an example I want to list users and every user has a Username, Age and Country. Now I want to be able to iterate through the list ...
Krypton's user avatar
  • 25
0 votes
0 answers
159 views

ifstrempty Renders always False

The following minimal example makes problems: \usepackage{etoolbox} \newcommand{\foo}{} \begin{document} \ifstrempty{\foo}{True}{False} % This is always False \end{document} Why is ifstrempty ...
flymg's user avatar
  • 179
1 vote
1 answer
59 views

How to replace the second match of a string of token using \patchcmd?

I will first raise a general question and then try to describe what I actually want to achieve. General question: How to patch the match other than the first one using \patchcmd The logic of the ...
Qi Tianluo's user avatar
0 votes
1 answer
59 views

Patch no longer finding search pattern for hyperref command despite previously working, unsure how to update it

Some time ago I used user Werner's solution provided here: https://tex.stackexchange.com/a/582389 in one of my own documents. Specifically, the goal was to make the part number and the part title in ...
tex_user_'s user avatar
0 votes
1 answer
72 views

How to store Boolean values for later use

I want to define a new command for a package using xparse. My command looks like this: \NewDocumentCommand{\fancyCommand}{s o m}{ \def\@optional{#2} \def\@mandatory{#3} } This is, because I ...
Matthias's user avatar
0 votes
0 answers
156 views

How do I check if a list item is blank when it is passed as a parameter in LaTex?

I'm trying to create a command that accepts two lists using the \listofitems package where the first list is optional. In the command I want to check if the first entry in the optional list is "...
Rhys's user avatar
  • 1
0 votes
1 answer
91 views

Changing a etoolbox toggle for the span of an environment

I use the toggles of the etoolbox package in my document. However, the document is long and gets modified a lot so sometimes the current state of the toggle is not clear when editing somewhere in the ...
Franz's user avatar
  • 175
0 votes
1 answer
113 views

Can you make boolean expressions in xparse?

I have a preamble I use on my assignments containing the following command using xparse: \ProvideDocumentCommand{\integral}{s m m e{_^}}{% \int% \IfValueT{#4}{_{#4}}% \IfValueT{#5}{^{#5}}% ...
TimeTravelPenguin's user avatar
1 vote
1 answer
108 views

Calc \widthof error

I'm trying to use the \widthof command (calc package) inside the \ifdimcomp command (etoolbox package), but I keep getting an error "Missing number, treated as zero" which confuses me. I'm ...
User23456234's user avatar
  • 1,864
0 votes
1 answer
65 views

Titlesec undoes an etoolbox patch. How to make them compatible?

This answer says how to avoid indenting long section titles and obtaining something like in the picture (not me who introduced this format, it's just the format I have to deal with now, and titles ...
c.p.'s user avatar
  • 4,637
1 vote
2 answers
120 views

RequirePackage and usepretex from latexmk change output file to texput.tex

I want to compile a larger file completly based on a toggle (my@final) from the commandline using a makefile. My .tex-file looks like: \documentclass{scrbook} \begin{filecontents}[overwrite]{01.tex} ...
lukascbossert's user avatar
0 votes
1 answer
78 views

\docsvlist not work with list in form of macro

In the following codes, I tries three methods to build a csv list(a sequence of natural numbers from 1 to 5). Then I use \docsvlist(from etoolbox) to wrap each element of the list with parentheses. ...
lyl's user avatar
  • 2,727

1
2 3 4 5
12