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
2answers
60 views

Footnote overwriting bottom centered page number

I am using the etoolbox package to set the footnote spacing to single spaced inside my double spaced document. However, if I have a lot of footnotes on a page, they overwrite the page number. How ...
1
vote
1answer
111 views

Toggle between dotted lines/solution/blank space

I want to learn how to create a command such that I can easily toggle between having dotted lines or solution or even blank space (no space) under my questions. I know exam class has the answer ...
2
votes
1answer
25 views

Manually add an entry to the list of tracked entries

I feel like I'm missing something simple, but I can't manage to write a macro to manually add an entrykey to the list of tracked entries in biblatex such that \ifciteseen will be true. What am I doing ...
1
vote
1answer
30 views

Problem with etoolbox and csundef

With the code \documentclass{article} \usepackage{etoolbox} \newenvironment{Toto}{% }{% } \AfterEndEnvironment{Toto}{I forgot\dots} \begin{document} \begin{Toto} \end{Toto} \csundef{@afterend@...
1
vote
1answer
41 views

How to combined numbered and symbol footnotes?

I want to combine both regular and numbered footnotes. Currently I have the following: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{footnote} \usepackage[symbol,perpage]{footmisc} \...
2
votes
1answer
63 views

etoolbox : hook before code

Is there a way to make hook work before code? \documentclass{article} \usepackage{etoolbox} \begin{document} \hhh % this does not work foo \appto\hhh{test1} bar \hhh % this work \end{...
1
vote
2answers
34 views

Redefine any environment and command to an empty output

I have defined a few complicated environments and commands. Sometimes I need to to only see the superstructure of my output PDF. For this I need a way to do dry-run. I use a \toggletrue{dryrun} which ...
1
vote
0answers
36 views

How do I separate chapters and insert a few empty lines between two chapters?

I know it has been asked before but I just can't seem to make it work not matter what I try. I am using the report class. Now I want only my chapters to start below the end of the preceeding chapter. ...
1
vote
0answers
29 views

exam/geometry: First footer is shifted below when setting geometry using \AtBeginDocument

This answer does the job for placing the header right. However, the first footer is unknowingly shifted way much down. So, why does \AtBeginDocument{\settototalheight\headerTotalHeight{\headerContents}...
1
vote
2answers
33 views

How to pass several comma separated lists of arguments to \docsvlist?

I have a macro test which takes two arguments and translate a word if: this word is "minus" (first argument) the second argument is "translate" I need to pass comma separated ...
0
votes
0answers
186 views

Problem with etoolbox

I just installed TeXLive2020 and I cannot make it work with etoolbox. It was the first time I installed a TL version not from the (Ubuntu, in my case) official repository, and, I have to admit, I ...
0
votes
1answer
36 views

\docsvlist and nested functions: unwanted large spaces [duplicate]

I would like to iterate through a comma separated list to translate some words. I already found how to do so using \docsvlist from the etoolbox package. However, there is a large space printed before ...
2
votes
0answers
34 views

How to generate a list containing the values of a table

I have a table containing two columns with x and y values respectively and I want to generate a list \coordinates containing (x,y) for each row of the column. I tried defining a command that creates a ...
1
vote
1answer
32 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
37 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
43 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
261 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
16 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
17 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
70 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
49 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
48 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
26 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
21 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
29 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
31 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
34 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
61 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
70 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
117 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
30 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
79 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
24 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
63 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
60 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
89 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
71 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
48 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
95 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
138 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
95 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
32 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
389 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
85 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
70 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
32 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
67 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
94 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
299 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
53 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}...

1
2 3 4 5
10