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
1
vote
1answer
25 views

Convert roman from \thepage into arabic

I am having trouble getting the value from \thepage (which is in roman style) and converting it to arabic to set some counter. A very simple example of what I want to do is: \documentclass{article} \...
0
votes
1answer
30 views

etoolbox error when using uni-wtal-ger style

I get an error when I try to use the uni-wtal-ger citation style and since I am fairly new to Latex I am unable to make sense of it (at all). My usepackage declaration for biblatex looks like this: \...
1
vote
1answer
26 views

patching \setcounter and \addotocounter not working well with calc

for some very specific needs of reledac, I need to get the value of the page counter each time it is changed, either via settocounter, either with addotcounter. So I did something like this (it is a ...
0
votes
1answer
104 views

Recompiling on another newer iMac I obtain error: “./LibroOrange.tex:187: Package etoolbox Error: Toggle 'blx@lang@captions@latin' undefined.”

Recompiling on another newer iMac my big book, I obtain error: ./LibroOrange.tex:187: Package etoolbox Error: Toggle 'blx@lang@captions@latin' undefined. But pressing RETURN seems to solve: the ...
0
votes
1answer
14 views

Store previous element of loop in intermediate variable for dynamic command creation

I am dynamically creating commands and would like to define them based on the current value in an iteration list. The problem is that the current value appears as the last value of the iterated ...
1
vote
1answer
15 views

Conditional add to Counter based on conditional ifboolexpr

I want to add to a counter based on an ifboolexpr using etoolbox but cant get it to work as I had hoped. I want to put various conditions throughout my document and then at the end have a count of how ...
2
votes
1answer
45 views

Am I using etoolbox correctly for string comparison?

I have a little environment to enumerate question statements. Sometimes, I want the label to not be a number but some string instead. In that case, I do not want the counter to be incremented. % ...
1
vote
1answer
45 views

Etoolbox's \patchcmd can't find search pattern due to hyperref package

I use the report class and I have learned from other questions on this site (like Remove spacing between per-chapter figures in LoF) how I can adjust the spacing between per-chapter figures in the LoF....
1
vote
1answer
47 views

Block additional document contents after appendices

I'm using the appendix package's appendices environment, and due to style changes for the appendices, placing anything after the appendices doesn't make sense. I'd like to raise an error if anything ...
0
votes
2answers
23 views

Why is code appended to \endabstract still indented?

I'm trying to automatically append "keywords" (defined in the preamble) to the end of the abstract environment. The keywords should not be flush with the abstract, but flush with the body ...
1
vote
0answers
20 views

\edef not working with \@author [closed]

I am writing a custom documentclass and I would like to split \@author on \and (which I redefine to \unskip,) to use with etoolbox \docsvlist: \NeedsTeXFormat{LaTeX2e} \ProvidesClass{myarticle} \...
1
vote
1answer
23 views

using iftoggle to set newtheorem depth

I am using the same macro file for multiple documents, and I would like their theorems to be numbered differently -- one by section and another by subsection. I'm trying to do this by using iftoggle ...
0
votes
0answers
25 views

ttfamily in the chapter title of Korean language document

When having a Korean document and we have \ttfamily in a \chapter (or other section command) we get an error in respect to etoolbox, and a crash on the line after the \tableofcontents (independent of ...
0
votes
1answer
28 views

tufte-book: Make all \align environments full width

I'm working with tufte-book, and I want all my align environments to be full-width by default. Minimum working example; \documentclass[ a4paper, nofonts, justified ]{tufte-book} \...
1
vote
1answer
51 views

How can I rewrite these conditionals effectively?

I'm working on modernizing and adapting an old LuaLaTeX template made for exams and other university documents. The thing is, the document is full of conditionals like these: \newcommand{\showMarks}{...
4
votes
1answer
56 views

Understanding empty \newcommand's in etoolbox.sty

In etoolbox.sty, three commands \ifdefmacro, \ifdefparam and \ifdefprotected are firstly defined by \newcommand\cmd{}, then by \long\edef\cmd{...}. I don't understand why the empty \newcommands are ...
4
votes
2answers
102 views

\csdef{} that reports error if command is already defined

Is there a version of \csdef{}{} that reports an error if the value is already defined? The MWE below compiles fine since no checking for the macro already being defined is done and yields: I want to ...
0
votes
0answers
27 views

Chemical packages bug fontspec mhchem siunits

Example: \documentclass[10pt]{beamer} \usetheme{Singapore} \setbeamertemplate{navigation symbols}{} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{helvet} \usepackage{natbib} \...
2
votes
1answer
61 views

Patch `pmatrix` with optional arguments

I need to patch the math command pmatrix with optional arguments. For example, I'd like to patch the following code, while treating it as immutable. \[ \begin{pmatrix} & a & b\\ c &...
0
votes
0answers
19 views

Hyperlink to homepage after author in amsart

The amsart class provides the command \urladdr which is intended to place a hyperlink to the homepage of each author at the end of the document. I wonder whether the amsart setauthors command can be ...
1
vote
2answers
49 views

Conflict between french option, babel package, babel tikzlibrary and etoolbox package

I'm sorry for the pretty vague title. I've tried to make it as clear as I could. In my documents, I'm setting up the language option with babel package and to avoid some troubles I had to load babel ...
0
votes
0answers
41 views

bibliography overwrites header

I am writing a journal-type document, in which the bibliography for an article should be printed at the end of the article. I am using the book class for it. For the references, I want to use \begin{...
2
votes
1answer
74 views

Cleveref's namecref usage in etoolbox' tests

I am currently trying to create new commands to add the correct French article in front of the cross-references when required (for example "la figure XX" or "le chapitre XX"). My initial idea was to ...
1
vote
1answer
64 views

How to fix etoolboox error? BibLaTex using bibstyle=uni-wtal-ger

I'm trying to use BibLaTeX with citestyle=authoryear-ibid and bibstyle=uni-wtal-ger My main.tex looks like this: \documentclass[paper=a4,pagesize=auto,oneside,fontsize=12pt,toc=bib]{scrreprt} \...
0
votes
0answers
45 views

Hook for outer par mode

Is it possible to execute macros after the correct mode is 'reached?' \documentclass{article} \usepackage{etoolbox} \usepackage{marginfix} \newcommand{\mymarginpar}[1]{\AfterEndEnvironment{figure}{\...
7
votes
1answer
89 views

Automate equation variable description with glossaries-symbols

I'm trying to automate the description tables of equations with the help of the glossaries-package. I already found this question, but on the one hand it didn't work for me, and on the other it seems ...
3
votes
1answer
125 views

Definitive way to pre- and append code, or patch commands?

Consider the following example: we have a command \mycmd, defined in some pacakge as: \DeclareRobustCommand{\mycmd}{% <original source code> } we want to patch this command, in the sense ...
2
votes
2answers
90 views

Safe way of redefining \- only for math mode

I know that \- is already used for hyphenation and inside tabbing. How can I patch this command such that it does something else, but only inside math environments? I tried the following: \...
2
votes
1answer
28 views

String comparison between AlphAlph and clist_item fails

I am trying to compare the results of AlphAlph and the indexing of a comma-delimited list. Why does this not work? MWE %! TEX PROGRAM = pdflatex \documentclass[a4paper]{article} \usepackage[utf8]{...
6
votes
1answer
350 views

LaTeX, etoolbox and counters

I'm having a new issue with the etoolbox package. In fact, I would like in a LaTeX document to numberize my figures, tables, etc... But, when I add the value of the counter to the list, it doesn't ...
3
votes
1answer
64 views

LaTeX etoolbox list not working in environment

I'm working on LaTeX and I want to add an element to a list each time I call an environment (here the environment environment). When I run the document the result is ['command'] instead of ['...
1
vote
1answer
61 views

Expandable Substring inside an ifboolexpr

Seeking understanding of how to expand a substring so the value can be evaluated within ifboolexpr from etoolbox package - As a relative newbie to latex (only using it for the past 18 months), I'm ...
2
votes
1answer
28 views

Failure to patch pict2e to have a fillable oval

I am trying to patch "on the fly" pict2e.sty so that I can have filled ovals (this comes from here: https://github.com/Rmano/circledsteps/issues/5). I tried this: \documentclass{article} \usepackage[...
5
votes
1answer
64 views

How to work with members of sequence during iteration with expl3?

I have several environments before and after which I want to insert identical code. I want to do this using expl3 because in my opinion it is the best solution. But my solution does not work because ##...
2
votes
3answers
80 views

Toggle optionally red color to multiple lines in align environment

I am writing a document that contains some mathematical proofs. I would like to define a command in LaTeX that enables me to write some additional passages to my proofs which are shown only when a ...
3
votes
2answers
282 views

what does csnumgdef do?

What does \csnumgdef do? From code examples, it appears to take two arguments, and one is led to believe that it defines a number var and assigns to it the value val, as in \csnumgdef{var}{val}. If ...
0
votes
1answer
49 views

\xpatch fails if \PassOptionsToPackage{french}{babel} is used

Everything works fine if I do not use \PassOptionsToPackage{french}{babel}. My document class abntex2 already loads babel, then, to load the french language I need to use \PassOptionsToPackage{french}...
0
votes
1answer
60 views

How to replace a command argument as #2 with something else?

I am trying to patch this macro: \xshowcmd\addcontentsline > \addcontentsline=macro: #1#2#3->\begingroup \let \label \@gobble \ifx \@currentHref \@empty \Hy@Warning {No destination for ...
12
votes
2answers
262 views

How do I limit the scope of etoolbox environment patching?

I want to use the etoolbox package to patch a certain environment; but - I only want to do it for a certain stretch of my document. Enclosing in curly brances doesn't work: \documentclass{article} \...
3
votes
2answers
46 views

Compilation error is removed by compiling again

Following up this answer, the first run of compilation results in the following error: Undefined control sequence. This exam contains \textbf{\NAMEquestions} which has to be eliminated by running ...
6
votes
2answers
137 views

Incompatibility between noindentafter and etoolbox (> v2.5f)?

After compilation of some legacy code including the noindentafter package, I just noticed that they produce a warning which never came up before: Package noindentafter Warning: Patching `\end' failed!...
3
votes
2answers
316 views

Output to multiple .pdf documents using LuaLaTeX and Toggles

I have a document that I sometimes want to print as one single document, and other times I want to print it as smaller groups of pages. I would like to automate the process. I'm using TeXmaker with ...
3
votes
1answer
307 views

How to generate summary table automatically?

I have to generate a summary of impacts and actions in many enviromental reports. Sometimes there are two or more impacts in the analyses, so I have to create the lines manually in the table. Is there ...
0
votes
1answer
63 views

etoolbox not breaking page when needed

I have the following piece of code in the preamble, that should prevent chapter from beginning on different pages, but, by the same time, when I get to chapter 3 it has enough text to break a page and ...
0
votes
0answers
19 views

tabularx too wide (after using etoolbox's appto?) [duplicate]

After using the solution of another problem (see here), my tabularx table is too wide now. Please see the MWE and its output below. Adding \noindent before the first table doesn't help (as suggested ...
1
vote
2answers
99 views

Table of contents: section titles ragged right - 2

The problem of having ragged right toc is described in Table of contents: section titles ragged right for articles. The etoolbox-option seem not to work with the book class, and I am not too ...
1
vote
1answer
124 views

etoolbox and tabularx — problem with `appto`

I'm trying to print worksheets. I have already implemented an automatic numbering for subtasks. I use tabularx for my subtasks (see the MWE below). Yesterday, I tried to define a new macro called \...
3
votes
2answers
71 views

etoolbox: ifdefvoid check for empty lines

I designed a system that reads a number of variables and, depending on the definition creates a text (either text "a" and the text contained in the variable (macro), or an alternate text "b" when the ...
1
vote
0answers
33 views

Run command before end of each frame [duplicate]

I've modified \item to insert a \vfill after each occurrence to space out bulleted lists on slides so they do not cluster in the center following this answer. However, to balance out my vertical ...
0
votes
0answers
30 views

etoolbox error in running template for ScienceAsia

Currently I am using pctexv6, and I tried to typeset this following simple template for a specific journal. However the output didn't come out and I got error message saying ! Package etoolbox Error: ...

1
2 3 4 5
9