Stack Exchange Network

Stack Exchange network consists of 175 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 [expansion]

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

0
votes
1answer
148 views

Gnuplottex: Pass latex command to gnuplot script

I want to access and plot the same data from different LaTeX documents (a paper and a beamer presentation) using gnuplottex. The data and the gnuplot script is stored at some individual position ...
4
votes
0answers
93 views

\string-primitive works in unexpected ways in LuaTeX — Where can I find exact documentation of the \string-primitive in LuaTeX?

Where can I find exact documentation of the \string-primitive in LuaTeX? I ask this question because I encounter some unexpected (at least by me) behavior when compiling the example below with LuaTeX....
2
votes
0answers
119 views

Write fully expanded macros to auxiliary files

Considering the following code snippet: \documentclass{article} \usepackage{xparse} % \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \NewDocumentCommand{\edeftest}{m}{\edef\test{#1}#1} \...
2
votes
0answers
100 views

Capturing the definition of a LaTeX command in a Lua variable

I'd like to get the meaning of a LaTeX command in fully expanded form in a lua variable. What is the easiest way of getting there? In other words, what should I be replacing the function getmeaning ...
2
votes
0answers
143 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 ...
2
votes
0answers
166 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
77 views

Creating a custom node shape with a variable number of anchors

For the sake of training my self on PGF, I want to create such node shape having multiply ports with a selecting switch as shown below This is my attempt to create this node for a particular number ...
1
vote
0answers
84 views

Change the output of the sage function latex() on a string

Currently if you run the sage command latex('a string') using sage (or sagetex) the latex output looks like: \text{\texttt{a{ }string}}. I would like to eliminate either of these (preferably the \...
1
vote
0answers
34 views

Problem on list in custom command using adjustbox

I have a problem, that seems to be quite common : code expansion. I have declared a command, that use an other command that use adjustbox. So far so good, until I need to pass to the first command a ...
1
vote
0answers
62 views

Macro for creating uppercase and lowercase label glossary entries with one command

I am using the glossaries package for acronym handling, and I have already written a large document with many entries all using lowercase labels. However, it turns out that when I use those acronyms ...
1
vote
0answers
42 views

Output plain ascii text to output file (expandable \IfStrEqCase with multiple matches)

This question is specfically about an expandable version of \IfStrEqCase (with multiple matches) as per Modified \IfStrEqCase with multiple matches per case. However, in case this is an x-y problem, ...
1
vote
0answers
53 views

pgfkey as integer for ifnum

I'm sure this has something to do with expansion, and I am quite new to using the pgfkeys package so I'm possibly missing some sort of basic practice, but I cannot find anything that remotely looks ...
1
vote
0answers
58 views

Modify `\funcdef` macro to use `pgfkeys` instead of `keyval`

I attempted to modify the \funcdef macro from egreg's solution from A macro adding or removing parenthesis automatically to use pgfkeys, but am running into some difficulty (probably related to some ...
1
vote
0answers
51 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
91 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
47 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
54 views

Expand one more time as needed? To compose with a macro that requires a maximally expanded argument?

Consider the case below as a minimal example. But the questions concerns understanding nonfragile composition of macros each which parse using something like xparse. (code below thanks to egreg) \...
0
votes
0answers
39 views

Weird \hfill behavior with custom length calculations?

I asked a question earlier about trying to write a macro/environment that would take in a number of \choice commands and then write them out in a way to minimize vertical space consumed, but still ...
0
votes
0answers
101 views

Expandafter, but with full expansion?

Problem. I want to write a macro, that effectively replaces \MyMacro\SomeOtherMacro{arg1}{arg2}StuffAfter by SomeOtherMacrosExpansionWithArg1Arg2\MyOtherMacro StuffAfter i.e. essentially \...
0
votes
0answers
82 views

Expanding macro in \index argument

I have a command \persName{key} that expands to the Name of a person represented by a key-string. I would like to create a command \eindex that can have this command as argument, expanding it fully ...
0
votes
0answers
44 views

Are using lists to store commands prone to stack exhaustion?

Background Using a handful of answers in this site, I have come up with a solution for building a list of equations (with tocloft), such that two or more of them can be grouped inside an align ...
0
votes
0answers
159 views

Problem with nested IfSubStr calls

I have the following code in my preamble: \usepackage{xstring} \newcommand\myhelpermacro[1]{\IfSubStr{#1}{true}{Text contained the word "cat"}{Text did not contain the word "cat"}} \newcommand\...
0
votes
0answers
55 views

Is it possible to examine the current titleformat and titlespacing for a particular title class?

I just found out that you can do \show\titleformat in interactive mode to see the definition of the titleformat macro. Now I'm wondering how I can see what the title format for \chapter (for example) ...
0
votes
0answers
62 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 ...
0
votes
0answers
153 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} \...