Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • Nice! (and some more characters to take me over the limit) Commented Jul 27, 2010 at 11:59
  • The only thing I don't like about this is that it would result in lots of code duplication if I wanted to also do something like define \cX as \mathcal{X} for each letter X. Commented Jul 27, 2010 at 15:18
  • 4
    Following the scheme above it wont be difficult to define a more general \MapCommand{\Cmd}{a,b,c} which expands to \Cmd{a}\Cmd{b}\Cmd{c}. Commented Jul 27, 2010 at 15:33
  • 1
    @Juan: This is very useful! Unfortunately, I don't have much practice with TeX/LaTeX beyond writing my documents in it and defining the occasional macro, so I don't really understand how your solution works, and I'm not able to generalize it to something like a \MapCommand (which is what I've been trying to do to no avail). I was wondering if you could give a hint as to how to do it, or even a full implementation? Of course, I know the value of learning to do something myself, but in this case I'm sufficiently exasperated to ask for a solution that I will then try to understand. Thanks! Commented Aug 30, 2011 at 7:23
  • 2
    @Zev: I added a new simpler solution which is more robust and hopefully much more easy to understand. It relies on the etoolbox package and its command \forcsvlist which is basically the "map command" that you are looking for. Have a look at the documentation of that package. Commented Aug 30, 2011 at 9:13