Skip to content

undefined control sequence. #1382

Closed Answered by hmenke
apprenticius asked this question in Q&A
Discussion options

You must be logged in to vote

The body of a \foreach loop forms a TeX group, which means that definition inside the body will be local to that group. The simplest workaround is to just make your definitions global.

\newcommand*\hash[3]{%
	\expandafter\xdef\csname #1_#2\endcsname{#3}%
	\expandafter\gdef\csname #1\endcsname##1{\csname #1_##1\endcsname}%
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@apprenticius
Comment options

Answer selected by hmenke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants