{expansion} is about expanding tokens, including the manipulation of expansion order and the suppressing of expansion.

learn more… | top users | synonyms

3
votes
0answers
22 views

\ThisStyle \SavedStyle painfully slow … alternatives?

While working with customised hat glyphs using the first version of this solution, pdflatex started taking a long time compiling a document. That linked answer notes that it's a slower solution, but ...
3
votes
0answers
119 views

\if and \fi inside different \def macros

Recently I failed to solve specific task in LaTeX. I wanted to make document with several sections, each divided on several subsections. Each section I had placed to separate files, and used \input ...
3
votes
0answers
86 views

Difficulty saving formatting to a sequence to be called later in my code

I had an idea about how to answer this question and started putting some things together. I wanted to put something together that was fairly powerful and could handle simplification of linear ...
2
votes
0answers
21 views

How to make \tl_upper_case:n in section's argument bookmark compliant?

Thanks to recent revision of the coverage of UTF-8 input for pdfTeX and accents with the expl3 (see updated answer of http://tex.stackexchange.com/a/286703/18401), the following code works nicely: ...
2
votes
0answers
50 views

Defining and expanding macros In loops

I want to define and expand macros in a \foreach loop. The names of the macros depend on the iteration step. The macros I define are interpreted as strings rather than sets of numbers that I actually ...
2
votes
0answers
28 views

Robust handler of arguments with conditionals and complex elements

Context This question is a follow up of the answer of this question Spurious space on moderncv \cventry using \if Problem The problem is that complex content (for example, itemize on the content of ...
2
votes
0answers
124 views

Checking if first portion of an environment's content is empty

Motivation: I am working on a very personalized Exercise/Answer package for my colleagues. The exercise, exsheets, etc. packages don't do what I need. To accomplish this, I create an exercises ...
1
vote
0answers
28 views

Expansion control in “isEmpty” condition

There is a known method of testing if an argument is empty or not. \def\isEmpty#1{% \if\relax\detokenize{#1}\relax empty% \else NOT empty% \fi } I used this trick to ...
1
vote
0answers
72 views

what is the change in macro expansion when using environ and newenviron as compared to the standard environment

The packages environ and newenviron both provide an alternative to the standard environment macros included with LaTeX. The main difference is that they make it possible to refer to the environment ...
1
vote
0answers
36 views

Passing background color to \lstinputlisting

In question Passing parameter in presence of an xkeyval value I received two ideas for dealing with passing an option to a macro. Namely, \expandafter\lstset\expandafter{\ME@options} and ...
1
vote
0answers
36 views

limiting expansion in marks

I'm trying to pass something complex (e.g. tabular) to output procedure through marks. Is there any natural way to protect from expansion everything that should be protected (presumably because of ...
0
votes
0answers
100 views

Ignoring parts of text inside macro

Consider the following code: \documentclass{book} \usepackage{pgffor} \begin{document} \newcommand\containers{ \cont{aaa{\bf don't xstring me}aaa} \cont{bbb\large bbb} ...