summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pygments/formatters/latex.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pygments/formatters/latex.py b/pygments/formatters/latex.py
index d658e7ca..e109ebdd 100644
--- a/pygments/formatters/latex.py
+++ b/pygments/formatters/latex.py
@@ -286,7 +286,7 @@ class LatexFormatter(Formatter):
cp = self.commandprefix
styles = []
for name, definition in self.cmd2def.iteritems():
- styles.append(r'\def\%s@tok@%s{%s}' % (cp, name, definition))
+ styles.append(r'\expandafter\def\csname %s@tok@%s\endcsname{%s}' % (cp, name, definition))
return STYLE_TEMPLATE % {'cp': self.commandprefix,
'styles': '\n'.join(styles)}