0

With LaTeX macro

\newcommand{\CH}[2]{#1\choose#2}

and input

\CH63=20

my hope was to get the equivalent of

{6\choose3}=20

but I get

{6\choose3=20}

instead.

I know how to fix the text to get what I want, but I really want to change the macro. Any ideas? And if you know, where did you find it, since I spent a considerable time to find an online answer and would like to have access to a document that can provide answers to questions like this one.

migrated from math.stackexchange.com Jun 8 '14 at 8:00

This question came from our site for people studying math at any level and professionals in related fields.

  • Welcome to TeX.SX! Your post was migrated here from another Stack Exchange site. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – Joseph Wright Jun 8 '14 at 8:09
  • 1
    In terms of documentation, you are using a plain TeX command here with LaTeX: you are 'on your own' in many ways (you have to know what you are doing by, for example, reading The TeXbook). The answer covers things in the specific case, but more generally the braces used to set up a \newcommand don't 'count' for grouping around a construct like \choose, hence needing a second set. – Joseph Wright Jun 8 '14 at 8:11
5

You need to use \newcommand{\CH}[2]{{#1 \choose #2}}. The second set of parenthesis will keep the choose command self contained. Alternatively, your could use: \newcommand{\CH}[2]{\binom{#1}{#2}}. Or, frankly, why not just use \binom?

  • 2
    \let\CH=\binom :) – wipet Jun 8 '14 at 8:17

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.