In Macaulay2, each polynomial ring (and also each monoid) is equipped with a monomial order, which is used for display of polynomials (terms are listed in descending monomial order), and also for GrÃ¶bner basis computations.

In the most general setting, a monomial ordering is given by a list of *ordering tests*, of various types listed and described below, each of which provides a partial ordering on the monomials. The ordering tests are applied sequentially, starting with the first one, until one monomial is judged greater than the other. At the end, if necessary, the graded reverse lexicographic order is used to compare the monomials. For examples, see below, or see monomial orderings.

Permissible elements:

- GRevLex => n -- A graded reverse lexicographic block of variables
- Lex => n
- Weights => {...}
- Position => Up or Position => Down
- RevLex => n
- GroupLex => n
- GroupRevLex => n
- MonomialSize => n, n being 8,16,32, or 64. Set the packing size for exponents for further variables

Some examples of monomial orders. Note that if only one item is in the list, we can dispense with the list.

`MonomialOrder => {GRevLex=>2, GRevLex=>3}`-- a product order`MonomialOrder => {2, 3}`-- same`MonomialOrder => {Weights=>{1,13,6,2}}`-- a weight order`MonomialOrder => Weights=>{1,13,6,2}`-- same

i1 : QQ[x,y, Weights => {-1,1}, Global => false] o1 = QQ[x, y] o1 : PolynomialRing |

i2 : x<1 o2 = true |

i3 : y<1 o3 = false |

- graphIdeal(..., MonomialOrder => ...), see graphIdeal(RingMap) -- the ideal of the graph of the regular map corresponding to a ring map
- graphRing(..., MonomialOrder => ...), see graphRing(RingMap) -- the coordinate ring of the graph of the regular map corresponding to a ring map
- monoid(..., MonomialOrder => ...), see monoid -- make or retrieve a monoid
- newRing(..., MonomialOrder => ...), see newRing -- make a copy of a ring, with some features changed
- pushForward(..., MonomialOrder => ...), see pushForward(RingMap,Module)
- rsort(..., MonomialOrder => ...) -- specify Ascending or Descending monomial order
- sort(..., MonomialOrder => ...) -- specify Ascending or Descending monomial order
- sortColumns(..., MonomialOrder => ...) -- specify Ascending or Descending monomial order
- symmetricAlgebra(..., MonomialOrder => ...), see symmetricAlgebra -- the symmetric algebra of a module
- tensor(..., MonomialOrder => ...), see tensor(Ring,Ring) -- tensor product

- monomial orderings
- weightGrevlex -- transform a weight matrix into a monomial ordering matrix
- grevlexWeight -- transform a weight matrix into a monomial ordering matrix

The object MonomialOrder is a symbol.