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
2
votes
1answer
51 views

Comparing node coordinates in Tikz

I am trying to generate drawings automatically based on node coordinates. The construction process itself is very easy: draw an arrow from node i to node i+1 (i and i+1 being node names, fixed ...
0
votes
2answers
34 views

Table Spacing with “setspace” and “etoolbox”

I use the set spacing package, to avoid that tables are condensed I also use the etoolbox package to define the tabular environment. However, in one specific table the 1.5 spacing is too much and I ...
3
votes
1answer
37 views

Using \noindent in \AfterEndEnvironment from etoolbox creates bigger gaps between two environments

Using \noindent in \AfterEndEnvironment from etoolbox creates bigger gaps between two environments than it should. Here is code, that fully describes the problem. \documentclass{scrartcl} \usepackage{...
2
votes
1answer
25 views

Modifying a list and passing it to another command

I am trying to write some macros to easy my life while writing mathematics in LaTeX. For this, I would like to have some macros to write wedge products in a more concise manner. I have a command which ...
1
vote
1answer
29 views

Using csdef in table

I am trying to automatically add a decision summary when writing meeting minutes. For each paragraph of the meeting I use a table to organize the paragraph number, name and content, and I use etoolbox ...
0
votes
0answers
15 views

How to remove the “Bibliography” title in book class

Here: How to remove the "References" title Gonzalo Medina suggests to use: \usepackage{etoolbox} \patchcmd{\thebibliography}{\section*{\refname}}{}{}{} to remove the word "References&...
1
vote
2answers
45 views

Comma-separated list environment and etoolbox

I want to combine the automatic punctuation in comma separated list from this answer with the list processing from etoolbox. However, I do not get any output. What is going wrong here? \documentclass{...
4
votes
2answers
118 views

Access argument passed to environment with etoolbox \AtBeginEnvironment

I would like to use etoolbox to run some code at the beginning of the tabular environment. I would like to use the column specification in this code. Can this be done easily? \documentclass{article} \...
3
votes
2answers
88 views

Reference an element of an array created by listadd

Given the mwe: \documentclass{article} \usepackage{etoolbox} \begin{document} \listadd\terms{First item of the list} \listadd\terms{Second item which has punctuation such as, commas, potentially a ...
4
votes
2answers
78 views

Single Line Checker

I'm using caption and subcaption Packages to make more beautiful captions to my figures used in the document. So i use the following style, \DeclareCaptionStyle{MarinoCaptionStyle}{ format=...
2
votes
1answer
67 views

How to use conditionals with arithmetic expressions and boolean operators (etoolbox)?

How would I do something like this pseudo-code: \if{#1==5 or \x>7}{Command 1} \else{Command 2} where #1 is some argument in a \newcommand and \x could come from a \foreach \x in {0,1,2}, for ...
2
votes
0answers
26 views

How to detect if a certain patch has been made?

This answer offers a nice patch to allow lineno works fine with amsmath environments, and I would like to use this in some of my classes and styles that use lineno. However, this may cause the patch ...
8
votes
2answers
169 views

etoolbox do with macro as parameter

I'm trying to make an automatized meeting log generator using pdflatex. I want to create a table with the n rows, and fill them up with comma separated typein inputs. I've got the myTable macro from ...
1
vote
2answers
85 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
115 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
26 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
39 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
44 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
79 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
38 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
39 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
32 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
34 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
489 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
43 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
40 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
50 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
41 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
69 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
340 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
19 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
18 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
90 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
56 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
28 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
32 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
46 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
38 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
64 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
87 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
131 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
35 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
97 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
27 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
79 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 ...
2
votes
1answer
105 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
93 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
51 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}{\...

1
2 3 4 5
10