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
3answers
40 views

How to make chapter first page use mystyle?

It seems chapter first page use plain style. I created mystyle. How to make chapter first page to use mystyle? \documentclass[twoside]{report} \usepackage{lipsum} \usepackage{fancyhdr} \pagestyle{...
0
votes
0answers
52 views

How to set fancyhdr on chapter initial page of two side report?

\documentclass[twoside]{report} \usepackage{lipsum} \usepackage{fancyhdr} \pagestyle{fancy} \begin{document} \chapter{First} \lipsum[1-9] \end{document} Given the obove as a start. I see one ...
1
vote
1answer
51 views

Toggle row numbers & dotfills in table

I'm trying to add automatic row numbers and dotfills to a table, with a toggle that disables them for certain rows, however it doesn't work as expected. In the MWE below, the toggle is working for row ...
7
votes
1answer
95 views

etoolbox: AtBeginEnvironment is not At Begin Environment

I tried the following MWE: \documentclass{article} \usepackage{etoolbox} \AtBeginEnvironment{table}{AtBeginEnvironment\par} \AtEndEnvironment{table}{AtEndEnvironment\par} \BeforeBeginEnvironment{...
5
votes
1answer
63 views

Obeylines and \gappto from etoolbox

In order to simplify data entry with as little markup of the data as possible, I am attempting the following: \documentclass{article} \usepackage{etoolbox} \begingroup \obeylines \gdef\ing#...
5
votes
2answers
356 views

“Patch failed” in EMNLP Style Template

I was trying to use the LaTeX files for the EMNLP 2019 conference (download link can be found here), but when I try to compile the provided example .tex file, it doesn't work and I get the following ...
1
vote
1answer
24 views

etoolbox + koma-script: Warning 'seems someone has broken package auxhook'

I use etoolbox's \AtEndPreamble to load the package hyperref at the end of the preamble. Doing so in a koma-script document results in the warning Class scrartcl Warning: seems someone has broken ...
0
votes
0answers
46 views

End mark switching fails because \@ifnextchar's behavior in an environment hook is not as naively expected

For the purpose of readability, a proof can be segmented into claims. The proofs of claims (which I will call "reasonings" in the following) are usually "executed" immediately and within the outer ...
0
votes
0answers
46 views

Increase space between groups with package nomencl & etoolbox

I am writing a document and I need to have a table of notations. I wanted to reduce its size while keeping a good space between the different groups. I understood that: I can use \setlength{\...
5
votes
1answer
131 views

How to compare a string to a cs from a read properly?

The scenario: reading a date in a yyyy-mm-dd form from a file to a cs. This cs later gets compared to a 'current date' macro to write a few args in a specific way to an external file. The current day ...
0
votes
0answers
23 views

Two column bibliography in 9pt with no Bibliography title, no article titles and use journal abbreviations

I'm trying to squeeze a two column bibliography into a one column article document using this in the preamble. So far so good: \usepackage{multicol} \usepackage{etoolbox} \patchcmd{\thebibliography}{\...
0
votes
2answers
62 views

Problem patching by appending to \footnote command. “Missing \endcsname inserted”

I want to test whether a macro is (a) outside or (b) inside a \footnote command, similar to what's asked in (i) How to test if I'm currently in a footnote or not, (ii) Detect whether I'm in a \...
1
vote
1answer
64 views

Problem solutions at end of chapter

I'm writing a document with multiple chapters. Each chapter has problems and each problem has a solution. I want some of the solutions to be right after the problem and the others to appear at the end ...
1
vote
1answer
44 views

header/footer only on the current page, or also its following pages

I define a macro named \pagecurrent which will be used in other macros related to header and footer, e.g. \cfoot, \chead, \renewcommand{\headrule}.... It's function is to determine whether the action ...
0
votes
2answers
50 views

Code seems to have no effect when inside `iftoggle`

In this answer I have been suggested to patch hyperref’s automatic pdfauthor metadata handling mechanism as follows. The goal is to have PDF metadata work with authblk and multiple authors. \...
6
votes
1answer
128 views

How to save boolean values into the aux file? (using e.g. etoolbox's toogles)

I want to use etoolbox's toggles to achieve the following: In the preamble a toggle is created, during typesetting the document its value might change and at the end I want to write the value to the ...
4
votes
1answer
70 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
36 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
87 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
40 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
52 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
63 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
33 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
66 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
344 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
50 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 ...
2
votes
1answer
70 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
46 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
51 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
37 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
51 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
160 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
40 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
102 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
306 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
73 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
2k 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
99 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
137 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 ...
2
votes
2answers
69 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
121 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
110 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
42 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 ...
3
votes
0answers
50 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
80 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
743 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
201 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
90 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
97 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
159 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 ...