Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [etoolbox]

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

4
votes
1answer
62 views

Workaround for tabularx inside environment when using csquotes

I need an environment that presents data in a table. The number of right-most columns shall be adjusted at compile-time, and the first column is dynamic width. For this reason I am using \usepackage{...
1
vote
2answers
30 views

forcsvlist to use the expanded result of another forcsvlist

My problem is, that I have a list of authors, that I use at several places for several things. For example I would like to generate an Author's index. In the code below I would like to "rework" the ...
3
votes
2answers
68 views

Collision of etoolbox and LuaLatex

I use a macro \mychoice{item a, item b, items c,…} that returns one of the items of the comma-separated-list determined by an external counter based on the \docsvlist macro from etoolbox. In simple ...
1
vote
1answer
16 views

How to test if a macro's value (set via kvoptions in a package) is empty or blank (e.g. using etoolbox)?

I have no idea, why this test fails and how to get it to work: \documentclass{article} \usepackage{filecontents} \begin{filecontents}{myTestSty.sty} \NeedsTeXFormat{LaTeX2e}[1994/06/01] \...
3
votes
3answers
47 views

An extra row in the table generated by \whileboolexpr command

I used \whileboolexpr command from etoolbox package to generate a table. But there was an extra unwanted row. What is the problem with the following code? \documentclass[12pt]{article} \usepackage{...
1
vote
2answers
45 views

Redefine \chapter to add \printMiniToc

I want every chapter to have \printMiniToc after it. However I don't want to have to add \printMiniToc after every \chapter. So I tried using etoolbox and tried this: xapptocmd{\chapter}{\...
3
votes
1answer
31 views

iftoggle with minted

I have a problem with the minted package in combination with etoolbox's iftoggle. It should be related (or basically be the same error) to this beamer question: minted environment in frame causes ...
0
votes
0answers
35 views

Different titleformat style for different numberless chapters (2nd part)

Referring to this thread: Different titleformat style for different numberless chapters, I've the following code: \begin{filecontents*}{\jobname.bib} @book{ bottero:1992, author = "Bottero, ...
10
votes
3answers
318 views

Expanding macro defined by \csdef to define a style via \tikzset

I need to store tikz option in a \csdef{}: \csdef{My Node Option}{draw=red, thick, fill=yellow} How do I use this definition to define a style via \tikzset? I attempted to use .expand once as per ...
3
votes
1answer
32 views

exam: Conditionally printing singular/plural form of marks/questions/pages

Following-up this answer, I would like to know to make \NAMEquestions print the word "questions" in case of multiple questions exam and "question" in case of a single question exam? For example, in a ...
1
vote
1answer
34 views

Fixing part layout using \patchcmd

I want to remove the linebreak between part numeration and part name as found here. However the solution doesn't work for me. MWE: \documentclass[draft, onecolumn, oneside, paper=a4, 12pt]{scrartcl}...
3
votes
3answers
41 views

Unexpected Results from \dolistloop

Given \def\CSVList{a,b,c}, using \dolistloop{\CSVList} does not seem to process the \CSVList as expected: Perhaps I am not understanding how \dolistloop is supposed to work, but this example is ...
2
votes
1answer
50 views

Show title in margin first time a work is cited

The core of my question is how to define a macro that does something different the first time it is called with a given argument. And further, have the ability to reset that so that that first time ...
1
vote
1answer
29 views

How to suppress setting page headers by \thebibliography?

I'm modifying an existing template so I'm stuck to certain conditions. \documentclass is book. Bibliographies are managed by cite package and I cannot use bibtex nor biblatex. There are several ...
0
votes
1answer
44 views

How can I patch the abstract, list of figures, and list of tables macros to be included in the ToC automatically?

We can definitely use \phantomsection \addcontentsline{toc}{chapter}{<name>} right after we begin the environments or type the relevant macro, which would include abstract, list of figures and ...
1
vote
2answers
61 views

Automatically insert bibliography before appendix

I came up with a new problem by automate my document. The requirement is to insert a bibliography at the end of a document. Therefore I use \AtEndDocument from etoolbox. This is working perfectly fine ...
1
vote
0answers
38 views

Calling author, title, etc without format

I am working on a document in which I use the environment titlepage for the cover. My problem is that I use later \@autor, \@title, etc, and since they are formatted on the cover; when I use these ...
3
votes
1answer
98 views

How to access etoolbox toggle inside Lua

I'm creating a package that uses etoolbox toggles but a good amount of the package is written in Lua. Is there a way to access the etoolbox toggles direct in Lua? I know that etoolbox uses a ...
6
votes
1answer
245 views

Add command at the beginning of all frames

I need to add a command \setRTL from the bidi package to write right-to-left text, at the beginning of every frame. Another answer does not solve the issue; any suggestions? \documentclass{beamer} ...
0
votes
1answer
59 views

Can't Get \xappto Working

I'm trying to learn how to use \xappto, and I've been working with this example. Why isn't this working? When I pass after row=\noexpand\midrule directly into \codeforpgf{} it works fine, but ...
8
votes
5answers
1k views

How to make table less cramped

I have a table which is defined using etoolbox but I'm not sure how to make it look less cramped. \documentclass{article} \usepackage{calculator} \usepackage{pgffor,etoolbox} \begin{document} \...
0
votes
2answers
86 views

Multipart Variable Definition

Is it possible to define a multipart variable and then check for its definition and use its multiple parts later? Here's what I mean: \documentclass{article} \usepackage{pgfplots} \usepackage{...
3
votes
6answers
114 views

Etoolbox Equivalent: Define Control Sequence via Macro

When using normal macro names I can set the value of a macro as \newcommand*{\SetMacro}[1]{\def#1{42}} \SetMacro{\Answer} and \Answer will have the value of 42. Is there an etoolbox way of invoking ...
3
votes
2answers
56 views

xpretocmd: Why are my arguments not working?

I just tried to keep track of my current chapter name, because I use the first letter for certain namings in my document, so I wrote this code to save it: \documentclass[12pt,a4paper]{scrreprt} \...
0
votes
0answers
49 views

How to remove hyperref/colour for Author only in the Author-Year Citation Natbib LaTeX? [duplicate]

I would like to remove the colour only for the Author Name in the citation created using natbib + bibliography for Springer (svjour3) journal manuscript. \documentclass[12pt,a4paper,referee]{...
1
vote
1answer
74 views

Conditional plotting by position in pgfplots groupplot

Edit: I was able to get the layout in the last image following the accepted answer. Just needs some visual tweaking now. I have some issues with compilation with LuaLatex, which I will troubleshoot ...
1
vote
0answers
38 views

Dynamic datatool group by

I found this code in datatool group by? \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{ff14.txt} ClassID; Schueler_Name; Schueler_Vorname; Subject 5a; Stiner; Markus; Big ...
2
votes
0answers
39 views

cleveref refers to appendix as chapter when titlesec is used

I use titlesec to adjust chapter headings for the report class (no page breaks in main report, but with page breaks in appendix). However, cleveref now refers to the appendix as "chapter A" instead of ...
3
votes
3answers
69 views

How to make compact data structure without parsing in Latex

Say I have 100 nodes that I want to draw with slight varations 100 times. I don't want to copy/paste all the code each time, that would be a lot of duplication and a lot of boilerplate. So instead I ...
1
vote
2answers
480 views

Remove blank space before chapter heading on top of new page

I want chapters in the report class to start 3em below the end of the previous chapter. To do this, I patch the \chapter command using titlesec and etoolbox. However, this adds blank space above the ...
3
votes
2answers
132 views

execute “makeatletter” code before and after a macro

I'm using subfiles package to handle a large project. I place the main file in the main directory, and subfile in a subdirectory. In order to use the \input command in the subfile while compiling in ...
2
votes
1answer
63 views

Building up and joining “internal” lists

How can I append to a pgfkeys-style comma-separated list? Or, alternatively, how can I define a macro to join an etoolbox list with a delimiter? For an environment I'm designing, I want to accumulate ...
3
votes
1answer
91 views

How to decide for the format of exam in (the beginning of) preamble

I use the exam class to produce exams with Latex. The exam can be in A3 format for small ones (Mid-Term's and so), or in A4 format. I can decide this, using the geometry package. I use some packages ...
4
votes
2answers
115 views

How can I use \dolistloop from etoolbox with \do redefined in preamble?

I am trying to use \dolistloop from etoolbox with the \do-command redefined in the preamble. However, the redefinition of the \do-command is ignored. If I put it within the document, it works as ...
3
votes
1answer
45 views

Why does docsvlist not work in an environment?

In an experiment to postprocess a table I encountered a discrepancy concerning docsvlist. The same code works (shows a table with a b...) when called directly in the document, but not (shows a table ...
5
votes
3answers
190 views

etoolbox for loop over range

Is there a way to run a command on a range of consecutive integers (say, 11, 12, 13, 14, 15), specifying only the first and last numbers (11 and 15)? Basically I'm looking for the general LaTeX ...
2
votes
2answers
99 views

nested uppercase command not working

I am trying to create a reliable command that turns the first character of it's input to uppercase. So far I have no success, especially since it needs to work when the inputstring contains commands ...
3
votes
1answer
289 views

eappto trigger undefined control sequence error when used with hyperlink

You can jump to the question in bold at the bottom if you want I want to add examples of theorem at the end of my documents (with link after theorem to acess examples) but while having the exemple ...
1
vote
2answers
106 views

How can I find the definition of latex macros?

So I've started to become more familiar with LaTeX, still a beginner but comfortable enough to try out the scary patchcmd from the etoolbox package. What has me mystified though is how people find out ...
6
votes
3answers
292 views

Using \csname in \renewcommand to change command definitions

I'm trying to write a macro to change the definitions of \thesection, \thechapter, and other commands for the sectioning prefixes. I want to redefine only one of the commands depending on the user's ...
5
votes
2answers
287 views

etoolbox instead of ifthen

I try to realize this with etoolbox instead of ifthen. What I have so far... \documentclass{article} \usepackage{tikzpagenodes} \usetikzlibrary{calc} \usepackage{etoolbox} \usepackage[contents={},...
0
votes
0answers
42 views

\isdefempty not working for multiple macros

I am still learning tex. The following example allows me to check if a variable exists, and if it does then prints some text in the PDF. This works great. However, when I add in a href, this appears ...
0
votes
0answers
62 views

Correct Use of \ifcsempty Command [duplicate]

The intent of this command sequence is to loop through the 3 options and display either the book/page or instrument no. for each. A excternal programatic function will validate that there is either a ...
1
vote
1answer
51 views

How to comment a package line before loading the package?

I can solve the issue bigfoot.sty:61: Package hyperref Warning: Option `hyperfootnotes' has already been used by commenting out the line 61: File: D:/User/Documents/latex/texmfs/install/tex/latex/...
3
votes
3answers
66 views

Call macro several times, output all the entries

I'm writing my own letter class and I was wondering how I could deal with several attachments. Currently, I made myself a macro accepting one parameter that should be set in the preamble. The content -...
2
votes
2answers
73 views

How do I set a toggle based on the end of a string

Compiling \documentclass{article} \usepackage{etoolbox,xstring} \newcommand{\strendswithfoo}{\IfEndWith{bar-foo}{foo}{true}{false}} \newtoggle{strendswithfoo} \settoggle{strendswithfoo}{\...
1
vote
0answers
43 views

datatool & etoolbox - more expansion shenanigans

This is the code in question: \documentclass{article} \usepackage{etoolbox} \usepackage{datatool} \usepackage{longtable} \usepackage{fp} \def\initialValue{10} \DTLnewdb{thisEntryDBWarehouse} \...
2
votes
2answers
75 views

Why does \notblank still believe its argument not be blank, even after expansion?

In the following MWE: \documentclass{article} \usepackage{etoolbox} \usepackage{xparse} \makeatletter \NewDocumentCommand{\@mkCommands}{mm}{% \expandafter\NewDocumentCommand\csname @#1\endcsname{}...
2
votes
1answer
48 views

varsfromjobname isn't working in a test

I am trying to give a command depending on some information in the filename. So I use gettwofromjobname in a etoolbox-test in a file named test-a.tex, but it isn't giving me the true. Any idea why? ...
5
votes
1answer
289 views

How to redefine the theorem environment like beamer?

I am trying to prepare a slides from the lecture notes which is already prepared in latex. If the notes is not prepared already, tcbtheorem is a wellknown way to showcase the theorem environment. But ...