Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5955 > unrolled thread
| Started by | Tom De Vries <tidetabletom@gmail.com> |
|---|---|
| First post | 2011-10-28 09:38 +0000 |
| Last post | 2011-11-01 11:59 +0000 |
| Articles | 3 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
InputAliases Tom De Vries <tidetabletom@gmail.com> - 2011-10-28 09:38 +0000
Re: InputAliases magma <maderri2@gmail.com> - 2011-11-01 12:00 +0000
Re: InputAliases magma <maderri2@gmail.com> - 2011-11-01 11:59 +0000
| From | Tom De Vries <tidetabletom@gmail.com> |
|---|---|
| Date | 2011-10-28 09:38 +0000 |
| Subject | InputAliases |
| Message-ID | <j8dt66$kdl$1@smc.vnet.net> |
Hello everyone,
I hesitate to share because I'm mostly a watcher and learner.
I benefit from the input of this group, and I know I don't know a lot
about Mathematica!
I learned something that might be useful and so I thought, even at the
risk of sharing something obvious, maybe someone might benefit.
I haven't used InputAliases too much, but experimented a bit with them.
I found out that you can actually use more than just simple word replacements.
I typed a few expressions I was using for some math notes I was
creating, used Show Expression on the cell, got the required parts,
and then created an input alias with that.
I was pleasantly surprised to find that it worked!
Here are a couple examples.
If you aren't familiar, you can use these, type esc, the alias, and
esc to get it to expand.
So , for example, if you evaluate the line below in a notebook, then
,type something like Here is the distance formula, esc key,
distform esc key, it will expand to give you the distance formula.
If any others are using InputAliases, I'd be happy to hear how, and
if there are other ways to help with typing and speeding that process
up.
Tom
SetOptions[EvaluationNotebook[],
InputAliases -> {
(*sequence and series*)
"cr" -> "common ratio",
"gs1" ->
Cell[TextData[{"For a ", "geometric sequence/series, ", " ",
Cell[BoxData[
FormBox[StyleBox[
RowBox[{FractionBox[SubscriptBox["t", "2"],
SubscriptBox["t", "1"]], "=", " ",
RowBox[{FractionBox[SubscriptBox["t", "3"],
SubscriptBox["t", "2"]], "=", "r"}]}],
"DisplayFormula"], TraditionalForm]]]}], "Text"],
(*coordinate geometry*)
"distform" ->
Cell[TextData[
Cell[BoxData[
FormBox[RowBox[{"d", " ", "=", " ",
SqrtBox[
RowBox[{SuperscriptBox[
RowBox[{"(",
RowBox[{SubscriptBox["x", "2"], "-",
SubscriptBox["x", "1"]}], ")"}], "2"], "+",
SuperscriptBox[
RowBox[{"(",
RowBox[{SubscriptBox["y", "2"], "-",
SubscriptBox["y", "1"]}], ")"}], "2"]}]]}],
TraditionalForm]], FormatType -> "TraditionalForm"]],
"Text"]
}]
[toc] | [next] | [standalone]
| From | magma <maderri2@gmail.com> |
|---|---|
| Date | 2011-11-01 12:00 +0000 |
| Message-ID | <j8on0n$lga$1@smc.vnet.net> |
| In reply to | #5955 |
One more thing...for very complex replacements check out the AddInputAlias command.
[toc] | [prev] | [next] | [standalone]
| From | magma <maderri2@gmail.com> |
|---|---|
| Date | 2011-11-01 11:59 +0000 |
| Message-ID | <j8omvo$lfp$1@smc.vnet.net> |
| In reply to | #5955 |
Thank you for sharing Tom. Per se, the information is not new. Just by looking at InputAliases in the Doc Center clearly says that any expression is acceptable as an input alias. Aliasing full expressions is probably something that people do not do frequently, so it was a very useful reminder. Please note 2 things: 1- if you use the above code, you will lose the standard input aliases in your current notebook. It is better to ADD to the current InputAliases list. 2- InputAliases are linked to the notebook, so they persist even if you Quit the session or if you save/close/open the same notebook again. this is one more reason you may wish to preserve the standard InputAliases.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web