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

32
votes
2answers
10k views

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

I tried Subscript[a, 0] = 1 (* 1 *) Clear[Subscript[a, 0]] ...
22
votes
5answers
3k 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 \...
29
votes
1answer
778 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 ...
14
votes
2answers
1k 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
1k 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
340 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 ...
26
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
214 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
259 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
648 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 ...
6
votes
5answers
507 views

Defining indefinitely many functions

Is it possible to define a class of indefinitely many functions f1, f2, f3, ... such that <...
4
votes
3answers
1k 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
631 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?
10
votes
1answer
504 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 ...
7
votes
1answer
233 views

How to construct custom operators with precedence?

I need to combine data structures in operations analogous to addition, subtraction, multiplication and division (and more). I need more than one operation of each type, i.e. more than one method of ...
4
votes
3answers
210 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
300 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
154 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
383 views

How to use Feynman Slash notation?

How can I use Feynman slash notation, e.g., $\require{cancel} \cancel{A}$, in Mathematica? I've seen some answer from 2008 which doesn't seem to work well in Mathematica 10. I'd like this to be part ...
6
votes
1answer
351 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
158 views

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

The Cell expression for: <> is Cell[BoxData["<>"], "Input"] However similar expressions are parsed into RowBox(...
3
votes
0answers
280 views

Best Practice for using Notation, $Pre, MakeExpression in a package [closed]

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
2answers
211 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
1answer
86 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 ...
3
votes
1answer
2k 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 ...
1
vote
2answers
224 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 ...
1
vote
3answers
231 views

Listing elements starting from 0

The first element in a list v in Mathematica is denoted by v[[1]] and subsequent ones are then ...