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

learn more… | top users | synonyms

3
votes
0answers
126 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
88 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
48 views

Macro with \afterassignment syntax?

Say for some reason I want to make a macro with input stream behaviour mimicking that of \afterassignment and \aftergroup. Namely, I want to absorb exactly one token from the input stream following ...
2
votes
0answers
127 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
26 views

.tex file with catchfilebetweentags macros expanded

I have a .tex file, say original.tex, where I have imported snippets from several other files using the \catchfilebetweentags command. For archiving, I wish to produce a version of original.tex that ...
1
vote
0answers
26 views

Expand variable in pgfplots key

In the example below I am trying to set explicitly some numbered styles and then loop through those styles in a plot. However the variable \i doesn't seem to expand correctly in mystyle\i (however it ...
1
vote
0answers
24 views

Need help with grouping and expansion control

I am trying to define macros, which take a delimited list and pass each element to a macro (that takes one argument). I have fully working versions of them that iterate over 1) all elements in a list, ...
1
vote
0answers
75 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
38 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
42 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
113 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} \...