This is perhaps not a very intelligent question, as I am not (of great intelligence nor) well versed in raw tex, even more so \catcode but in the code given in a previous answer there is a use of \catcode:

        \def ,{\mskip\pFqskip\relax}%

Is there a reason why the first


has no backslash and the later ones do? This former answer explains that the backslash is for "special catcode" characters, whate'er that may be, but why is it omitted in the first instance and not the second?

Then of course, my real question is what is the \catcode's purpose there? I roughly understand what an active character is, but not its role in the code. Would it perhaps explain why when I use the command as follows:


I get no commas between the a, b, and c, or the d and e, as I would prefer? [update, I think I just figured it out that the first part redefines comma to be small skips, given by \pFqskip{8mu}, but I am not sure why, but I can see why this would cause the commas to disappear.]

Again, probably elementary questions, but I am a bear of little TeX.


There is no reason why it should be \catcode`,=\active in the first case and \catcode`\,=\active in the second. Both could be either with \, or ,. Escaping the character is necessary only for \, % (and other less important cases), but escaping is not harming either.

Probably the author of the macros was concerned that an active character might do something strange if not escaped.

The commas disappear because, when a character is active, it is like a macro and it is replaced by the replacement text, in this case \mskip\pFqskip\relax.

Actually this is not the best way to define that macro for typesetting hypergeometric functions parameters.

A cleaner way, that allows \pFq to be the argument to another command, is

\usepackage{amsmath} % for \genfrac

\mathchardef\pFcomma=\mathcode`, % keep a copy of the comma


The comma is made "math active", and its meaning becomes: "print a comma and insert a space" (if you don't want the comma, remove \pFcomma from the definition). I've reduced the spacing, because commas add some after them.

The lines


define locally a meaning for the active comma, then this meaning is triggered by \mathcode`,=\string"8000 (the \string may be necessary in case babel is used). The rest is as in the previous version.

  • 2
    Well, shivver me timbers...aye, certainly what I was looking for, with a touch of the sublime as well. Many thanks... – asllearner Mar 8 '12 at 1:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.