I know how to type a fraction as you would write a fraction in Mathematica (9). How do you type Binomial[n,k]
as $\binom{n}{k}$ in Mathematica? Is there a single reference page that contains all the Mathematica operations like this, that you can type in math notation?
2 Answers
The possibility to insert operators and functions as you know them from mathematics is not possible for all things. Usually, you find the special input possibilities on the reference page of the function in the Details section. See for instance the documentation of Integrate
.
For Binomial
there seems to be no such 2d input, because as you already found out, $\binom{n}{k}$ is interpreted as vector.
The 2d input should in general be used with care, because it is sometimes harder to spot errors. And, when you want to copy a nice looking
into a text editor or to this site, you end up with
\[Integral]Sqrt[x + Sqrt[x]] \[DifferentialD]x
which just looks awful.
Edit
Szabolcs came up with the idea that you could make a button for your needs. To see how this is derived, you first look at the TraditionalForm
of Binomial
Binomial[n, k] // TraditionalForm
Now you go in the output cell and navigate to Cell->Show Expression
Cell[BoxData[
FormBox[
TemplateBox[{"n","k"},
"Binomial"], TraditionalForm]], "Output",
CellChangeTimes->{3.5952851298543243`*^9, 3.595285236592402*^9}]
At this point, you see the you need to create the inner TemplateBox
and therefore
DisplayForm[
ButtonBox[
TemplateBox[{"\[SelectionPlaceholder]", "\[SelectionPlaceholder]"},
"Binomial"], BaseStyle -> "Paste"]]
creates a button which lets you insert Binomial
as correct 2d expression.
-
$\begingroup$ Here's a paste button:
PasteButton[ RawBoxes@TemplateBox[{"\[SelectionPlaceholder]", "\[SelectionPlaceholder]"}, "Binomial"]]
. You could update your answer with it. $\endgroup$– SzabolcsCommented Dec 6, 2013 at 2:21 -
$\begingroup$ @Szabolcs Thanks, I updated the post. $\endgroup$ Commented Dec 6, 2013 at 2:24
I would use the menu option Cell | ConvertTo
and select TraditionalForm
. The keyboard shortcut for this in OSX is Shift + Command + T. Here is an animation showing this in action:
Binomial
? (3) Or displayBinomial
in that form? TraditionalForm will do (3). Use Ron's answer for (1). (2) is not simple and I don't recommend it. When talking to computers it's best to stick to a clear, unambiguous notation (which the usual math notation is not---it always relies on a human reader who understands the problem and the context). $\endgroup$Binomial
. Yes, a little while after I asked this, I realized why (2) would be a problem. $\endgroup$