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

4
votes
1answer
88 views

How to implement Feynman function notation?

I would like trig functions to format with custom DisplayForms as follows: These were created by Richard Feynman in high school. Related: ...
3
votes
1answer
53 views

How is `MakeExpression` processed by Mathematica?

According to the documentation on MakeExpression, MakeExpression[boxes, form] is the low-level function used in Wolfram System sessions to construct expressions ...
29
votes
2answers
10k views
1
vote
3answers
1k 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
275 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 ...
5
votes
3answers
605 views

Can symbols like + or * be used to denote the Plus and Times functions?

Can one do something similar to +[1, 2]? The point is that with one symbol you would be able to write expressions like ...
4
votes
3answers
225 views

One line definition of a symbol with plus-minus

I'm pretty new to Mathematica. I was wondering is there any way to define the symbol $H_\pm(x,y) = f(x) \pm g(y)$ in one line, so that $H_-$ or $H_+$ can be called separately? Something like: ...
1
vote
3answers
226 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 ...
7
votes
1answer
213 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 ...
6
votes
5answers
500 views

Defining indefinitely many functions

Is it possible to define a class of indefinitely many functions f1, f2, f3, ... such that ...
4
votes
5answers
112 views

Special notation using round brackets and avoiding commas (for $\LaTeX$ input)?

Internally, when I work with mathematica I use a notation like br[1,2,3,4] to denote some quantities. Then I would like to export the results in ...
4
votes
1answer
163 views

How can I make angle brackets function like lists?

Is there a way to make <a,b,c> behave like {a,b,c}, but remain displayed as ...
2
votes
1answer
50 views

Changing the grouping of an user defined infix operator

How can I change the default grouping on an operator without a built-in meaning? I've created my own infix operator by defining LeftArrow. ...
6
votes
1answer
337 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 ...
14
votes
2answers
965 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: ...
1
vote
1answer
81 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 ...
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 ...
8
votes
3answers
343 views

Redefining a built-in operator

Is there a way I can redefine the || operator such that a||b will be 1/(1/a + 1/b)? Is it ...
5
votes
3answers
249 views

How to imitate list comprehensions for constant arrays?

In Python, ['a'] * 10 generates ['a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'] and ...
0
votes
1answer
68 views

Using subscripted symbols in functions

Using subscripts would significantly improve the structure of my code. Until now I used the following two lines to implement this. ...
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 ...
0
votes
1answer
45 views

Parse notation recursively

For a special notation I would like to get the help of Mathematica to expand complex expressions through a set of Notation rules. However since this tasks involves applying the notation recursively ...
0
votes
0answers
91 views

Can I redefine the ++ increment operator to make it behave like Haskell

In Haskell, joining two lists l1 and l2 is simply done with l1 ++ l2 In Mathematica ...
2
votes
0answers
126 views

Symbol with left and right subscript and right superscript

I am trying to come up with a variable that has a left and right subscript and right superscript. I have tried the following ...
0
votes
1answer
80 views

Define action of noncommutative product of operators

I have objects wrapped with head fv. So they are things like fv[{1, 2}, {3, 4}, {5, 6}] I then defined two operators, a and ...
6
votes
1answer
298 views

Dot in place of prime to denote differentiation

To denote differentiation with respect to time I wish to use overhead dots rather than primes, so that differential expressions will look somewhat like this: $\quad \quad$ ...
28
votes
1answer
760 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 ...
3
votes
1answer
147 views

Best choice for an infix join operator?

I would love some advice for what symbol to use and best implement it? ...
1
vote
2answers
80 views

Series with specific notation

I'm trying to get mathematicas series function to output a result that look like this: instead of calculating the actual "values", like doing so here: ...
4
votes
3answers
207 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
283 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] ...
13
votes
4answers
3k views

How to implement Donald Knuth's up-arrow notation

How does one enter very large numbers in up-arrow notation? Up-arrow notation was created by Donald Knuth to write very large numbers in it iterated exponentiation form, for example 6↑↑3 = 6^6^6.
3
votes
1answer
206 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 ...
1
vote
2answers
344 views

Kronecker delta notation

Is there an easier way to enter KroneckerDelta[n,m] in Mathematica? When I use the notation $ \delta_{n,m} $, it won't work.
2
votes
1answer
155 views

Defining conditional Notation rules

I am trying to define a notation rule so that for selected symbols subsripts will be equivalent to function parameters. My understanding of the docs suggests the following ...
0
votes
1answer
161 views

Correct way to use Notation

I have tried to create some Notation declarations as follows ...
3
votes
0answers
75 views

Notation, Format and Interpretation

I am unclear on the exact relationship between Notation, Format and Interpretation. ...
1
vote
2answers
221 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
0answers
38 views

custom precedence for custom infix operator with InfixNotation [duplicate]

I am trying to define several custom operators with custom precedence to implement geometric algebra. Loading the notation package << Notation` I can ...
2
votes
3answers
108 views

Assigning symbolic operators to built-in functions

Can I do something like this: $$\partial_t = D[f, t]$$ i.e. create a symbol instead of a function so that each time I call it, it executes the operation as defined?
0
votes
1answer
205 views

New integration symbol

Is there a way to introduce a new integration symbol? Specifically I want to be able to use ⨍. I have no problem entering it into mm, but the size does not change like the standard \int does.
0
votes
2answers
382 views

using index notation for finite differences

I am interested in deriving finite difference equations, which means I have to play around with indexed quantities. For example, for a 2D function f(x,y), I could discretize it on a grid with grid ...
11
votes
1answer
242 views

Why is `D[a[b][c],a[b]]` equal to `1[c]`?

Background: I had the same issue as described here, and I went to extend Mr.Wizard’s code such that a[b][c] would be shown as $a_b^c$. Issue: To my surprise, ...
1
vote
2answers
206 views

Notation for implicit derivative

Consider the following line of code: D[x == y^3 + x y, x, NonConstants -> y] The output would be: ...
6
votes
1answer
207 views

Custom display format for custom operator

I've tried searching here and in the WRI documentation, but I haven't found what I'm looking for in either place. I'm defining a dx operator to act as a ...
3
votes
0answers
57 views

Can I define a “postfix map” operator with comparable precedence behavior to // [duplicate]

I am trying to define a "postfix map" operator (denoted $OP$ for now) that behaves thus: ...
4
votes
3answers
915 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
602 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?
1
vote
1answer
238 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: ...
2
votes
1answer
108 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 ...