New for Mathematica 12(?) seems to be a formatted "black board" style of the former C[1], C[2], ... constants in Mathematica 11. How do I type these with formatting at input? C[1] etc. still works, but how to write it formatted? I could not find it in the escape sequence list. TIA.
1 Answer
$\begingroup$
$\endgroup$
1
You could use InputAutoReplacements
so that c1
gets automatically converted:
CurrentValue[EvaluationNotebook[], {InputAutoReplacements,"c1"}] = TemplateBox[{"1"},"C"];
or you could use InputAliases
so that you need to use the Esc key as usual:
CurrentValue[EvaluationNotebook[], {InputAliases,"c2"}] = TemplateBox[{"2"}, "C"];
-
$\begingroup$ That is so 'cool'. There is so much to discover in Mathematica, but very hard to learn (without asking on this excellent site). $\endgroup$– mf67Commented Aug 27, 2020 at 18:55
C[1]
as usual, highlight it, and then evaluate it in place withCtrl
+Shift
+Enter
. $\endgroup$TemplateBox[{"i"}, "C"]
so you can always copy, paste, and edit that. If you're working with formulae and are gonna send them through the FE you can doFormat[Subscript[\[ConstantC], i_]] := RawBoxes@TemplateBox[{ToBoxes[i]}, "C"];
and then use that form and have it spit out the appropriateC[i]
form after evaluation. You can also addMakeExpression[SubscriptBox["\[ConstantC]", i_], _] := C[ToExpression[i]]
to make it a proper alias ofC[i]
or modifyInputAliases
to give youTemplateBox[{"\[Placeholder]"}, "C"]
. $\endgroup$