This is for questions about creating and using custom notations. For help on the use of the built-in operators, see syntax.
12
votes
2answers
275 views
Going full functional (Haskell style)
I'm trying to define some notation so that Mathematica code would be more functional, similar to Haskell (just for fun): currying, lambdas, infix operator to function conversion, etc.. And I have some ...
2
votes
1answer
72 views
Notation not recursive enough?
My notation is not recursing enough. For example,
Notation[W[a_ | b_] ⟹ foo[a_, b_]/foo[b_]]
Notation[W[a__, b_ | c_] ⟹ W[a__ | c_]W[b_ | c_]]
Then
...
3
votes
1answer
80 views
Vertical “fractions” with more than 2 parts
Standard FractionBox syntax allows only 2 arguments and creates 2-part fraction for numerator and denominator.
Is it possible to draw similar construction, but ...
3
votes
1answer
159 views
Simplistic Notation example
Notation package looks poorly documented.
For example, GridBoxDividers option is not documented at all.
Can someone give me a simplistic example of a Notation set ...
1
vote
1answer
87 views
How to enter arrows in Notation function?
It is not clear, what symbol is used in Notation function description for arrows? How to enter it in textual mode within Workbench?
Here: ...
5
votes
1answer
125 views
Override @ to mock Java Classes
This question appears impossibly long so apologies in advance (skip to the bottom if you want to see the actual questions).
I want to be able to mock Java Classes in Mathematica code. For example, I ...
5
votes
1answer
270 views
Using the symbol I for electrical current [duplicate]
I would like to use the I as a symbol for the electrical current. How can I redefine it, so it is not interpreted as the imaginary unity?
2
votes
0answers
117 views
Syntax colouring when using Symbolize
I need to use symbols with suffixes in order to make my code readable in relation to the Eurocodes. To do this I use Symbolize from the ...
2
votes
1answer
246 views
How to define the Einstein summation convention in Mathematica?
How to define a Einstein summation convention in Mathematica?
Say, how to let Mathematica know T[i,i] equals ...
4
votes
1answer
68 views
Setting a binary operator Flat
I defined a binary operator in as the first statement in a new Mathematica notebook.
{x1_, y1_} ⊕ {x2_, y2_} := Module[{}, Print["do anything"];]
where the code ...
-1
votes
3answers
429 views
Examples of (well coded) packages using custom notation
Which packages do you know of, that have the following properties:
using custom notation (for input AND output would be preferable)
well coded & designed (from your subjective perspective!)
3
votes
0answers
122 views
Notation Package Quirk for single Symbols
I encounter the following quirk in the Notation package:
consider the following ==> and <== declarations
...
3
votes
0answers
170 views
Best Practice for using Notation, $Pre, MakeExpression in a package
I'm setting up a package that defines a custom Notation.
I'd like to inquire about best practices and possible issues of:
using the Notation Package
using $Pre ...
5
votes
3answers
181 views
Map Input A B C to MyProduct[A,B,C] (NOT to Times[A,B,C])
In writing my own (noncommutative) product I want to avoid typing redundant symbols like
A.B.C or A**B**C, I just want to type ...
6
votes
2answers
292 views
How to tell Mathematica that a function is dependent on other variables?
I am trying to derive some turbulence model dependencies and I am using Reynolds averaged Navier-Stokes equations. What I am trying to do is to tell Mathematica that OverBar[u] is dependent on x,y,z ...
4
votes
2answers
128 views
How do I mimic the functionality of “<>”?
The Cell expression for:
<>
is
Cell[BoxData["<>"], "Input"]
However similar expressions are parsed into ...
6
votes
1answer
175 views
$\TeX$ conversion, support for \hphantom
I'm trying to write some $\TeX$ conversion for a tensor with an upper and a lower index, but I would like the lower index to be displaced to the right by the width of the upper index. In (La)TeX I ...
8
votes
2answers
259 views
How can one define an infix operator with an arbitrary unicode character?
You can setup "UsefulFunction[a, b]" to use custom infix notation "a [LeftRightArrow] b" as follows:
...
16
votes
1answer
277 views
Prefix operator with low precedence
The question is simple, but I will elaborate on the background as well for those interested in the idea:
How to define a new operator with specified precedence value?
Background
Mathematica was ...
13
votes
5answers
646 views
Having the derivative be an operator
How do I create an operator which acts like a derivative to everything to the right of it:
for example:
$ \left( \partial_x + \partial_y + z \right ) x \psi $
How do I make that evaluate to:
$x ...
8
votes
2answers
195 views
Custom Format for “constructors”
Say I have a the typical Mathematica linked list structure defined like so:
Attributes[Pair] = {HoldAllComplete};
Nil = Pair[];
Cons = Pair[#1, #2]&;
It's ...
7
votes
1answer
174 views
Assignment rule to distribute matrix-multiplication over custom notation
I'm trying to write some code to do basic algebraic manipulations in BraKet notation.
Thus far I have a function KetToVec which will convert any expression of the form a1 Ket[s1]+ b Ket[s2] +... to a ...
13
votes
2answers
380 views
How to use subscript in pattern names?
For example I want to define a function with parameters σx and σy, that is, the function will be declared as: f[σx_,σy_] := . . ...
8
votes
1answer
2k views
7
votes
1answer
173 views
Can the Notation function support complex structures on its left hand side?
In my investigation of the possibilities offered by the Notation package, I came over a limitation in the complexity of the left hand side symbol. For instance, although I am able to enter
...
13
votes
2answers
235 views
Difficulties in creating strict and robust equivalence between two symbols using the Notation package
I am investigating the use of the Notation package facilities to create strict the equivalence between pretty-printed symbols such as ...
10
votes
1answer
243 views
Creating custom notation
How does one generate custom symbols? For example, the physicist notation for the rotation is "nabla cross function". In this case however, Mathematica complains that the ...
