Skip to main content

Questions tagged [expandafter]

1 vote
1 answer
44 views

Trying to implementing this : \RegistVarType{obj}BG{pink}Font{\sf} will produce a command named \obj, \obj c will display a "c" in \sf font with pink background color; also, \RegistVarType{...
YCH817's user avatar
  • 341
8 votes
3 answers
192 views

I’m defining datas in LaTeX with a custom command that stores both a label and a number: \documentclass{article} \usepackage{parskip} \newcommand{\data}[3]{% \expandafter\newcommand\csname #1\...
taiwan12's user avatar
  • 2,056
5 votes
2 answers
178 views

I want to copy a cs name to another name: \documentclass{article} \newcommand{\renewcommandcopycs}[2]{% \expandafter\RenewCommandCopy\expandafter {\csname#1\endcsname}% \expandafter{\csname#...
sqrt6's user avatar
  • 73
3 votes
2 answers
154 views

Problem I'm writing a LaTeX macro system to manage acronyms in Overleaf, and I need to dynamically check whether a macro like \acronym@CH@used exists. The acronym key (e.g., CH) is stored in another ...
slimguat's user avatar
1 vote
1 answer
78 views

I'm trying to use a defined list with the \forcsvlist command. From my understanding, I have to expand the defined list before the \forcsvlist command executes. I have tried so many iterations using \...
memo913's user avatar
  • 55
3 votes
1 answer
119 views

I have an environment page where \begin{page}{some page id} is not equivalent to \def\pageid{some page id} \begin{page}{\pageid} I desire an incantation which allows me to take a \pageid and expand ...
Louis Wasserman's user avatar
2 votes
2 answers
128 views

I have madethis command \RepNum{#1}{#2}. This command is created to indicate the number of times the argument #1 is repeated in the list #2, separated by commas. \def\RepNum#1#2{% \begingroup \...
Serubi's user avatar
  • 177
0 votes
1 answer
129 views

The macro \usevar{} is defined in the below code and it can be expanded with \ExpandArgs{e} command. Is it hard to expand it with expandafter instead ? \documentclass{article} \usepackage{etoolbox} \...
xcn's user avatar
  • 1,289
1 vote
3 answers
190 views

I defined command \a and \b in the following code. Expanding \a just need one step and \b should take two steps. How to expand \b only using \expandafter ? \documentclass[12pt]{article} \usepackage{...
xcn's user avatar
  • 1,289
5 votes
6 answers
379 views

I have a csv file with typical row content ["66,"primary description","description for LoF","myjpeg.jpg"] and I want to create a named macro for each row e.g for ...
aldobranti's user avatar
1 vote
2 answers
129 views

I am writing a math paper consisting of several Definitions, Lemmas, Theorems, Corollaries, etc. Every such part can have a title and/or a reference. In the text, I would like to have both the title ...
Elia Immanuel Auer's user avatar
1 vote
1 answer
174 views

I have an issue when trying to use variables in a command (\ResearchModule). I read up to 8 lines from a text file and have them set to elements of an array (using code thanks to egreg!), with \...
MrOakPlanks's user avatar
4 votes
1 answer
87 views

I'm trying to use a macro to generate arguments that should be passed to \charge. I'm trying this: \documentclass{minimal} \usepackage{chemfig} \begin{document} \charge{-135:1pt=5}{C} \...
ttsc's user avatar
  • 437
7 votes
3 answers
435 views

I get it when I write: \expandafter\def\agent{Hello} \expandafter\def\expandafter\agent\expandafter{\agent World} \agent result: Hello World It doesn't work for me when I write: \expandafter\def\...
Juli's user avatar
  • 131
3 votes
3 answers
251 views

I want to define a new command, which is a composition of commands already defined within the \csvsimple package. Therefore I've written the following code, which correctly works for my purpose: \...
MattiaP's user avatar
  • 43

15 30 50 per page