This is for questions about creating and using custom notations. For help on the use of the built-in operators, see syntax.

learn more… | top users | synonyms

24
votes
1answer
7k views

Can we use letter with a subscript as a variable in Mathematica?

I tried Subscript[a, 0] = 1 (* 1 *) Clear[Subscript[a, 0]] ...
17
votes
5answers
2k 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 ...
28
votes
1answer
679 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
2answers
800 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: ...
21
votes
3answers
847 views

How is + as an infix operator associated with Plus?

How is + associated with Plus? Suppose I want to define a head FooBar and have it ...
13
votes
2answers
312 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 ...
24
votes
2answers
1k 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 ...
3
votes
1answer
179 views

Custom operators; custom pattern matching with pure functions

What I'm trying to achieve in Mathematica is the creation of a binary operator whose operands are both pure functions over the natural numbers. The result of the operator should be another pure ...
7
votes
1answer
238 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 ...
6
votes
1answer
611 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 ...
4
votes
3answers
574 views

Using subscript in a string

I am trying to create a string of the form $0 < d_1 < d_2 < \ldots < d_n$ For a given n. My closest attempt so far is ...
6
votes
1answer
533 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
1answer
1k 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 ...
10
votes
1answer
447 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 ...
4
votes
3answers
195 views

How to re-parse (or re-map) character '.' to user-defined function

The default behavior of the character . between two non-numeric characters is to be interpreted as the infix of the Mathematica function ...
4
votes
3answers
263 views

Notation package: parenthesis placement for SuperscriptBox

The question concerns the Notation package. I want to define notation for the function very similar to the built-in Power[a,b] ...
3
votes
1answer
125 views

Best choice for an infix join operator?

I would love some advice for what symbol to use and best implement it? ...
6
votes
1answer
340 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 ...
5
votes
2answers
152 views

How do I mimic the functionality of “<>”?

The Cell expression for: <> is Cell[BoxData["<>"], "Input"] However similar expressions are parsed into ...
2
votes
0answers
239 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 ...
1
vote
1answer
59 views

How to define a number of infix operators with predefined relative precedences

Reading a number of questions about infix operator notations I want to ask if somebody could reimplement the problem below in a simpler way, say modifying ...
1
vote
2answers
184 views

Notation for implicit derivative

Consider the following line of code: D[x == y^3 + x y, x, NonConstants -> y] The output would be: ...
1
vote
2answers
180 views

Is there a way to “hold” prefix / infix / postfix notation?

Is it possible to preserve a specific style of notation in $Mathematica$ output? foo // bar (* bar[foo] *) Hold[foo // bar] (* bar[foo] *) I'm writing some code ...