# HG changeset patch
# User Minh Van Nguyen <nguyenminh2@gmail.com>
# Date 1268464763 28800
# Node ID cd6b812b75d794450841be80676c3a6e4cefd512
# Parent  c60ebd37af0e5ae3b4316ea7f95a0a14f2ce80d3
#8442: Lie Methods and Related Combinatorics: reviewer patch

diff --git a/doc/en/thematic_tutorials/bibliography.rst b/doc/en/thematic_tutorials/bibliography.rst
--- a/doc/en/thematic_tutorials/bibliography.rst
+++ b/doc/en/thematic_tutorials/bibliography.rst
@@ -2,14 +2,94 @@
 Bibliography
 ============
 
+.. [BumpNakasuji2010] D. Bump and M. Nakasuji. Casselman's basis of
+   Iwahori vectors and the Bruhat order. arXiv:1002.2996,
+   http://arxiv.org/abs/1002.2996.
+
+.. [Carrell1994] J. B. Carrell. The Bruhat graph of a Coxeter group, a
+   conjecture of Deodhar, and rational smoothness of Schubert varieties. In
+   *Algebraic Groups and Their Generalizations: Classical Methods*,
+   AMS Proceedings of Symposia in Pure Mathematics, 56, 53--61, 1994.
+
+.. [Casselman1980] W. Casselman. The unramified principal series of
+   `\mathfrak{p}`-adic groups I: The spherical function. *Compositio
+   Mathematica*, 40(3):387--406, 1980.
+
 .. [CormenEtAl2001] T. H. Cormen, C. E. Leiserson, R. L. Rivest, and
    C. Stein. *Introduction to Algorithms*. The MIT Press, USA, 2nd
    edition, 2001.
 
+.. [Deodhar1977] V. V. Deodhar. Some characterizations of Bruhat
+   ordering on a Coxeter group and determination of the relative
+   Moebius function. Inventiones Mathematicae, 39(2):187--198, 1977.
+
+.. [Dyer1993] M. J. Dyer. The nil Hecke ring and Deodhar's conjecture
+   on Bruhat intervals. Inventiones Mathematicae, 111(1):571--574, 1993.
+
+.. [FauserEtAl2006] B. Fauser, P. D. Jarvis, R. C. King, and
+   B. G. Wybourne. New branching rules induced by plethysm. *Journal of
+   Physics A*. 39(11):2611--2655, 2006.
+
+.. [Fulton1997] W. Fulton. *Young Tableaux*. Cambridge University
+   Press, 1997.
+
+.. [HainesEtAl2009] T. J. Haines, R. E. Kottwitz, and
+   A. Parsad. Iwahori-Hecke Algebras. arXiv:math/0309168,
+   http://arxiv.org/abs/math/0309168.
+
+.. [HongKang2002] J. Hong and S.-J. Kang. *Introduction to Quantum
+   Groups and Crystal Bases*. AMS Graduate Studies in Mathematics,
+   American Mathematical Society, 2002.
+
+.. [HoweEtAl2005] R. Howe, E.-C.Tan, and J. F. Willenbring. Stable
+   branching rules for classical symmetric pairs. *Transactions of the
+   American Mathematical Society*, 357(4):1601--1626, 2005.
+
+.. [Iwahori1964] N. Iwahori. On the structure of a Hecke ring of a
+   Chevalley group over a finite field. *J. Fac. Sci. Univ. Tokyo
+   Sect. I*, 10:215--236, 1964.
+
+.. [Jimbo1986] M. A. Jimbo. `q`-analogue of `U(\mathfrak{gl}(N+1))`,
+   Hecke algebra, and the Yang-Baxter equation. *Lett. Math. Phys*,
+   11(3):247--252, 1986.
+
+.. [Kashiwara1995] M. Kashiwara. On crystal bases. Representations of
+   groups (Banff, AB, 1994), 155--197, CMS Conference Proceedings, 16,
+   American Mathematical Society, Providence, RI, 1995.
+
+.. [KashiwaraNakashima1994] M. Kashiwara and T. Nakashima. Crystal
+   graphs for representations of the `q`-analogue of classical Lie
+   algebras. *Journal Algebra*, 165(2):295--345, 1994.
+
+.. [King1975] R. C. King. Branching rules for classical Lie groups
+   using tensor and spinor methods. *Journal of Physics A*,
+   8:429--449, 1975.
+
+.. [Knuth1970] D. Knuth. Permutations, matrices, and generalized Young
+   tableaux. *Pacific Journal of Mathematics*, 34(3):709--727, 1970.
+
+.. [Knuth1998] D. Knuth. *The Art of Computer
+   Programming. Volume 3. Sorting and Searching*. Addison Wesley
+   Longman, 1998.
+
+.. [McKayPatera1981] W. G. McKay and J. Patera. *Tables of Dimensions,
+   Indices and Branching Rules for Representations of Simple Lie
+   Algebras*. Marcel Dekker, 1981.
+
 .. [MenezesEtAl1996] A. J. Menezes, P. C. van Oorschot, and
    S. A. Vanstone. *Handbook of Applied Cryptography*. CRC Press, Boca
    Raton, FL, USA, 1996.
 
+.. [Reeder1992] M. Reeder. On certain Iwahori invariants in the
+   unramified principal series. *Pacific Journal of Mathematics*,
+   153(2):313--342, 1992.
+
+.. [Rogawski1985] J. Rogawski, On modules over the Hecke algebra of a
+   `p`-adic group. *Inventiones Mathematicae*, 79(3):443--465, 1985.
+
+.. [Stanley1999] R. P. Stanley. *Enumerative Combinatorics, Volume
+   2*. Cambridge University Press, 1999.
+
 .. [Stinson2006] D. R. Stinson. *Cryptography: Theory and Practice*.
    Chapman & Hall/CRC, Boca Raton, USA, 3rd edition, 2006.
 
diff --git a/doc/en/thematic_tutorials/lie/branching_rules.rst b/doc/en/thematic_tutorials/lie/branching_rules.rst
--- a/doc/en/thematic_tutorials/lie/branching_rules.rst
+++ b/doc/en/thematic_tutorials/lie/branching_rules.rst
@@ -1,185 +1,187 @@
---------------------------------------
+-------------------------------------
 Maximal Subgroups and Branching Rules
---------------------------------------
+-------------------------------------
 
-Branching Rules
------------------
 
-If :math:`G` is a Lie group and :math:`H` is a subgroup, one often needs to
-know how representations of :math:`G` restrict to :math:`H`. Irreducibles
-usually do not restrict to irreducibles. In some cases the restriction is
-regular and predictable, in other cases it is chaotic. The description of how
+Branching rules
+---------------
+
+If `G` is a Lie group and `H` is a subgroup, one often needs to know
+how representations of `G` restrict to `H`. Irreducibles usually do
+not restrict to irreducibles. In some cases the restriction is regular
+and predictable, in other cases it is chaotic. The description of how
 irreducibles decompose into irreducibles is called a *branching rule*.
 
 References for this topic:
 
-- King, Branching rules for classical Lie groups using tensor and spinor methods. J. Phys. A 8 (1975), 429-449
+- [FauserEtAl2006]_
 
-- Howe, Tan and Willenbring, Stable branching rules for classical symmetric pairs,  Trans. Amer. Math. Soc. 357 (2005), no. 4, 1601-1626
+- [King1975]_
 
-- McKay and Patera, Tables of Dimensions, Indices and Branching Rules for Representations of Simple Lie Algebras (Marcel Dekker, 1981)
+- [HoweEtAl2005]_
 
-- Fauser, Jarvis, King and Wybourne, New branching rules induced by plethysm. J. Phys. A 39 (2006), no. 11, 2611--2655.
+- [McKayPatera1981]_
 
-Sage has enough built in branching rules to handle all cases where :math:`G`
-is a classical group, that is, type A, B, C or D. It also has many built in
-cases where :math:`G` is an exceptional group.
+Sage has enough built-in branching rules to handle all cases where `G`
+is a classical group, that is, type A, B, C or D. It also has many
+built-in cases where `G` is an exceptional group.
 
-Clearly it is sufficient to consider the case where :math:`H` is a maximal
-subgroup of :math:`G`, since if this is known then one may branch down
+Clearly it is sufficient to consider the case where `H` is a maximal
+subgroup of `G`, since if this is known then one may branch down
 successively through a series of subgroups, each maximal in its
-predecessors. A problem is therefore to understand the maximal subgroups in a
-Lie group, and to give branching rules for each.
+predecessors. A problem is therefore to understand the maximal
+subgroups in a Lie group, and to give branching rules for each.
 
-For convenience Sage includes some branching rules to non-maximal subgroups,
-but strictly speaking these are not necessary. The goal is to give a sufficient
-set of built-in branching rules for all maximal subgroups, and this is
-accomplished for classical groups (types A, B, C or D) at least up to rank 8,
-and for many maximal subgroups of exceptional groups.
+For convenience Sage includes some branching rules to non-maximal
+subgroups, but strictly speaking these are not necessary. The goal is
+to give a sufficient set of built-in branching rules for all maximal
+subgroups, and this is accomplished for classical groups (types A, B,
+C or D) at least up to rank 8, and for many maximal subgroups of
+exceptional groups.
 
-Levi Subgroups
------------------
 
-A Levi subgroup may or may not be maximal. They are easily classified. If one
-starts with a Dynkin diagram for :math:`G` and removes a single node, one
-obtains a smaller Dynkin diagram, which is the Dynkin diagram of a smaller
-subgroup :math:`H`.
+Levi subgroups
+--------------
+
+A Levi subgroup may or may not be maximal. They are easily
+classified. If one starts with a Dynkin diagram for `G` and removes a
+single node, one obtains a smaller Dynkin diagram, which is the Dynkin
+diagram of a smaller subgroup `H`.
 
 For example, here is the A3 Dynkin diagram::
 
-    sage: A3=WeylCharacterRing("A3")
+    sage: A3 = WeylCharacterRing("A3")
     sage: A3.dynkin_diagram()
     O---O---O
     1   2   3
     A3
 
-We see that we may remove the node 3 and obtain A2,
-or the node 2 and obtain A1xA1. These correspond to the
-Levi subgroups :math:`GL(3)` and :math:`GL(2)\times GL(2)` of
-:math:`GL(4)`. Let us construct the irreducible representations
-of :math:`GL(4)` and branch them down to these down to
-:math:`GL(3)` and :math:`GL(2)\times GL(2)`::
+We see that we may remove the node 3 and obtain A2, or the node 2 and
+obtain A1xA1. These correspond to the Levi subgroups `GL(3)` and
+`GL(2) \times GL(2)` of `GL(4)`. Let us construct the irreducible
+representations of `GL(4)` and branch them down to these down to
+`GL(3)` and `GL(2) \times GL(2)`::
 
-    sage: A3=WeylCharacterRing("A3")
+    sage: A3 = WeylCharacterRing("A3")
     sage: reps = [A3(v) for v in A3.fundamental_weights()]; reps
     [A3(1,0,0,0), A3(1,1,0,0), A3(1,1,1,0)]
-    sage: A2=WeylCharacterRing("A2")
-    sage: A1xA1=WeylCharacterRing("A1xA1")
-    sage: [pi.branch(A2,rule="levi") for pi in reps]
+    sage: A2 = WeylCharacterRing("A2")
+    sage: A1xA1 = WeylCharacterRing("A1xA1")
+    sage: [pi.branch(A2, rule="levi") for pi in reps]
     [A2(0,0,0) + A2(1,0,0), A2(1,0,0) + A2(1,1,0), A2(1,1,0) + A2(1,1,1)]
-    sage: [pi.branch(A1xA1,rule="levi") for pi in reps]
+    sage: [pi.branch(A1xA1, rule="levi") for pi in reps]
     [A1xA1(0,0,1,0) + A1xA1(1,0,0,0),
      A1xA1(0,0,1,1) + A1xA1(1,0,1,0) + A1xA1(1,1,0,0),
      A1xA1(1,0,1,1) + A1xA1(1,1,1,0)]
 
-Let us redo this calculation in coroot notation. As we have
-explained, coroot notation does not distinguish between representations
-of :math:`GL(4)` that have the same restriction to :math:`SL(4)`, so in
-effect we are now working with the groups :math:`SL(4)` and its
-Levi subgroups :math:`SL(3)` and :math:`SL(2)\times SL(2)`::
+Let us redo this calculation in coroot notation. As we have explained,
+coroot notation does not distinguish between representations of
+`GL(4)` that have the same restriction to `SL(4)`, so in effect we are
+now working with the groups `SL(4)` and its Levi subgroups `SL(3)` and
+`SL(2) \times SL(2)`::
 
-    sage: A3=WeylCharacterRing("A3",style="coroots")
+    sage: A3 = WeylCharacterRing("A3", style="coroots")
     sage: reps = [A3(v) for v in A3.fundamental_weights()]; reps
     [A3(1,0,0), A3(0,1,0), A3(0,0,1)]
-    sage: A2=WeylCharacterRing("A2",style="coroots")
-    sage: A1xA1=WeylCharacterRing("A1xA1",style="coroots")
-    sage: [pi.branch(A2,rule="levi") for pi in reps]
+    sage: A2 = WeylCharacterRing("A2", style="coroots")
+    sage: A1xA1 = WeylCharacterRing("A1xA1", style="coroots")
+    sage: [pi.branch(A2, rule="levi") for pi in reps]
     [A2(0,0) + A2(1,0), A2(0,1) + A2(1,0), A2(0,0) + A2(0,1)]
-    sage: [pi.branch(A1xA1,rule="levi") for pi in reps]
+    sage: [pi.branch(A1xA1, rule="levi") for pi in reps]
     [A1xA1(0,1) + A1xA1(1,0), 2*A1xA1(0,0) + A1xA1(1,1), A1xA1(0,1) + A1xA1(1,0)]
 
 Now we may observe a distinction difference in branching from
-:math:`GL(4)\to GL(2)\times GL(2)` and with :math:`SL(4)\to SL(2)\times
-SL(2)`. Consider the middle representation, which is the six
-dimensional exterior square. In the coroot notation, the
-restriction contained two copies of the trivial
-representation, ``2*A1xA1(0,0)``. The other way, we had instead
-three distinct representations in the restriction, namely
-``A1xA1(1,1,0,0)`` and ``A1xA1(0,0,1,1)``, that is, :math:`\det\otimes 1`
-and :math:`1\otimes\det`.
+`GL(4) \to GL(2) \times GL(2)` and with
+`SL(4) \to SL(2) \times SL(2)`. Consider the middle representation,
+which is the six dimensional exterior square. In the coroot notation,
+the restriction contained two copies of the trivial representation,
+``2*A1xA1(0,0)``. The other way, we had instead three distinct
+representations in the restriction, namely ``A1xA1(1,1,0,0)`` and
+``A1xA1(0,0,1,1)``, that is, `\det \otimes 1` and `1 \otimes \det`.
 
-The Levi subgroup ``A1xA1`` is actually not maximal. Indeed,
-we may factor the embedding:
+The Levi subgroup ``A1xA1`` is actually not maximal. Indeed, we may
+factor the embedding:
 
-:math:`SL(2)\times SL(2)\to Sp(4)\to SL(4).`
+.. MATH::
 
-Therfore there are branching rules ``A3 -> C2`` and
-``C2 -> A2``, and we could accomplish the branching
-in two steps, thus::
+    SL(2) \times SL(2) \to Sp(4) \to SL(4).
 
-    sage: A3 = WeylCharacterRing("A3",style="coroots")
-    sage: C2 = WeylCharacterRing("C2",style="coroots")
-    sage: B2 = WeylCharacterRing("B2",style="coroots")
-    sage: D2 = WeylCharacterRing("D2",style="coroots")
-    sage: A1xA1=WeylCharacterRing("A1xA1",style="coroots")
+Therfore there are branching rules ``A3 -> C2`` and ``C2 -> A2``, and
+we could accomplish the branching in two steps, thus::
+
+    sage: A3 = WeylCharacterRing("A3", style="coroots")
+    sage: C2 = WeylCharacterRing("C2", style="coroots")
+    sage: B2 = WeylCharacterRing("B2", style="coroots")
+    sage: D2 = WeylCharacterRing("D2", style="coroots")
+    sage: A1xA1 = WeylCharacterRing("A1xA1", style="coroots")
     sage: reps = [A3(fw) for fw in A3.fundamental_weights()]
-    sage: [pi.branch(C2,rule="symmetric").branch(B2,rule="isomorphic").\
-    ....:     branch(D2,rule="extended").branch(A1xA1,rule="isomorphic") for pi in reps]
+    sage: [pi.branch(C2, rule="symmetric").branch(B2, rule="isomorphic").\
+    ....:     branch(D2, rule="extended").branch(A1xA1, rule="isomorphic") for pi in reps]
     [A1xA1(0,1) + A1xA1(1,0), 2*A1xA1(0,0) + A1xA1(1,1), A1xA1(0,1) + A1xA1(1,0)]
 
-As you can see, we've redone the branching rather circuitously
-this way, making use of the branching rules ``A3->C2`` and ``B2->D2``,
-and two accidental isomorphisms ``C2=B2`` and ``D2=A1xA1``. It is
-much easier to go in one step using ``rule="levi"``, but
-reassuring that we get the same answer!
+As you can see, we've redone the branching rather circuitously this
+way, making use of the branching rules ``A3->C2`` and ``B2->D2``, and
+two accidental isomorphisms ``C2=B2`` and ``D2=A1xA1``. It is much
+easier to go in one step using ``rule="levi"``, but reassuring that we
+get the same answer!
 
-Subgroups Classified by the Extended Dynkin Diagram
+
+Subgroups classified by the extended Dynkin diagram
 ---------------------------------------------------
 
-It is also true that if we remove one node from the extended
-Dynkin diagram that we obtain the Dynkin diagram of a subgroup.
-For example::
+It is also true that if we remove one node from the extended Dynkin
+diagram that we obtain the Dynkin diagram of a subgroup. For example::
 
-    sage: G2=WeylCharacterRing("G2",style="coroots")
+    sage: G2 = WeylCharacterRing("G2", style="coroots")
     sage: G2.extended_dynkin_diagram()
       3
     O=<=O---O
     1   2   0
     G2~
 
-Observe that by removing the 1 node that we obtain an A2
-Dynkin diagram. Therefore the exceptional group G2 contains
-a copy of :math:`SL(3)`. We branch the two representations of G2
-corresponding to the fundamental weights to this copy of A2::
+Observe that by removing the 1 node that we obtain an A2 Dynkin
+diagram. Therefore the exceptional group G2 contains a copy of
+`SL(3)`. We branch the two representations of G2 corresponding to the
+fundamental weights to this copy of A2::
 
-    sage: G2=WeylCharacterRing("G2",style="coroots")
-    sage: A2=WeylCharacterRing("A2",style="coroots")
+    sage: G2 = WeylCharacterRing("G2", style="coroots")
+    sage: A2 = WeylCharacterRing("A2", style="coroots")
     sage: [G2(f).degree() for f in G2.fundamental_weights()]
     [7, 14]
-    sage: [G2(f).branch(A2,rule="extended") for f in G2.fundamental_weights()]
+    sage: [G2(f).branch(A2, rule="extended") for f in G2.fundamental_weights()]
     [A2(0,0) + A2(0,1) + A2(1,0), A2(0,1) + A2(1,0) + A2(1,1)]
 
-The two representations of G2, of degrees 7 and 14 respectively
-are the action on the octonions of trace zero and the adjoint
+The two representations of G2, of degrees 7 and 14 respectively, are
+the action on the octonions of trace zero and the adjoint
 representation.
 
-For embeddings of this type, the rank of the subgroup :math:`H` is
-the same as the rank of :math:`G`. This is in contrast with
-embeddings of Levi type, where :math:`H` has rank one less than :math:`G`.
+For embeddings of this type, the rank of the subgroup `H` is the same
+as the rank of `G`. This is in contrast with embeddings of Levi type,
+where `H` has rank one less than `G`.
 
 
 Orthogonal and symplectic subgroups of orthogonal and symplectic groups
 -----------------------------------------------------------------------
 
-If :math:`G=SO(r+s)` then :math:`G` has a subgroup
-:math:`SO(r)\times SO(s)`. This lifts to an embedding
-of the universal covering groups
+If `G = SO(r+s)` then `G` has a subgroup `SO(r) \times SO(s)`. This
+lifts to an embedding of the universal covering groups
 
-:math:`\hbox{spin}(r)\times \hbox{spin}(s)\to \hbox{spin}(r+s)`
+.. MATH::
 
-Sometimes this embedding is of extended type, and sometimes
-it is not. It is of extended type unless :math:`r` and :math:`s` are both
-odd. If it is of extended type then you may use
-``rule="extended"``. In any case you may use ``rule="orthogonal_sum"``.
-The name refer to the origin of the embedding :math:`SO(r)\times SO(s)\to SO(r+s)`
-from the decomposition of the underlying quadratic space
-as a direct sum of two orthogonal subspaces.
+    \hbox{spin}(r) \times \hbox{spin}(s) \to \hbox{spin}(r+s).
 
-There are four cases depending on the parity of :math:`r` and
-:math:`s`. For example, if :math:`r=2k` and :math:`s=2l` we
-have an embedding :
+Sometimes this embedding is of extended type, and sometimes it is
+not. It is of extended type unless `r` and `s` are both odd. If it is
+of extended type then you may use ``rule="extended"``. In any case you
+may use ``rule="orthogonal_sum"``. The name refer to the origin of the
+embedding `SO(r) \times SO(s) \to SO(r+s)` from the decomposition of
+the underlying quadratic space as a direct sum of two orthogonal
+subspaces.
 
-``['D',k] x ['D',l] --> ['D',k+l]``
+There are four cases depending on the parity of `r` and `s`. For
+example, if `r = 2k` and `s = 2l` we have an embedding::
+
+    ['D',k] x ['D',l] --> ['D',k+l]
 
 This is of extended type. Thus consider the embedding
 ``D4xD3 -> D7``. Here is the extended Dynkin diagram::
@@ -200,20 +202,19 @@
 
 This is ``D4xD3``.  Therefore use the "extended" branching rule::
 
-    sage: D7=WeylCharacterRing("D7",style="coroots")
-    sage: D4xD3=WeylCharacterRing("D4xD3",style="coroots")
+    sage: D7 = WeylCharacterRing("D7", style="coroots")
+    sage: D4xD3 = WeylCharacterRing("D4xD3", style="coroots")
     sage: spin = D7(D7.fundamental_weights()[7]); spin
     D7(0,0,0,0,0,0,1)
-    sage: spin.branch(D4xD3,rule="extended")
+    sage: spin.branch(D4xD3, rule="extended")
     D4xD3(0,0,1,0,0,1,0) + D4xD3(0,0,0,1,0,0,1)
 
-Similarly we have embeddings
+Similarly we have embeddings::
 
-``['D',k] x ['B',l] --> ['B',k+l].``
+    ['D',k] x ['B',l] --> ['B',k+l]
 
-These are also of extended type. For example consider the
-embedding of ``D3xB2->B5``. Here is the ``B5`` extended
-Dynkin diagram::
+These are also of extended type. For example consider the embedding of
+``D3xB2->B5``. Here is the ``B5`` extended Dynkin diagram::
 
         O 0
         |
@@ -221,7 +222,6 @@
     O---O---O---O=>=O
     1   2   3   4   5
 
-
 Removing the 3 node gives::
 
         O 0
@@ -229,157 +229,160 @@
     O---O       O=>=O
     1   2       4   5
 
-and this is the Dynkin diagram or ``D3xB2``. For such branchings
-we again use ``rule="extended"``.
+and this is the Dynkin diagram or ``D3xB2``. For such branchings we
+again use ``rule="extended"``.
 
-Finally, there is an embedding
+Finally, there is an embedding ::
 
-``['B',k] x ['B',l] --> ['D',k+l+1]``
+    ['B',k] x ['B',l] --> ['D',k+l+1]
 
 This is *not* of extended type, so you may not use ``rule="extended"``.
 
 
-Symmetric Subgroups
+Symmetric subgroups
 -------------------
 
-If :math:`G` admits an outer automorphism (usually of order two) then
-we may try to find the branching rule to the fixed subgroup :math:`H`.
-It can be arranged that this automorphism maps the maximal torus
-:math:`T` to itself and that a maximal torus :math:`U` of :math:`H` is contained
-in :math:`T`.
+If `G` admits an outer automorphism (usually of order two) then we may
+try to find the branching rule to the fixed subgroup `H`. It can be
+arranged that this automorphism maps the maximal torus `T` to itself
+and that a maximal torus `U` of `H` is contained in `T`.
 
-Suppose that the Dynkin diagram of :math:`G` admits an automorphism. Then
-:math:`G` itself admits an outer automorphism. The Dynkin diagram of the
-group :math:`H` of invariants may be obtained by "folding" the Dynkin
-diagram of :math:`G` along the automorphism. The exception is the
-branching rule :math:`GL(2r)\implies SO(2r)`.
+Suppose that the Dynkin diagram of `G` admits an automorphism. Then
+`G` itself admits an outer automorphism. The Dynkin diagram of the
+group `H` of invariants may be obtained by "folding" the Dynkin
+diagram of `G` along the automorphism. The exception is the branching
+rule `GL(2r) \implies SO(2r)`.
 
-Here are the branching rules that can be obtained using ``rule="symmetric"``.
+Here are the branching rules that can be obtained using
+``rule="symmetric"``.
 
-+------------------+-------------------+-----------------------+
-| :math:`G`        | :math:`H`         | Cartan Types          |
-+==================+===================+=======================+
-| :math:`GL(2r)`   | :math:`Sp(2r)`    | ['A',2r-1] => ['C',r] |
-+------------------+-------------------+-----------------------+
-| :math:`GL(2r+1)` | :math:`SO(2r+1)`  | ['A',2r] => ['B',r]   |
-+------------------+-------------------+-----------------------+
-| :math:`GL(2r)`   | :math:`SO(2r)`    | ['A',2r-1] => ['D',r] |
-+------------------+-------------------+-----------------------+
-| :math:`SO(2r)`   | :math:`SO(2r-1)`  | ['D',r] => ['B',r-1]  |
-+------------------+-------------------+-----------------------+
-| :math:`E_6`      | :math:`F_4`       | ['E',6] => ['F',4]    |
-+------------------+-------------------+-----------------------+
++------------+-------------+---------------------------+
+| `G`        | `H`         | Cartan Types              |
++============+=============+===========================+
+| `GL(2r)`   | `Sp(2r)`    | ``['A',2r-1] => ['C',r]`` |
++------------+-------------+---------------------------+
+| `GL(2r+1)` | `SO(2r+1)`  | ``['A',2r] => ['B',r]``   |
++------------+-------------+---------------------------+
+| `GL(2r)`   | `SO(2r)`    | ``['A',2r-1] => ['D',r]`` |
++------------+-------------+---------------------------+
+| `SO(2r)`   | `SO(2r-1)`  | ``['D',r] => ['B',r-1]``  |
++------------+-------------+---------------------------+
+| `E_6`      | `F_4`       | ``['E',6] => ['F',4]``    |
++------------+-------------+---------------------------+
 
-Tensor Products
+
+Tensor products
 ---------------
 
-If :math:`G_1` and :math:`G_2` are Lie groups, and we have representations
-:math:`\pi_1:G_1\to GL(n)` and :math:`\pi_2:G_2\to GL(m)` then the tensor
-product is a representation of :math:`G_1\times G_2`. It has its image
-in :math:`GL(nm)` but sometimes this is conjugate to a subgroup of
-:math:`SO(nm)` or :math:`Sp(nm)`. In particular we have the following cases.
+If `G_1` and `G_2` are Lie groups, and we have representations
+`\pi_1: G_1 \to GL(n)` and `\pi_2: G_2 \to GL(m)` then the tensor
+product is a representation of `G_1 \times G_2`. It has its image
+in `GL(nm)` but sometimes this is conjugate to a subgroup of `SO(nm)`
+or `Sp(nm)`. In particular we have the following cases.
 
-+-------------------------+---------------------------------+------------------------------------------+
-| Group                   | Subgroup                        | Cartan Types                             |
-+=========================+=================================+==========================================+
-| :math:`GL(rs)`          | :math:`GL(r)\times GL(s)`       | ``['A', rs-1] => ['A',r-1] x ['A',s-1]`` |
-+-------------------------+---------------------------------+------------------------------------------+
-| :math:`SO(4rs+2r+2s+1)` | :math:`SO(2r+1)\times SO(2s+1)` | ``['B',2rs+r+s] => ['B',r] x ['B',s]``   |
-+-------------------------+---------------------------------+------------------------------------------+
-| :math:`SO(4rs+2s)`      | :math:`SO(2r+1)\times SO(2s)`   | ``['D',2rs+s] => ['B',r] x ['D',s]``     |
-+-------------------------+---------------------------------+------------------------------------------+
-| :math:`SO(4rs)`         | :math:`SO(2r)\times SO(2s)`     | ``['D',2rs] => ['D',r] x ['D',s]``       |
-+-------------------------+---------------------------------+------------------------------------------+
-| :math:`SO(4rs)`         | :math:`Sp(2r)\times Sp(2s)`     | ``['D',2rs] => ['C',r] x ['C',s]``       |
-+-------------------------+---------------------------------+------------------------------------------+
-| :math:`Sp(4rs+2s)`      | :math:`SO(2r+1)\times Sp(2s)`   | ``['C',2rs+s] => ['B',r] x ['C',s]``     |
-+-------------------------+---------------------------------+------------------------------------------+
-| :math:`Sp(4rs)`         | :math:`Sp(2r)\times SO(2s)`     | ``['C',2rs] => ['C',r] x ['D',s]``       |
-+-------------------------+---------------------------------+------------------------------------------+
++-------------------+---------------------------+------------------------------------------+
+| Group             | Subgroup                  | Cartan Types                             |
++===================+===========================+==========================================+
+| `GL(rs)`          | `GL(r)\times GL(s)`       | ``['A', rs-1] => ['A',r-1] x ['A',s-1]`` |
++-------------------+---------------------------+------------------------------------------+
+| `SO(4rs+2r+2s+1)` | `SO(2r+1)\times SO(2s+1)` | ``['B',2rs+r+s] => ['B',r] x ['B',s]``   |
++-------------------+---------------------------+------------------------------------------+
+| `SO(4rs+2s)`      | `SO(2r+1)\times SO(2s)`   | ``['D',2rs+s] => ['B',r] x ['D',s]``     |
++-------------------+---------------------------+------------------------------------------+
+| `SO(4rs)`         | `SO(2r)\times SO(2s)`     | ``['D',2rs] => ['D',r] x ['D',s]``       |
++-------------------+---------------------------+------------------------------------------+
+| `SO(4rs)`         | `Sp(2r)\times Sp(2s)`     | ``['D',2rs] => ['C',r] x ['C',s]``       |
++-------------------+---------------------------+------------------------------------------+
+| `Sp(4rs+2s)`      | `SO(2r+1)\times Sp(2s)`   | ``['C',2rs+s] => ['B',r] x ['C',s]``     |
++-------------------+---------------------------+------------------------------------------+
+| `Sp(4rs)`         | `Sp(2r)\times SO(2s)`     | ``['C',2rs] => ['C',r] x ['D',s]``       |
++-------------------+---------------------------+------------------------------------------+
 
 These branching rules are obtained using ``rule="tensor"``.
 
-Symmetric Powers
+
+Symmetric powers
 ----------------
 
-The k-th symmetric and exterior power homomorphisms
-map :math:`GL(n)\to GL\left({n+k-1\choose k}\right)` and :math:`GL\left({n\choose k}\right)`. The
-corresponding branching rules are not implemented but a special
-case is. The k-th symmetric power homomorphism :math:`SL(2)\to GL(k+1)`
-has its image inside of :math:`SO(2r+1)` if :math:`k=2r` and inside of :math:`Sp(2r)` if
-:math:`k=2r-1`. Hence there are branching rules::
+The `k`-th symmetric and exterior power homomorphisms map
+`GL(n) \to GL \left({n+k-1 \choose k} \right)` and
+`GL \left({n \choose k} \right)`. The corresponding branching rules
+are not implemented but a special case is. The `k`-th symmetric power
+homomorphism `SL(2) \to GL(k+1)` has its image inside of `SO(2r+1)` if
+`k = 2r` and inside of `Sp(2r)` if `k = 2r-1`. Hence there are
+branching rules::
 
-        ['B',r] => A1
-        ['C',r] => A1
+    ['B',r] => A1
+    ['C',r] => A1
 
 and these may be obtained using ``rule="symmetric_power"``.
 
+
 Plethysms
 ---------
 
-The above branching rules are sufficient for most cases, but
-a few fall between the cracks. Mostly these involve maximal
-subgroups of fairly small rank.
+The above branching rules are sufficient for most cases, but a few
+fall between the cracks. Mostly these involve maximal subgroups of
+fairly small rank.
 
-``rule="plethysm"`` is a powerful rule that includes any branching rule from
-types A,B,C or D as a special case. Thus it could be used in place of the
-above rules and would give the same results. However it is most useful when
-branching from :math:`G` to a maximal subgroup :math:`H` such that :math:`rank(H) < rank(G)-1`.
+The rule ``rule="plethysm"`` is a powerful rule that includes any
+branching rule from types A, B, C or D as a special case. Thus it
+could be used in place of the above rules and would give the same
+results. However, it is most useful when branching from `G` to a
+maximal subgroup `H` such that `rank(H) < rank(G)-1`.
 
-We consider a homomorphism :math:`H\to G` where :math:`G` is one of
-:math:`SL(r+1)`, :math:`SO(2r+1)`, :math:`Sp(2r)` or :math:`SO(2r)`. The function
-branching_rule_from_plethysm produces the corresponding
-branching rule. The main ingredient is the character
-:math:`\chi` of the representation of :math:`H` that is the homomorphism
-to :math:`GL(r+1)`, :math:`GL(2r+1)` or :math:`GL(2r)`.
+We consider a homomorphism `H \to G` where `G` is one of `SL(r+1)`,
+`SO(2r+1)`, `Sp(2r)` or `SO(2r)`. The function
+``branching_rule_from_plethysm`` produces the corresponding branching
+rule. The main ingredient is the character `\chi` of the
+representation of `H` that is the homomorphism to `GL(r+1)`,
+`GL(2r+1)` or `GL(2r)`.
 
-Let us consider the symmetric fifth power representation
-of SL(2). This is implemented above by ``rule="symmetric_power"``,
-but suppose we want to use ``rule="plethysm"``. First we
-construct the homomorphism by invoking its character,
-to be called ``chi``::
+Let us consider the symmetric fifth power representation of
+`SL(2)`. This is implemented above by ``rule="symmetric_power"``, but
+suppose we want to use ``rule="plethysm"``. First we construct the
+homomorphism by invoking its character, to be called ``chi``::
 
-    sage: A1=WeylCharacterRing("A1",style="coroots")
-    sage: chi=A1([5])
+    sage: A1 = WeylCharacterRing("A1", style="coroots")
+    sage: chi = A1([5])
     sage: chi.degree()
     6
     sage: chi.frobenius_schur_indicator()
     -1
 
-This confirms that the character has degree 6 and
-s symplectic, so it corresponds to a homomorphism
-:math:`SL(2) \to Sp(6)`, and there is a corresponding
-branching rule C3 => A1::
+This confirms that the character has degree 6 and is symplectic, so it
+corresponds to a homomorphism `SL(2) \to Sp(6)`, and there is a
+corresponding branching rule ``C3 => A1``::
 
-    sage: C3 = WeylCharacterRing("C3",style="coroots")
-    sage: sym5rule = branching_rule_from_plethysm(chi,"C3")
-    sage: [C3(hwv).branch(A1,rule=sym5rule) for hwv in C3.fundamental_weights()]
+    sage: C3 = WeylCharacterRing("C3", style="coroots")
+    sage: sym5rule = branching_rule_from_plethysm(chi, "C3")
+    sage: [C3(hwv).branch(A1, rule=sym5rule) for hwv in C3.fundamental_weights()]
     [A1(5), A1(4) + A1(8), A1(3) + A1(9)]
 
 This is identical to the results we would obtain using
-rule="symmetric_power"::
+``rule="symmetric_power"``::
 
-    sage: [C3(v).branch(A1,rule="symmetric_power") for v in C3.fundamental_weights()]
+    sage: [C3(v).branch(A1, rule="symmetric_power") for v in C3.fundamental_weights()]
     [A1(5), A1(4) + A1(8), A1(3) + A1(9)]
 
-But the next example of plethysm gives a branching rule not available by other
-methods::
+But the next example of plethysm gives a branching rule not available
+by other methods::
 
-    sage: G2 = WeylCharacterRing("G2",style="coroots")
-    sage: D7 = WeylCharacterRing("D7",style="coroots")
-    sage: ad=G2(0,1); ad.degree()
+    sage: G2 = WeylCharacterRing("G2", style="coroots")
+    sage: D7 = WeylCharacterRing("D7", style="coroots")
+    sage: ad = G2(0,1); ad.degree()
     14
     sage: ad.frobenius_schur_indicator()
     1
 
-This is the 14-dimensional adjoint representation of the
-exceptional group :math:`G_2`. Since the Frobenius-Schur indicator
-is 1, the representation is orthogonal, and factors through
-:math:`SO(14)`. Let us branch the fundamental representations::
+This is the 14-dimensional adjoint representation of the exceptional
+group `G_2`. Since the Frobenius-Schur indicator is 1, the
+representation is orthogonal, and factors through `SO(14)`. Let us
+branch the fundamental representations::
 
     sage: for r in D7.fundamental_weights():
-    ....:    print D7(r).branch(G2, rule=branching_rule_from_plethysm(ad,"D7"))
-    ....:
+    ...      print D7(r).branch(G2, rule=branching_rule_from_plethysm(ad, "D7"))
+    ...
     G2(0,1)
     G2(0,1) + G2(3,0)
     G2(0,0) + G2(2,0) + G2(3,0) + G2(0,2) + G2(4,0)
@@ -388,59 +391,68 @@
     G2(1,1)
     G2(1,1)
 
+
 Miscellaneous other subgroups
 -----------------------------
 
-Use ``rule="miscellaneous"`` for the branching rule ``B3 => G2``. This may
-also be obtained using a plethysm but for convenience this one is hand-coded.
+Use ``rule="miscellaneous"`` for the branching rule ``B3 => G2``. This
+may also be obtained using a plethysm but for convenience this one is
+hand-coded.
 
-Nuts and Bolts of Branching Rules
------------------------------------
+
+Nuts and bolts of branching rules
+---------------------------------
 
 Sage has many built-in branching rules, enough to handle most
-cases. However if you find a case where there is no existing
-rule, you may code it by hand. Moreover it may be useful to understand
-how the built-in rules work.
+cases. However, if you find a case where there is no existing rule,
+you may code it by hand. Moreover, it may be useful to understand how
+the built-in rules work.
 
-Suppose you want to branch from a group :math:`G` to a subgroup :math:`H`.  Arrange the
-embedding so that a Cartan subalgebra U of :math:`H` is contained in a Cartan
-subalgebra :math:`T` of :math:`G`. There is thus a mapping from the weight spaces
-:math:`\hbox{Lie}(T)^* \to \hbox{Lie}(U)^*`.  Two embeddings will produce identical
-branching rules if they differ by an element of the Weyl group of :math:`H`.
-The *rule* is this map :math:`\hbox{Lie}(T)^*` ``= G.space()`` to :math:`\hbox{Lie}(U)^*` ``=
-H.space()``, which you may implement as a function.
+Suppose you want to branch from a group `G` to a subgroup `H`.
+Arrange the embedding so that a Cartan subalgebra `U` of `H` is
+contained in a Cartan subalgebra `T` of `G`. There is thus a mapping
+from the weight spaces `\hbox{Lie}(T)^* \to \hbox{Lie}(U)^*`.  Two
+embeddings will produce identical branching rules if they differ by an
+element of the Weyl group of `H`. The *rule* is this map
+`\hbox{Lie}(T)^*` ``= G.space()`` to
+`\hbox{Lie}(U)^*` ``= H.space()``, which you may implement as a
+function.
 
 As an example, let us consider how to implement the branching rule
-``A3 -> C2``.  Here ``H = C2 = Sp(4)`` embedded as a subgroup in ``A3 = GL(4).`` The
-Cartan subalgebra :math:`\hbox{Lie}(U)` consists of diagonal matrices with eigenvalues ``u1, u2,
--u2, -u1``. Then ``C2.space()`` is the two dimensional vector spaces consisting of
-the linear functionals ``u1`` and ``u2`` on ``U``. On the other hand
-:math:`Lie(T)=\mathbb{R}^4`. A convenient way to see the restriction is to think of
-it as the adjoint of the map ``[u1,u2] -> [u1,u2,-u2,-u1]``, that is,
-``[x0,x1,x2,x3] -> [x0-x3,x1-x2].`` Hence we may encode the rule::
+``A3 -> C2``.  Here ``H = C2 = Sp(4)`` embedded as a subgroup in
+``A3 = GL(4).`` The Cartan subalgebra `\hbox{Lie}(U)` consists of
+diagonal matrices with eigenvalues ``u1, u2, -u2, -u1``. Then
+``C2.space()`` is the two dimensional vector spaces consisting of the
+linear functionals ``u1`` and ``u2`` on ``U``. On the other hand
+`Lie(T) = \mathbb{R}^4`. A convenient way to see the restriction is to
+think of it as the adjoint of the map ``[u1,u2] -> [u1,u2,-u2,-u1]``,
+that is, ``[x0,x1,x2,x3] -> [x0-x3,x1-x2].`` Hence we may encode the
+rule::
 
     def brule(x):
-        return [x[0]-x[3],x[1]-x[2]]
+        return [x[0]-x[3], x[1]-x[2]]
 
 or simply::
 
-    brule = lambda x : [x[0]-x[3],x[1]-x[2]]
+    brule = lambda x: [x[0]-x[3], x[1]-x[2]]
 
 Let us check that this agrees with the built-in rule::
 
-    sage: A3 = WeylCharacterRing(['A',3])
-    sage: C2 = WeylCharacterRing(['C',2])
-    sage: brule = lambda x : [x[0]-x[3],x[1]-x[2]]
+    sage: A3 = WeylCharacterRing(['A', 3])
+    sage: C2 = WeylCharacterRing(['C', 2])
+    sage: brule = lambda x: [x[0]-x[3], x[1]-x[2]]
     sage: A3(1,1,0,0).branch(C2, rule=brule)
     C2(0,0) + C2(1,1)
     A3(1,1,0,0).branch(C2, rule="symmetric")
     C2(0,0) + C2(1,1)
 
-Automorphisms and Triality
+
+Automorphisms and triality
 --------------------------
 
-The case where :math:`G=H` can be treated as a special case of a branching
-rule. In most cases (:math:`A_r`, :math:`D_r`, :math:`E_6`) there is a unique automorphism
-and the branching rule can be obtained using ``rule="automorphic"``.
-The exception is :math:`D_4`, where an additional automorphism of order
-three can be obtained using ``rule="triality"``.
+The case where `G=H` can be treated as a special case of a branching
+rule. In most cases (`A_r`, `D_r`, `E_6`) there is a unique
+automorphism and the branching rule can be obtained using
+``rule="automorphic"``. The exception is `D_4`, where an additional
+automorphism of order three can be obtained using
+``rule="triality"``.
diff --git a/doc/en/thematic_tutorials/lie/crystals.rst b/doc/en/thematic_tutorials/lie/crystals.rst
--- a/doc/en/thematic_tutorials/lie/crystals.rst
+++ b/doc/en/thematic_tutorials/lie/crystals.rst
@@ -1,254 +1,382 @@
+==================
 Classical Crystals
-=================================================================
+==================
 
-Tableaux and Representations of :math:`GL(n)`
----------------------------------------------
 
-Let :math:`\lambda` be a partition. The *Young diagram* of :math:`\lambda` is the
-array of boxes having :math:`\lambda_i` boxes in the :math:`i`-th row, left adjusted. Thus
-if :math:`\lambda = (3, 2)` the diagram is:
+Tableaux and representations of `GL(n)`
+---------------------------------------
 
-:math:`\def\lr#1#2#3{\multicolumn{1}{#1@{\hspace{.6ex}}c@{\hspace{.6ex}}#2}{\raisebox{-.3ex}{$#3$}}}\raisebox{-6ex}{\begin{array}[b]{cccc}\cline{1-3}\lr{|}{|}{\;}&\lr{|}{|}{\;}&\lr{|}{|}{\;}\\ \cline{1-3}\lr{|}{|}{}&\lr{|}{|}{}&&\\ \cline{1-2}\end{array}}`
+Let `\lambda` be a partition. The *Young diagram* of `\lambda` is the
+array of boxes having `\lambda_i` boxes in the `i`-th row, left
+adjusted. Thus if `\lambda = (3, 2)` the diagram is:
 
-A *semi-standard Young tableau* of shape :math:`\lambda` is a filling of the
-box by integers in which the rows are weakly decreasing and the columns are
-strictly decreasing. Thus
+.. MATH::
 
-:math:`\def\lr#1#2#3{\multicolumn{1}{#1@{\hspace{.6ex}}c@{\hspace{.6ex}}#2}{\raisebox{-.3ex}{$#3$}}}\raisebox{-6ex}{\begin{array}[b]{cccc}\cline{1-3}\lr{|}{|}{3}&\lr{|}{|}{2}&\lr{|}{|}{2}\\ \cline{1-3}\lr{|}{|}{2}&\lr{|}{|}{1}&&\\ \cline{1-2}\end{array}}`
+    \def\lr#1#2#3{\multicolumn{1}{#1@{\hspace{.6ex}}c@{\hspace{.6ex}}#2}{\raisebox{-.3ex}{$#3$}}}\raisebox{-6ex}
+    {\begin{array}[b]{cccc}\cline{1-3}
+    \lr{|}{|}{\;} & \lr{|}{|}{\;} & \lr{|}{|}{\;} \\\cline{1-3}
+    \lr{|}{|}{}   & \lr{|}{|}{}   && \\\cline{1-2}
+    \end{array}}
+
+A *semi-standard Young tableau* of shape `\lambda` is a filling of the
+box by integers in which the rows are weakly decreasing and the
+columns are strictly decreasing. Thus
+
+.. MATH::
+
+    \def\lr#1#2#3{\multicolumn{1}{#1@{\hspace{.6ex}}c@{\hspace{.6ex}}#2}{\raisebox{-.3ex}{$#3$}}}\raisebox{-6ex}
+    {\begin{array}[b]{cccc}\cline{1-3}
+    \lr{|}{|}{3} & \lr{|}{|}{2} & \lr{|}{|}{2} \\\cline{1-3}
+    \lr{|}{|}{2} & \lr{|}{|}{1} && \\\cline{1-2}
+    \end{array}}
 
 is a semistandard Young tableau. Sage has a Tableau class, and you may
 create this tableau as follows::
 
-    sage: T=Tableau([[3,2,2],[2,1]]); T
+    sage: T = Tableau([[3,2,2], [2,1]]); T
     [[3, 2, 2], [2, 1]]
 
-A partition of length :math:`\le r+1` is a dominant weight for :math:`GL(r+1,\mathbb{C})` according
-to the description of the ambient space in :ref:`standard-realizations`. Therefore
-it corresponds to an irreducible representation
-:math:`\pi_\lambda=\pi_\lambda^{GL(r+1)}` of :math:`GL(r+1,\mathbb{C})`.
+A partition of length `\le r+1` is a dominant weight for
+`GL(r+1, \mathbb{C})` according to the description of the ambient
+space in :ref:`standard-realizations`. Therefore it corresponds to an
+irreducible representation `\pi_\lambda = \pi_\lambda^{GL(r+1)}` of
+`GL(r+1, \mathbb{C})`.
 
-It is true that not every dominant weight :math:`\lambda` is a partition, since a
-dominant weight might have some values :math:`\lambda_i` negative. The dominant
-weight :math:`\lambda` is a partition if and only if the character of :math:`\lambda`
-is a polynomial as a function on the space :math:`\hbox{Mat}_n(\mathbb{C})`.
-Thus for example :math:`\det^{-1}=\pi_\lambda` with :math:`\lambda=(-1,\cdots,-1)`,
-which is a dominant weight but not a partition, and the character is not
-a polynomial function on :math:`\hbox{Mat}_n(\mathbb{C})`
+It is true that not every dominant weight `\lambda` is a partition,
+since a dominant weight might have some values `\lambda_i`
+negative. The dominant weight `\lambda` is a partition if and only if
+the character of `\lambda` is a polynomial as a function on the space
+`\hbox{Mat}_n(\mathbb{C})`. Thus for example `\det^{-1} = \pi_\lambda`
+with `\lambda = (-1, \dots, -1)`, which is a dominant weight but not
+a partition, and the character is not a polynomial function on
+`\hbox{Mat}_n(\mathbb{C})`.
 
-**Theorem** (Littlewood) If :math:`\lambda` is a partition, then the number of Semi-Standard Young
-Tableaux with shape :math:`\lambda` and entries in :math:`{1,2,\cdots,r+1}` is the dimension
-of :math:`\pi_\lambda`.
+**Theorem** (Littlewood) If `\lambda` is a partition, then the number
+of Semi-Standard Young Tableaux with shape `\lambda` and entries in
+`{1,2,\dots,r+1}` is the dimension of `\pi_\lambda`.
 
-For example, if :math:`\lambda=(3,2)` and :math:`r=2`, then we find 15 tableaux with shape :math:`\lambda` and entries in :math:`\{1,2,3\}`:
+For example, if `\lambda = (3,2)` and `r = 2`, then we find 15
+tableaux with shape `\lambda` and entries in `\{1,2,3\}`:
 
-:math:`\begin{array}{ccccc}{\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}\lr{1}&\lr{1}&\lr{1}\\\cline{1-1}\cline{2-2}\cline{3-3}\lr{2}&\lr{2}\\\cline{1-1}\cline{2-2}\end{array}$}}&{\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}\lr{1}&\lr{1}&\lr{2}\\\cline{1-1}\cline{2-2}\cline{3-3}\lr{2}&\lr{2}\\\cline{1-1}\cline{2-2}\end{array}$}}&{\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}\lr{1}&\lr{1}&\lr{3}\\\cline{1-1}\cline{2-2}\cline{3-3}\lr{2}&\lr{2}\\\cline{1-1}\cline{2-2}\end{array}$}}&{\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}\lr{1}&\lr{1}&\lr{3}\\\cline{1-1}\cline{2-2}\cline{3-3}\lr{2}&\lr{3}\\\cline{1-1}\cline{2-2}\end{array}$}}&{\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}\lr{1}&\lr{2}&\lr{3}\\\cline{1-1}\cline{2-2}\cline{3-3}\lr{2}&\lr{3}\\\cline{1-1}\cline{2-2}\end{array}$}}\\\\{\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}\lr{1}&\lr{1}&\lr{3}\\\cline{1-1}\cline{2-2}\cline{3-3}\lr{3}&\lr{3}\\\cline{1-1}\cline{2-2}\end{array}$}}&{\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}\lr{1}&\lr{2}&\lr{3}\\\cline{1-1}\cline{2-2}\cline{3-3}\lr{3}&\lr{3}\\\cline{1-1}\cline{2-2}\end{array}$}}&{\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}\lr{2}&\lr{2}&\lr{3}\\\cline{1-1}\cline{2-2}\cline{3-3}\lr{3}&\lr{3}\\\cline{1-1}\cline{2-2}\end{array}$}}&{\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}\lr{1}&\lr{1}&\lr{1}\\\cline{1-1}\cline{2-2}\cline{3-3}\lr{2}&\lr{3}\\\cline{1-1}\cline{2-2}\end{array}$}}&{\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}\lr{1}&\lr{1}&\lr{2}\\\cline{1-1}\cline{2-2}\cline{3-3}\lr{2}&\lr{3}\\\cline{1-1}\cline{2-2}\end{array}$}}\\\\{\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}\lr{1}&\lr{2}&\lr{2}\\\cline{1-1}\cline{2-2}\cline{3-3}\lr{2}&\lr{3}\\\cline{1-1}\cline{2-2}\end{array}$}}&{\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}\lr{1}&\lr{1}&\lr{1}\\\cline{1-1}\cline{2-2}\cline{3-3}\lr{3}&\lr{3}\\\cline{1-1}\cline{2-2}\end{array}$}}&{\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}\lr{1}&\lr{1}&\lr{2}\\\cline{1-1}\cline{2-2}\cline{3-3}\lr{3}&\lr{3}\\\cline{1-1}\cline{2-2}\end{array}$}}&{\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}\lr{1}&\lr{2}&\lr{2}\\\cline{1-1}\cline{2-2}\cline{3-3}\lr{3}&\lr{3}\\\cline{1-1}\cline{2-2}\end{array}$}}&{\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}\lr{2}&\lr{2}&\lr{2}\\\cline{1-1}\cline{2-2}\cline{3-3}\lr{3}&\lr{3}\\\cline{1-1}\cline{2-2}\end{array}$}}\end{array}`
+.. MATH::
 
-This is consistent with the theorem since the dimension of the irreducible
-representation of :math:`GL(3)` with highest weight :math:`(3,2,0)` has dimension 15::
+    \begin{array}{ccccc}
+    {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}
+    {$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{1} & \lr{1} & \lr{1} \\\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{2} & \lr{2} \\\cline{1-1}\cline{2-2}
+    \end{array}$}}
+    &
+    {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}
+    {$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{1} & \lr{1} & \lr{2} \\\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{2} & \lr{2} \\\cline{1-1}\cline{2-2}
+    \end{array}$}}
+    &
+    {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}
+    {$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{1} & \lr{1} & \lr{3} \\\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{2} & \lr{2} \\\cline{1-1}\cline{2-2}
+    \end{array}$}}
+    &
+    {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}
+    {$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{1} & \lr{1} & \lr{3} \\\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{2} & \lr{3} \\\cline{1-1}\cline{2-2}
+    \end{array}$}}
+    &
+    {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}
+    {$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{1} & \lr{2} & \lr{3} \\\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{2} & \lr{3} \\\cline{1-1}\cline{2-2}
+    \end{array}$}}\\\\
+    {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}
+    {$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{1} & \lr{1} & \lr{3} \\\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{3} & \lr{3} \\\cline{1-1}\cline{2-2}
+    \end{array}$}}
+    &
+    {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}
+    {$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{1} & \lr{2} & \lr{3} \\\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{3} & \lr{3} \\\cline{1-1}\cline{2-2}
+    \end{array}$}}
+    &
+    {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}
+    {$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{2} & \lr{2} & \lr{3} \\\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{3} & \lr{3} \\\cline{1-1}\cline{2-2}
+    \end{array}$}}
+    &
+    {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}
+    {$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{1} & \lr{1} & \lr{1} \\\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{2} & \lr{3} \\\cline{1-1}\cline{2-2}
+    \end{array}$}}
+    &
+    {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}
+    {$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{1} & \lr{1} & \lr{2} \\\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{2} & \lr{3} \\\cline{1-1}\cline{2-2}
+    \end{array}$}}\\\\
+    {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}
+    {$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{1} & \lr{2} & \lr{2} \\\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{2} & \lr{3} \\\cline{1-1}\cline{2-2}
+    \end{array}$}}
+    &
+    {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}
+    {$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{1} & \lr{1} & \lr{1} \\\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{3} & \lr{3} \\\cline{1-1}\cline{2-2}
+    \end{array}$}}
+    &
+    {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}
+    {$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{1} & \lr{1} & \lr{2} \\\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{3} & \lr{3} \\\cline{1-1}\cline{2-2}
+    \end{array}$}}
+    &
+    {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}
+    {$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{1} & \lr{2} & \lr{2} \\\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{3} & \lr{3} \\\cline{1-1}\cline{2-2}
+    \end{array}$}}
+    &
+    {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}
+    {$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{2} & \lr{2} & \lr{2} \\\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{3} & \lr{3} \\\cline{1-1}\cline{2-2}
+    \end{array}$}}
+    \end{array}
 
-    sage: A2=WeylCharacterRing("A2")
+This is consistent with the theorem since the dimension of the
+irreducible representation of `GL(3)` with highest weight `(3,2,0)`
+has dimension 15::
+
+    sage: A2 = WeylCharacterRing("A2")
     sage: A2(3,2,0).degree()
     15
 
-In fact we may obtain the character of the representation from the set of tableaux.
-Indeed, one of the definitions of the Schur polynomial (due to Littlewood) is
-the following combinatorial one. If :math:`T` is a tableaux, define the
-*weight* of :math:`T` to be :math:`\hbox{wt}(T)=(k_1,\cdots,k_n)` where
-:math:`k_i` is the number of :math:`i`'s in the tableaux. Then the
-multiplicity of :math:`\mu` in the character :math:`\chi_\lambda` is the
-number of tableaux of weight :math:`\lambda`. Thus if
-:math:`\mathbf{z}=(z_1,\cdots,z_n)`, we have
+In fact we may obtain the character of the representation from the set
+of tableaux. Indeed, one of the definitions of the Schur polynomial
+(due to Littlewood) is the following combinatorial one. If `T` is a
+tableaux, define the *weight* of `T` to be
+`\hbox{wt}(T) = (k_1,\dots,k_n)` where `k_i` is the number of `i`'s
+in the tableaux. Then the multiplicity of `\mu` in the character
+`\chi_\lambda` is the number of tableaux of weight `\lambda`. Thus if
+`\mathbf{z} = (z_1,\dots,z_n)`, we have
 
-:math:`\chi_\lambda(\mathbf{z})=\sum_T \mathbf{z}^{\hbox{wt}(T)}`
+.. MATH::
 
-where the sum is over all semistandard Young tableaux of shape :math:`\lambda`
-that have entries in :math:`{1,2,\cdots,r+1}`.
+    \chi_\lambda(\mathbf{z}) = \sum_T \mathbf{z}^{\hbox{wt}(T)}
 
-Tableaux and representations of :math:`S_k`
--------------------------------------------
+where the sum is over all semi-standard Young tableaux of shape
+`\lambda` that have entries in `{1,2,\dots,r+1}`.
 
-Representations of the symmetric group :math:`S_k` are parametrized by partitions
-:math:`\lambda` of :math:`k`. The parametrization may be characterized as follows.
-Let :math:`n` be any integer :math:`\ge k`. Then both :math:`GL(n,\mathbb{C})` and :math:`S_k`
-act on :math:`\otimes^k V` where :math:`V=\mathbb{C}^n`. Indeed, :math:`GL(n)` acts on
-each :math:`V` and :math:`S_k` permutes them. Then if :math:`\pi_\lambda^{GL(n)}` is the
-representation of :math:`GL(n,\mathbb{C})` with highest weight vector :math:`\lambda`
-and :math:`\pi_\lambda^{S_k}` is the irreducible representation of :math:`S_k`
-parametrized by :math:`\lambda` then
 
-:math:`\otimes^k V \cong \bigoplus_{\lambda\vdash k}\pi^{GL(n)}_\lambda\otimes\pi^{S_k}_\lambda`
+Tableaux and representations of `S_k`
+-------------------------------------
+
+Representations of the symmetric group `S_k` are parametrized by
+partitions `\lambda` of `k`. The parametrization may be characterized
+as follows. Let `n` be any integer `\ge k`. Then both
+`GL(n,\mathbb{C})` and `S_k` act on `\otimes^k V` where
+`V = \mathbb{C}^n`. Indeed, `GL(n)` acts on each `V` and `S_k`
+permutes them. Then if `\pi_\lambda^{GL(n)}` is the representation of
+`GL(n,\mathbb{C})` with highest weight vector `\lambda` and
+`\pi_\lambda^{S_k}` is the irreducible representation of `S_k`
+parametrized by `\lambda` then
+
+.. MATH::
+
+    \otimes^k V
+    \cong
+    \bigoplus_{\lambda\vdash k}\pi^{GL(n)}_\lambda\otimes\pi^{S_k}_\lambda
 
 as bimodules for the two groups. This is *Frobenius-Schur duality* and
 it serves to characterize the parametrization of the irreducible
-representations of :math:`S_k` by partitions of :math:`k`.
+representations of `S_k` by partitions of `k`.
 
-Let us say that a Tableaux :math:`T` of shape :math:`\lambda\vdash k` is *standard*
-if :math:`T` contains each entry :math:`1,2,\cdots,k` exactly once.
+Let us say that a Tableaux `T` of shape `\lambda\vdash k` is
+*standard* if `T` contains each entry `1,2,\dots,k` exactly once.
 
-**Theorem** (Young, 1927) The degree of :math:`\pi_\lambda` is the number of standard
-tableaux of shape :math:`\lambda`.
+**Theorem** (Young, 1927) The degree of `\pi_\lambda` is the number of
+standard tableaux of shape `\lambda`.
+
 
 The Robinson-Schensted-Knuth correspondence
 -------------------------------------------
 
 References:
 
-- Knuth, The Art of Computer Programming, Volume 3. Sorting and searching.
-  Chapter on Tableaux and Involutions. (1973)
+- [Knuth1998]_, section "Tableaux and Involutions".
 
-- Knuth, Permutations, matrices, and generalized Young tableaux.
-  Pacific J. Math. 34 1970 709--727.
+- [Knuth1970]_
 
-- Fulton, Young Tableaux. (1997)
+- [Fulton1997]_
 
-- Stanley, Enumerative Combinatorics, Volume 2 (1999).
+- [Stanley1999]_
 
-The Robinson-Schensted-Knuth correspondence gives bijections
-between pairs of tableaux of various types and combinatorial
-objects of different types. We will not review the correspondence
-in detail here, but see the references. We note that Schensted
-insertion is implemented as the method :meth:`schensted_insertion`
-of Tableau class in Sage.
+The Robinson-Schensted-Knuth correspondence gives bijections between
+pairs of tableaux of various types and combinatorial objects of
+different types. We will not review the correspondence in detail here,
+but see the references. We note that Schensted insertion is
+implemented as the method ``schensted_insertion`` of Tableau class in
+Sage.
 
 Thus we have the following bijections:
 
-- Pairs of standard tableaux of the same shape :math:`\lambda`
-  as :math:`\lambda` runs through the partitions of :math:`k` are in bijection
-  with the :math:`k!` elements of :math:`S_k`.
+- Pairs of standard tableaux of the same shape `\lambda` as `\lambda`
+  runs through the partitions of `k` are in bijection with the `k!`
+  elements of `S_k`.
 
-- Pairs of tableaux :math:`T_1` and :math:`T_2` of shape :math:`\lambda` where
-  :math:`\lambda` runs through the partitions of :math:`k` such that :math:`T_1`
-  is a standard tableau and :math:`T_2` is a semistandard tableau in
-  :math:`1,2,\cdots,n` are in bijection with the :math:`n^k` words of
-  length :math:`k` in :math:`1,2,\cdots,n`.
+- Pairs of tableaux `T_1` and `T_2` of shape `\lambda` where `\lambda`
+  runs through the partitions of `k` such that `T_1` is a standard
+  tableau and `T_2` is a semistandard tableau in `1,2,\dots,n` are in
+  bijection with the `n^k` words of length `k` in `1,2,\dots,n`.
 
-- Pairs of tableaux :math:`T_1` and :math:`T_2` of the same shape :math:`\lambda` but
-  arbitrary size in :math:`1,2,3,\cdots,n` are in bijection with :math:`n\times n`
+- Pairs of tableaux `T_1` and `T_2` of the same shape `\lambda` but
+  arbitrary size in `1,2,3,\dots,n` are in bijection with `n \times n`
   positive integer matrices.
 
-- Pairs of tableaux :math:`T_1` and :math:`T_2` of conjugate shapes
-  :math:`\lambda` and :math:`\lambda'` are in bijection with :math:`n\times n`
-  matrices with entries :math:`0` or :math:`1`.
+- Pairs of tableaux `T_1` and `T_2` of conjugate shapes `\lambda` and
+  `\lambda'` are in bijection with `n \times n` matrices with entries
+  `0` or `1`.
+
 
 Analogies between representation theory and combinatorics
 ---------------------------------------------------------
 
-The three bijections cited above have the following analogs
-in representation theory.
+The three bijections cited above have the following analogs in
+representation theory.
 
-- The group algebra :math:`\mathbb{C}` is an :math:`S_k\times S_k` bimodule
-  with of dimension :math:`k!`. It decomposes as a direct sum of
-  :math:`\pi_\lambda^{S_k}\otimes \pi_\lambda^{S_k}`.
+- The group algebra `\mathbb{C}` is an `S_k \times S_k` bimodule with
+  of dimension `k!`. It decomposes as a direct sum of
+  `\pi_\lambda^{S_k} \otimes \pi_\lambda^{S_k}`.
 
-- This is analogous to Frobenius-Schur duality, which decomposes
-  the :math:`n^k`-dimensional vector space :math:`V^k` where :math:`V=\mathbb{C}`
-  into the direct sum of :math:`\pi_\lambda^{GL(n)}\otimes\pi_\lambda^{S_k}`
-  as a bimodule, where :math:`\lambda` runs through partitions of :math:`k`.
+- This is analogous to Frobenius-Schur duality, which decomposes the
+  `n^k`-dimensional vector space `V^k` where `V = \mathbb{C}` into the
+  direct sum of `\pi_\lambda^{GL(n)} \otimes \pi_\lambda^{S_k}` as a
+  bimodule, where `\lambda` runs through partitions of `k`.
 
 - This is analogous to the decomposition of the ring of polynomial
-  functions on :math:`\hbox{Mat}(n,\mathbb{C})` on which :math:`GL(n,\mathbb{C})\times GL(n,\mathbb{C})`
-  acts by :math:`(g_1,g_2)f(X)=f({^t g_1}X g_2)`. The polynomial ring
-  decomposes into the direct sum of :math:`\pi^{GL(n)}_\lambda\otimes\pi^{GL(n)}_\lambda`.
-  Taking traces gives the Cauchy identity.
+  functions on `\hbox{Mat}(n, \mathbb{C})` on which
+  `GL(n, \mathbb{C}) \times GL(n, \mathbb{C})` acts by
+  `(g_1, g_2)f(X) = f({^t g_1}X g_2)`. The polynomial ring decomposes
+  into the direct sum of
+  `\pi^{GL(n)}_\lambda \otimes \pi^{GL(n)}_\lambda`. Taking traces
+  gives the Cauchy identity.
 
-- This is analogous to the decomposition of the exterior algebra
-  over :math:`\hbox{Mat}(n,\mathbb{C})`. Taking traces gives the dual
-  Cauchy identity.
+- This is analogous to the decomposition of the exterior algebra over
+  `\hbox{Mat}(n, \mathbb{C})`. Taking traces gives the dual Cauchy
+  identity.
+
 
 Interpolating between representation theory and combinatorics
 -------------------------------------------------------------
 
 The theory of quantum groups interpolates between the representation
-theoretic picture and the combinatorial picture, and thereby
-explains these analogies. The representation :math:`\pi_\lambda^{GL(n)}`
-is reinterpreted as a module for the quantized enveloping algebra
-:math:`U_q(\mathfrak{gl}_n(\mathbb{C}))`, and the representation
-:math:`\pi_\lambda^{S_k}` is reinterpreted as a module for the Iwahori
-Hecke algebra. Then Frobenius-Schur duality persists. Reference:
+theoretic picture and the combinatorial picture, and thereby explains
+these analogies. The representation `\pi_\lambda^{GL(n)}` is
+reinterpreted as a module for the quantized enveloping algebra
+`U_q(\mathfrak{gl}_n(\mathbb{C}))`, and the representation
+`\pi_\lambda^{S_k}` is reinterpreted as a module for the Iwahori
+Hecke algebra. Then Frobenius-Schur duality persists. See
+[Jimbo1986]_. When `q \to 1`, we recover the representation
+story. When `q \to 0`, we recover the combinatorial story.
 
-- Jimbo, Michio A :math:`q`-analogue of :math:`U(\mathfrak{gl}(N+1))`, Hecke algebra,
-  and the Yang-Baxter equation. Lett. Math. Phys. 11 (1986), no. 3, 247--252.
 
-When :math:`q\to 1`, we recover the representation story. When :math:`q\to 0`,
-we recover the combinatorial story.
-
-Kashiwara Crystals
--------------------
+Kashiwara crystals
+------------------
 
 References:
 
-- Kashiwara, On crystal bases. Representations of groups (Banff, AB, 1994),
-  155--197, CMS Conf. Proc., 16, Amer. Math. Soc., Providence, RI, 1995.
+- [Kashiwara1995]_
 
-- Kashiwara and Nakashima, Crystal graphs for representations of the
-  :math:`q`-analogue of classical Lie algebras.  J. Algebra 165 (1994), no. 2,
-  295--345.
+- [KashiwaraNakashima1994]_
 
-- Hong and Kang, Introduction to quantum groups and crystal bases. AMS Graduate
-  Studies in Mathematics, 2002.
+- [HongKang2002]_
 
-Kashiwara considered the highest weight modules of quantized enveloping
-algebras :math:`U_q(\mathfrak{g})` in the limit when :math:`q\to 0`. The enveloping
-algebra cannot be defined when :math:`q=0`, but a limiting structure can still be
-detected. This is the *crystal basis* of the module.
+Kashiwara considered the highest weight modules of quantized
+enveloping algebras `U_q(\mathfrak{g})` in the limit when
+`q \to 0`. The enveloping algebra cannot be defined when `q = 0`, but
+a limiting structure can still be detected. This is the
+*crystal basis* of the module.
 
-Kashiwara's crystal bases have a combinatorial structure that sheds light
-even on purely combinatorial constructions on tableaux that predated quantum groups.
-It gives a good generalization to other Cartan types.
+Kashiwara's crystal bases have a combinatorial structure that sheds
+light even on purely combinatorial constructions on tableaux that
+predated quantum groups. It gives a good generalization to other
+Cartan types.
 
-We will not make the most general definition of a crystal. See the references
-for a more general definition. Let :math:`\Lambda` be the weight lattice of a classical
-Cartan type.
+We will not make the most general definition of a crystal. See the
+references for a more general definition. Let `\Lambda` be the weight
+lattice of a classical Cartan type.
 
-We now define a *crystal* of type :math:`\Phi`. Let :math:`\mathcal{B}` be a set,
-and let :math:`0 \notin \mathcal{B}` be an auxiliary element. For each index :math:`1
-\le i \le r` we assume there given maps :math:`e_i, f_i : \mathcal{B}
-\longrightarrow \mathcal{B} \cup \{0\}`, maps :math:`\varepsilon_i, \phi_i :
-\mathcal{B} \longrightarrow \mathbb{Z}` and a map
-:math:`\hbox{wt} : \mathcal{B} \longrightarrow \Lambda` satisfying certain
-assumptions, which we now describe.
-It is assumed that if :math:`x, y \in
-\mathcal{B}` then :math:`e_i (x) = y` if and only if :math:`f_i (y) = x`. In this case, it
-is assumed that
+We now define a *crystal* of type `\Phi`. Let `\mathcal{B}` be a set,
+and let `0 \notin \mathcal{B}` be an auxiliary element. For each index
+`1 \le i \le r` we assume there given maps
+`e_i, f_i : \mathcal{B} \longrightarrow \mathcal{B} \cup \{0\}`, maps
+`\varepsilon_i, \phi_i : \mathcal{B} \longrightarrow \mathbb{Z}` and a
+map `\hbox{wt} : \mathcal{B} \longrightarrow \Lambda` satisfying
+certain assumptions, which we now describe. It is assumed that if
+`x, y \in \mathcal{B}` then `e_i (x) = y` if and only if
+`f_i (y) = x`. In this case, it is assumed that
 
-:math:`\hbox{wt} (y) = \hbox{wt} (x) + \alpha_i, \qquad \varepsilon_i (x) =  \varepsilon_i (y) + 1, \qquad \phi_i (x) = \phi_i (y) - 1.`
+.. MATH::
+
+    \hbox{wt} (y) = \hbox{wt} (x) + \alpha_i,
+    \qquad
+    \varepsilon_i (x) = \varepsilon_i (y) + 1,
+    \qquad \phi_i (x) = \phi_i (y) - 1.
 
 Moreover, we assume that
 
-:math:`\phi_i (x) - \varepsilon_i (x) = \left\langle \hbox{wt} (x), \alpha^{\vee}_i \right\rangle`
+.. MATH::
 
-for all :math:`x \in \mathcal{B}`.
+    \phi_i (x) - \varepsilon_i (x)
+    =
+    \left\langle \hbox{wt} (x), \alpha^{\vee}_i \right\rangle
 
-**Assumption** (Regularity) We will assume that :math:`\varepsilon_i(v)` is the
-number of times that :math:`e_i` may applied to :math:`v`, and that :math:`\phi_i(v)` is the
-number of times that :math:`f_i` may be applied. That is,
-:math:`\phi_i (x) = \max \{k|f_i^k x \neq 0\}` and :math:`\varepsilon_i (x) = \max \{k|e_i^k (x) \neq 0\}.`
+for all `x \in \mathcal{B}`.
 
-This regularity assumption is not made by Kashiwara, but it is satisfied by the
-crystals that we are concerned with here. Kashiwara also allows :math:`\varepsilon_i`
-and :math:`\phi_i` to take the value :math:`-\infty`.
+**Assumption** (Regularity) We will assume that `\varepsilon_i(v)` is
+the number of times that `e_i` may applied to `v`, and that
+`\phi_i(v)` is the number of times that `f_i` may be applied. That is,
+`\phi_i (x) = \max \{k|f_i^k x \neq 0\}` and
+`\varepsilon_i (x) = \max \{k|e_i^k (x) \neq 0\}`.
 
-Given the crystal :math:`\mathcal{B}`, the *character* :math:`\chi_{\mathcal{B}}` is:
+This regularity assumption is not made by Kashiwara, but it is
+satisfied by the crystals that we are concerned with here. Kashiwara
+also allows `\varepsilon_i` and `\phi_i` to take the value `-\infty`.
 
-:math:`\sum_{v\in\mathcal{B}} {\mathbf{z}}^{wt(v)}`.
+Given the crystal `\mathcal{B}`, the *character* `\chi_{\mathcal{B}}` is:
 
-Given any highest weight :math:`\lambda`, constructions of Kashiwara and Nakashima,
-Littelmann and others produce a crystal :math:`\chi_{\mathcal{B}_\lambda}` such that
-:math:`\chi_{\mathcal{B}_\lambda}=\chi_\lambda`, where :math:`\chi_\lambda` is the irreducible
-character with highest weight :math:`\lambda`, as in :ref:`representations`.
+.. MATH::
 
-The crystal :math:`\mathcal{B}_\lambda` is not uniquely characterized by the
-properties that we have stated so far. For Cartan types A,D,E it may
+    \sum_{v\in\mathcal{B}} {\mathbf{z}}^{wt(v)}.
+
+Given any highest weight `\lambda`, constructions of Kashiwara and
+Nakashima, Littelmann and others produce a crystal
+`\chi_{\mathcal{B}_\lambda}` such that
+`\chi_{\mathcal{B}_\lambda} = \chi_\lambda`, where `\chi_\lambda` is
+the irreducible character with highest weight `\lambda`, as in
+:ref:`representations`.
+
+The crystal `\mathcal{B}_\lambda` is not uniquely characterized by the
+properties that we have stated so far. For Cartan types A, D, E it may
 be characterized by these properties together with certain other
 *Stembridge axioms*. We will take it for granted that there is a
-unique "correct" crystal :math:`\mathcal{B}_\lambda` and discuss how these
+unique "correct" crystal `\mathcal{B}_\lambda` and discuss how these
 are constructed in Sage.
 
-Installing Dot2tex
+
+Installing dot2tex
 ------------------
 
-Before giving examples of crystals, we digress to help you install dot2tex,
-which you will need in order to make latex images of crystals.
+Before giving examples of crystals, we digress to help you install
+dot2tex, which you will need in order to make latex images of
+crystals.
 
 You may download the following file:
 
@@ -260,41 +388,50 @@
 
 to install the package.
 
-Crystals of Tableaux in Sage
+
+Crystals of tableaux in Sage
 ----------------------------
 
-For type :math:`A_r`, Kashiwara and Nakashima put a crystal
-structure on the set of tableaux with shape :math:`\lambda`
-in :math:`1,2,\cdots,r+1`, and this is a realization of
-:math:`\mathcal{B}_\lambda`. Moreover, this construction extends
-to other Cartan types, as we will explain. At the moment, we will
-consider how to draw pictures of these crystals.
+For type `A_r`, Kashiwara and Nakashima put a crystal structure on the
+set of tableaux with shape `\lambda` in `1,2,\dots,r+1`, and this is a
+realization of `\mathcal{B}_\lambda`. Moreover, this construction
+extends to other Cartan types, as we will explain. At the moment, we
+will consider how to draw pictures of these crystals.
 
 Once you have dot2tex installed, you may make images pictures of crystals
 as follows::
 
-    sage: C=CrystalOfTableaux("A2",shape=[2,1])
+    sage: C = CrystalOfTableaux("A2", shape=[2,1])
     sage: C.latex_file("/tmp/a2rho.tex")
 
-Here :math:`\lambda=(2,1)=(2,1,0)`. The crystal ``C`` is :math:`\mathcal{B}_{\lambda}`.
-The character :math:`\chi_\lambda` will therefore be the eight-dimensional irreducible
-character with this highest weight. The method :meth:`latex_file` produces
+Here `\lambda = (2,1)=(2,1,0)`. The crystal ``C`` is
+`\mathcal{B}_{\lambda}`. The character `\chi_\lambda` will therefore
+be the eight-dimensional irreducible character with this highest
+weight. The method ``latex_file`` produces
 
 .. image:: ../static/a2rho.png
 
-As you can see, the elements of this crystal are exactly the eight tableaux
-of shape :math:`\lambda` with entries in :math:`\{1,2,3\}`. The convention is that if
-:math:`x,y\in\mathcal{B}` and :math:`f_i(x)=y`, or equivalently :math:`e_i(y)=x`, then we
-draw an arrow from :math:`x\to y`. Thus the highest weight tableau is the
-one with no incoming arrows. Indeed, this is:
+As you can see, the elements of this crystal are exactly the eight
+tableaux of shape `\lambda` with entries in `\{1,2,3\}`. The
+convention is that if `x,y \in \mathcal{B}` and `f_i(x) = y`, or
+equivalently `e_i(y) = x`, then we draw an arrow from `x \to y`. Thus
+the highest weight tableau is the one with no incoming arrows. Indeed,
+this is:
 
-:math:`{\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\lr{1}&\lr{1}\\\cline{1-1}\cline{2-2}\lr{2}\\\cline{1-1}\end{array}$}}`
+.. MATH::
 
-We recall that the weight of the tableau is :math:`(k_1,k_2,k_3)` where :math:`k_i` is the number of
-:math:`i`'s in the tableau, so this tableau has weight :math:`(2,1,0)`, which indeed equals :math:`\lambda`.
+    {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}
+    {$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}
+    \lr{1} & \lr{1} \\\cline{1-1}\cline{2-2}
+    \lr{2} \\\cline{1-1}
+    \end{array}$}}
 
-Once the crystal is created, you have access to the ambient space and its methods
-through the method :meth:weight_lattice_realization()::
+We recall that the weight of the tableau is `(k_1,k_2,k_3)` where
+`k_i` is the number of `i`'s in the tableau, so this tableau has
+weight `(2,1,0)`, which indeed equals `\lambda`.
+
+Once the crystal is created, you have access to the ambient space and
+its methods through the method ``weight_lattice_realization()``::
 
     sage: L = C.weight_lattice_realization(); L
     Ambient space of the Root system of type ['A', 2]
@@ -311,8 +448,8 @@
     sage: C[0]
     [[1, 1], [2]]
 
-Now we may apply the operators :math:`e_i` and :math:`f_i` to
-move around in the crystal::
+Now we may apply the operators `e_i` and `f_i` to move around in the
+crystal::
 
     sage: v.f(1)
     [[1, 2], [2]]
@@ -328,118 +465,171 @@
     sage: v.f(1).f(2).f(2).f(1) == v.f(2).f(1).f(1).f(2)
     True
 
-You can construct the character if you first make a Weyl character ring::
+You can construct the character if you first make a Weyl character
+ring::
 
     sage: A2 = WeylCharacterRing("A2")
     sage: C.character(A2)
     A2(2,1,0)
 
-Crystals of Letters
+
+Crystals of letters
 -------------------
 
-For each of the classical Cartan types there is a *standard
-crystal* :math:`\mathcal{B}_{\hbox{standard}}` from which other
-crystals can be built up by taking tensor products and extracting
-constituent irreducible crystals. This procedure is sufficient
-for Cartan types :math:`A_r` and :math:`C_r`. For types :math:`B_r` and :math:`D_r`
-the standard crystal must be supplemented with a *spin crystal*.
+For each of the classical Cartan types there is a *standard crystal*
+`\mathcal{B}_{\hbox{standard}}` from which other crystals can be built
+up by taking tensor products and extracting constituent irreducible
+crystals. This procedure is sufficient for Cartan types `A_r` and
+`C_r`. For types `B_r` and `D_r` the standard crystal must be
+supplemented with a *spin crystal*.
 
 .. image:: ../static/standard1.png
 
 The crystal of letters is a special case of the crystal of tableaux
-in the sense that :math:`\mathcal{B}_{\hbox{standard}}` is isomorphic
-the crystal of tableaux whose highest weight :math:`\lambda` is the
-highest weight vector of the standard representation. Thus compare::
+in the sense that `\mathcal{B}_{\hbox{standard}}` is isomorphic to
+the crystal of tableaux whose highest weight `\lambda` is the highest
+weight vector of the standard representation. Thus compare::
 
     sage: CrystalOfLetters("A3")
     The crystal of letters for type ['A', 3]
-    sage: CrystalOfTableaux("A3",shape=[1])
+    sage: CrystalOfTableaux("A3", shape=[1])
     The crystal of tableaux of type ['A', 3] and shape(s) [[1]]
 
-These two crystals are different in implementation, but they
-are isomorphic, and in fact the second crystal is constructed
-from the first. Crystals of letters have a special role in
-the theory since they are particularly simple, yet as
-Kashiwara and Nakashima showed, the crystals of tableaux can
-be created from them.  We will review how this works.
+These two crystals are different in implementation, but they are
+isomorphic, and in fact the second crystal is constructed from the
+first. Crystals of letters have a special role in the theory since
+they are particularly simple, yet as Kashiwara and Nakashima showed,
+the crystals of tableaux can be created from them.  We will review how
+this works.
 
-Tensor Products of Crystals
+
+Tensor products of crystals
 ---------------------------
 
-Kashiwara defined the tensor product of crystals in a purely combinatorial
-way. The beauty of this construction is that it exactly parallels the
-tensor product of crystals of representations. That is, if
-:math:`\lambda` and :math:`\mu` are dominant weights, then
-:math:`\mathcal{B}_\lambda\otimes\mathcal{B}_\mu` is a (usually
+Kashiwara defined the tensor product of crystals in a purely
+combinatorial way. The beauty of this construction is that it exactly
+parallels the tensor product of crystals of representations. That is,
+if `\lambda` and `\mu` are dominant weights, then
+`\mathcal{B}_\lambda \otimes \mathcal{B}_\mu` is a (usually
 disconnected) crystal which may contain multiple copies of
-:math:`\mathcal{B}_\nu` (for another dominant weight :math:`\nu`) but the
-number of copies of :math:`\mathcal{B}_\nu` is exactly the multiplicity
-of :math:`\chi_\nu` in :math:`\chi_\lambda\chi_\mu`.
+`\mathcal{B}_\nu` (for another dominant weight `\nu`) but the number
+of copies of `\mathcal{B}_\nu` is exactly the multiplicity of
+`\chi_\nu` in `\chi_\lambda\chi_\mu`.
 
 We will describe two conventions for the tensor product of
-crystals. These conventions would have to be modified slightly
-without the regularity assumption.
+crystals. These conventions would have to be modified slightly without
+the regularity assumption.
+
 
 Kashiwara's definition
 ^^^^^^^^^^^^^^^^^^^^^^
 
-As a set, the tensor product :math:`\mathcal{B} \otimes \mathcal{C}` of crystals
-:math:`\mathcal{B}` and :math:`\mathcal{C}` is the Cartesian product, but we denote the
-ordered pair :math:`(x, y)` with :math:`x \in \mathcal{B}` and :math:`y \in \mathcal{C}` by :math:`x
-\otimes y`. We define :math:`\hbox{wt} (x \otimes y) = \hbox{wt} (x) + \hbox{wt}
-(y)`. We define
+As a set, the tensor product `\mathcal{B} \otimes \mathcal{C}` of
+crystals `\mathcal{B}` and `\mathcal{C}` is the Cartesian product, but
+we denote the ordered pair `(x, y)` with `x \in \mathcal{B}` and
+`y \in \mathcal{C}` by `x \otimes y`. We define
+`\hbox{wt} (x \otimes y) = \hbox{wt} (x) + \hbox{wt}(y)`. We define
 
-:math:`f_i (x \otimes y) = \left\{ \begin{array}{ll} f_i (x) \otimes y & \text{if $\phi_i (x) > \varepsilon_i (y)$},\\ x \otimes f_i (y) & \text{if $\phi_i (x) \le \varepsilon_i (y)$}, \end{array} \right.`
+.. MATH::
+
+    f_i (x \otimes y)
+    =
+    \begin{cases}
+    f_i (x) \otimes y & \text{if $\phi_i (x) > \varepsilon_i (y)$},\\
+    x \otimes f_i (y) & \text{if $\phi_i (x) \le \varepsilon_i (y)$},
+    \end{cases}
 
 and
 
-:math:`e_i (x \otimes y) = \left\{ \begin{array}{ll} e_i (x) \otimes y & \text{if $\phi_i (x) \ge \varepsilon_i (y)$},\\ x \otimes e_i (y) & \text{if $\phi_i (x) < \varepsilon_i (y)$} . \end{array} \right.`
+.. MATH::
 
-It is understood that :math:`x \otimes 0 = 0 \otimes x = 0`. We also define:
+    e_i (x \otimes y)
+    =
+    \begin{cases}
+    e_i (x) \otimes y & \text{if $\phi_i (x) \ge \varepsilon_i (y)$},\\
+    x \otimes e_i (y) & \text{if $\phi_i (x) < \varepsilon_i (y)$}.
+    \end{cases}
 
-:math:`\phi_i (x \otimes y) = \max (\phi_i (y), \phi_i (x) + \phi_i (y) - \varepsilon_i (y)),`
+It is understood that `x \otimes 0 = 0 \otimes x = 0`. We also define:
 
-:math:`\varepsilon_i (x \otimes y) = \max (\varepsilon_i (x), \varepsilon_i (x) + \varepsilon_i (y) - \phi_i (x)) .`
+.. MATH::
+
+    \phi_i (x \otimes y)
+    =
+    \max (\phi_i (y), \phi_i (x) + \phi_i (y) - \varepsilon_i (y)),
+
+.. MATH::
+
+    \varepsilon_i (x \otimes y)
+    =
+    \max (\varepsilon_i (x), \varepsilon_i (x) + \varepsilon_i (y) - \phi_i (x)) .
 
 
 Alternative definition
 ^^^^^^^^^^^^^^^^^^^^^^
 
-As a set, the tensor product :math:`\mathcal{B} \otimes \mathcal{C}` of crystals
-:math:`\mathcal{B}` and :math:`\mathcal{C}` is the Cartesian product, but we denote the
-ordered pair :math:`(y, x)` with :math:`y \in \mathcal{B}` and :math:`x \in \mathcal{C}` by :math:`x
-\otimes y`. We define :math:`\hbox{wt} (x \otimes y) = \hbox{wt} (y) + \hbox{wt}
-(x)`. We define
+As a set, the tensor product `\mathcal{B} \otimes \mathcal{C}` of
+crystals `\mathcal{B}` and `\mathcal{C}` is the Cartesian product, but
+we denote the ordered pair `(y, x)` with `y \in \mathcal{B}` and
+`x \in \mathcal{C}` by `x \otimes y`. We define
+`\hbox{wt} (x \otimes y) = \hbox{wt} (y) + \hbox{wt}(x)`. We define
 
-:math:`f_i (x \otimes y) = \left\{ \begin{array}{ll}  f_i (x) \otimes y & \text{if $\phi_i (y) \le \varepsilon_i (x)$},\\  x \otimes f_i (y) & \text{if $\phi_i (y) > \varepsilon_i (x)$},  \end{array} \right.`
+.. MATH::
+
+    f_i (x \otimes y)
+    =
+    \begin{cases}
+    f_i (x) \otimes y & \text{if $\phi_i (y) \le \varepsilon_i (x)$},\\
+    x \otimes f_i (y) & \text{if $\phi_i (y) > \varepsilon_i (x)$},
+    \end{cases}
 
 and
 
-:math:`e_i (x \otimes y) = \left\{ \begin{array}{ll}  e_i (x) \otimes y & \text{if $\phi_i (y) < \varepsilon_i (x)$} .\\  x \otimes e_i (y) & \text{if $\phi_i (y) \ge \varepsilon_i (x)$}, \end{array} \right.`
+.. MATH::
 
-It is understood that :math:`y \otimes 0 = 0 \otimes y = 0`. We also define
+    e_i (x \otimes y)
+    =
+    \begin{cases}
+    e_i (x) \otimes y & \text{if $\phi_i (y) < \varepsilon_i (x)$},\\
+    x \otimes e_i (y) & \text{if $\phi_i (y) \ge \varepsilon_i (x)$}.
+    \end{cases}
 
-:math:`\phi_i (x \otimes y)  =  \max (\phi_i (x), \phi_i (y) + \phi_i (x) - \varepsilon_i (x)),`
+It is understood that `y \otimes 0 = 0 \otimes y = 0`. We also define
 
-:math:`\varepsilon_i (x \otimes y)  =  \max (\varepsilon_i (y), \varepsilon_i (y) + \varepsilon_i (x) - \phi_i (y)) .`
+.. MATH::
 
-The tensor product is associative: :math:`(x\otimes y)\otimes z\mapsto x\otimes(y\otimes z)` is
-an isomorphism :math:`(\mathcal{B}\otimes\mathcal{C})\otimes\mathcal{D}\to\mathcal{B}\otimes(\mathcal{C}\otimes\mathcal{D})`,
+    \phi_i (x \otimes y)
+    =
+    \max (\phi_i (x), \phi_i (y) + \phi_i (x) - \varepsilon_i (x)),
+
+.. MATH::
+
+    \varepsilon_i (x \otimes y)
+    =
+    \max (\varepsilon_i (y), \varepsilon_i (y) + \varepsilon_i (x) - \phi_i (y)).
+
+The tensor product is associative:
+`(x \otimes y) \otimes z \mapsto x \otimes(y \otimes z)` is an
+isomorphism
+`(\mathcal{B} \otimes \mathcal{C}) \otimes \mathcal{D} \to \mathcal{B} \otimes (\mathcal{C} \otimes \mathcal{D})`,
 and so we may consider tensor products of arbitrary numbers of crystals.
 
+
 The relationship between the two definitions
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 The relationship between the two definitions is simply that the
-Kashiwara tensor product :math:`\mathcal{B}\otimes\mathcal{C}` is the
-alternate tensor product :math:`\mathcal{C}\otimes\mathcal{B}` in
-reverse order. Sage uses the alternative tensor product. Even
-though the tensor product construction is *a priori* asymmetrical,
-both constructions produce isomorphic crystals, and in particular Sage's
+Kashiwara tensor product `\mathcal{B} \otimes \mathcal{C}` is the
+alternate tensor product `\mathcal{C} \otimes \mathcal{B}` in reverse
+order. Sage uses the alternative tensor product. Even though the
+tensor product construction is *a priori* asymmetrical, both
+constructions produce isomorphic crystals, and in particular Sage's
 crystals of tableaux are identical to Kashiwara's.
 
+
 Tensor products of crystals in Sage
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-You may construct the tensor product of several crystals in Sage using ``TensorProductOfCrystals``::
+You may construct the tensor product of several crystals in Sage using
+``TensorProductOfCrystals``::
 
     sage: C = CrystalOfLetters("A2")
     sage: T = TensorProductOfCrystals(C,C,C); T
@@ -450,7 +640,8 @@
     sage: T.highest_weight_vectors()
     [[1, 1, 1], [1, 2, 1], [2, 1, 1], [3, 2, 1]]
 
-This crystal has four highest weight vectors. We may understand this as follows::
+This crystal has four highest weight vectors. We may understand this
+as follows::
 
     sage: A2 = WeylCharacterRing("A2")
     sage: chi_C = C.character(A2)
@@ -462,17 +653,17 @@
     sage: chi_T == chi_C^3
     True
 
-As expected, the character of ``T`` is the cube of the character of ``C``, and
-representations with highest weight :math:`(1,1,1)`, :math:`(3,0,0)` and :math:`(2,1,0)`. This
-decomposition is predicted by Frobenius-Schur duality: the multiplicity
-of :math:`\pi_\lambda^{GL(n)}` in :math:`\otimes^3\mathbb{C}^3` is the degree of
-of :math:`\pi_\lambda^{S_3}`.
+As expected, the character of ``T`` is the cube of the character of
+``C``, and representations with highest weight `(1,1,1)`, `(3,0,0)`
+and `(2,1,0)`. This decomposition is predicted by Frobenius-Schur
+duality: the multiplicity of `\pi_\lambda^{GL(n)}` in
+`\otimes^3\mathbb{C}^3` is the degree of `\pi_\lambda^{S_3}`.
 
-It is useful to be able to select one irreducible constitutent of T.
-If we only want one of the irreducible constituents of T, we can specify a
-list of highest weight vectors by the option ``generators``. If the list
-has only one element, then we get an irreducible crystal. We can make
-four such crystals::
+It is useful to be able to select one irreducible constitutent of
+``T``. If we only want one of the irreducible constituents of ``T``,
+we can specify a list of highest weight vectors by the option
+``generators``. If the list has only one element, then we get an
+irreducible crystal. We can make four such crystals::
 
     sage: [T1,T2,T3,T4] = \
     [TensorProductOfCrystals(C,C,C,generators=[v]) for v in T.highest_weight_vectors()]
@@ -481,106 +672,134 @@
     sage: [B.character(A2) for B in [T1,T2,T3,T4]]
     [A2(3,0,0), A2(2,1,0), A2(2,1,0), A2(1,1,1)]
 
-We see that two of these crystals are isomorphic, with character ``A2(2,1,0)``.
-Try::
+We see that two of these crystals are isomorphic, with character
+``A2(2,1,0)``. Try::
 
     sage: T1.plot(), T2.plot(), T3.plot(), T4.plot()
 
 Elements of ``TensorProductOfCrystals(A,B,C, ...)`` are represented by
 sequences ``[a,b,c, ...]`` with ``a`` in ``A``, ``b`` in ``B``, etc.
-This of course represents :math:`a\otimes b\otimes c\otimes\cdots`.
+This of course represents `a \otimes b \otimes c \otimes \cdots`.
 
-Crystals of Tableaux as tensor products of crystals
+
+Crystals of tableaux as tensor products of crystals
 ---------------------------------------------------
 
-Sage implements the CrystalOfTableaux as a subcrystal of a tensor
+Sage implements the ``CrystalOfTableaux`` as a subcrystal of a tensor
 product of the CrystalOfLetters. You can see how its done as follows::
 
-    sage: T = CrystalOfTableaux("A3",shape=[3,1])
+    sage: T = CrystalOfTableaux("A3", shape=[3,1])
     sage: v = T.highest_weight_vector().f(1).f(2).f(3).f(1).f(2); v
     [[1, 3, 4], [2]]
     sage: v._list
     [2, 1, 3, 4]
 
-We've looked at the internal representation of :math:`v`, where it is represented
-as an element of the fourth tensor power of the CrystalOfLetters. We see that
-the tableau:
+We've looked at the internal representation of `v`, where it is
+represented as an element of the fourth tensor power of the
+``CrystalOfLetters``. We see that the tableau:
 
-:math:`{\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}{$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}\lr{1}&\lr{3}&\lr{4}\\\cline{1-1}\cline{2-2}\cline{3-3}\lr{2}\\\cline{1-1}\end{array}$}}`
+.. MATH::
+
+    {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}\raisebox{-.6ex}
+    {$\begin{array}[b]{ccc}\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{1} & \lr{3} & \lr{4} \\\cline{1-1}\cline{2-2}\cline{3-3}
+    \lr{2} \\\cline{1-1}
+    \end{array}$}}
 
 is interpreted as the tensor:
 
-:math:`\begin{array}{|l|}\hline 2\\ \hline\end{array} \otimes \begin{array}{|l|} \hline 1\\ \hline\end{array} \otimes \begin{array}{|l|} \hline 4\\ \hline\end{array} \otimes \begin{array}{|l|} \hline 3\\ \hline\end{array}`
+.. MATH::
 
-The elements of the tableau are read from bottom to top and from left to right. This is the
-*inverse middle-Eastern reading* of the tableau. See Hong and Kang, *loc. cit.* for discussion
-of the readings of a tableau.
+    \begin{array}{|l|}\hline
+    2 \\ \hline
+    \end{array}
+    \otimes
+    \begin{array}{|l|} \hline
+    1 \\ \hline
+    \end{array}
+    \otimes
+    \begin{array}{|l|} \hline
+    4 \\ \hline
+    \end{array}
+    \otimes
+    \begin{array}{|l|} \hline
+    3 \\ \hline
+    \end{array}
 
-Spin Crystals
+The elements of the tableau are read from bottom to top and from left
+to right. This is the *inverse middle-Eastern reading* of the
+tableau. See Hong and Kang, *loc. cit.* for discussion of the readings
+of a tableau.
+
+
+Spin crystals
 -------------
 
-For the Cartan types :math:`A_r`, :math:`C_r` or :math:`G_2`, CrystalOfTableaux are capable of making any
-finite crystal. (For type :math:`A_r` it is necessary that the highest weight :math:`\lambda` be
-a partition.)
+For the Cartan types `A_r`, `C_r` or `G_2`, ``CrystalOfTableaux`` are
+capable of making any finite crystal. (For type `A_r` it is necessary
+that the highest weight `\lambda` be a partition.)
 
-For Cartan types :math:`B_r` and :math:`D_r`, CrystalOfTableaux fail to make :math:`\mathcal{B}_\lambda`
-if :math:`\lambda` is half-integral. For type :math:`B_2` you can do this::
+For Cartan types `B_r` and `D_r`, ``CrystalOfTableaux`` fail to make
+`\mathcal{B}_\lambda` if `\lambda` is half-integral. For type `B_2`
+you can do this::
 
-    sage: B = FastCrystal(['B',2],shape=[3/2,1/2]); B
+    sage: B = FastCrystal(['B',2], shape=[3/2,1/2]); B
     The fast crystal for B2 with shape [3/2,1/2]
     sage: v = B.highest_weight_vector(); v.weight()
     (3/2, 1/2)
 
-However FastCrystals are only available for rank two Cartan types. We therefore
-have to do something else to create crystals of half-integral weight.
+However FastCrystals are only available for rank two Cartan types. We
+therefore have to do something else to create crystals of
+half-integral weight.
 
-For types :math:`B_r` and :math:`D_r` the solution to this problem involves the use of
-*spin crystals*.
+For types `B_r` and `D_r` the solution to this problem involves the
+use of *spin crystals*.
+
 
 Type B spin crystal
 ^^^^^^^^^^^^^^^^^^^
-The spin crystal has highest weight :math:`(1/2,\cdots,1/2)`. This is
-the last fundamental weight. The irreducible representation with this weight
-is the spin representation of degree :math:`2^r`. Its crystal is hand-coded in
-Sage::
+The spin crystal has highest weight `(1/2,\dots,1/2)`. This is the
+last fundamental weight. The irreducible representation with this
+weight is the spin representation of degree `2^r`. Its crystal is
+hand-coded in Sage::
 
     sage: Cspin = CrystalOfSpins("B3"); Cspin
     The crystal of spins for type ['B', 3]
     sage: Cspin.cardinality()
     8
 
-We can make use of this to construct an arbitrary crystal with
-highest weight :math:`\lambda`, where :math:`\lambda` is a half-integral
-weight. For example, suppose that :math:`\lambda=(3/2,3/2,1/2)`. The
-corresponding irreducible character will have degree 112::
+We can make use of this to construct an arbitrary crystal with highest
+weight `\lambda`, where `\lambda` is a half-integral weight. For
+example, suppose that `\lambda = (3/2, 3/2, 1/2)`. The corresponding
+irreducible character will have degree 112::
 
-    sage: B3=WeylCharacterRing("B3")
+    sage: B3 = WeylCharacterRing("B3")
     sage: B3(3/2,3/2,1/2).degree()
     112
 
-So :math:`\mathcal{B}_\lambda` will have 112 elements. We can
-find it as a subcrystal of ``Cspin``:math:`\otimes\mathcal{B}_\mu`,
-where :math:`\mu=\lambda-(1/2,1/2,1/2)=(1,1,0)`::
+So `\mathcal{B}_\lambda` will have 112 elements. We can find it as a
+subcrystal of ``Cspin`` `\otimes \mathcal{B}_\mu`, where
+`\mu = \lambda-(1/2,1/2,1/2) = (1,1,0)`::
 
     sage: B3(1,1,0)*B3(1/2,1/2,1/2)
     B3(1/2,1/2,1/2) + B3(3/2,1/2,1/2) + B3(3/2,3/2,1/2)
 
-We see that just taking the tensor product of these two
-crystals will produce a reducible crystal with three
-constitutents, and we want to extract the one we want.
-We do that as follows::
+We see that just taking the tensor product of these two crystals will
+produce a reducible crystal with three constitutents, and we want to
+extract the one we want. We do that as follows::
 
-    sage: C1 = CrystalOfTableaux("B3",shape=[1,1])
-    sage: C = TensorProductOfCrystals(C1,Cspin,generators=[[C1[0],Cspin[0]]])
+    sage: C1 = CrystalOfTableaux("B3", shape=[1,1])
+    sage: C = TensorProductOfCrystals(C1, Cspin, generators=[[C1[0],Cspin[0]]])
     sage: C.cardinality()
     112
 
 This is the desired crystal.
 
+
 Type D spin crystals
 ^^^^^^^^^^^^^^^^^^^^
-A similar situation pertains for type :math:`D_r`, but now there are two spin crystals,
-both of degree :math:`2^{r-1}`. These are hand-coded in sage::
+A similar situation pertains for type `D_r`, but now there are two
+spin crystals, both of degree `2^{r-1}`. These are hand-coded in sage::
 
     sage: SpinPlus = CrystalOfSpinsPlus("D4")
     sage: SpinMinus = CrystalOfSpinsMinus("D4")
@@ -591,23 +810,25 @@
     sage: [C.cardinality() for C in [SpinPlus,SpinMinus]]
     [8, 8]
 
-You can use them similarly to the type B crystal of spins in
-order to construct any crystal of half-integral weight.
+You can use them similarly to the type B crystal of spins in order to
+construct any crystal of half-integral weight.
 
-Levi Branching Rules for Crystals
+
+Levi branching rules for crystals
 ---------------------------------
 
-Let :math:`G` be a Lie group and :math:`H` a Levi subgroup. We have already seen
-that the Dynkin diagram of :math:`H` is obtained from that of :math:`G` by erasing
+Let `G` be a Lie group and `H` a Levi subgroup. We have already seen
+that the Dynkin diagram of `H` is obtained from that of `G` by erasing
 one or more nodes.
 
-If :math:`\mathcal{C}` is a crystal for :math:`G`, then we may obtain the corresponding
-crystal for :math:`H` by a similar process. For example if the Dynkin-diagram
-for :math:`H` is obtained from the Dynkin diagram for :math:`G` by erasing the :math:`i`-th
-node, then if we erase all the edges in the crystal :math:`\mathcal{C}` that
-are labeled with :math:`i`, we obtain a crystal for :math:`H`.
+If `\mathcal{C}` is a crystal for `G`, then we may obtain the
+corresponding crystal for `H` by a similar process. For example if the
+Dynkin diagram for `H` is obtained from the Dynkin diagram for `G` by
+erasing the `i`-th node, then if we erase all the edges in the crystal
+`\mathcal{C}` that are labeled with `i`, we obtain a crystal for `H`.
 
-Affine Crystals
+
+Affine crystals
 ---------------
 
 Sage contains support for affine crystals. These lie outside the scope
diff --git a/doc/en/thematic_tutorials/lie/introduction.rst b/doc/en/thematic_tutorials/lie/introduction.rst
--- a/doc/en/thematic_tutorials/lie/introduction.rst
+++ b/doc/en/thematic_tutorials/lie/introduction.rst
@@ -1,33 +1,43 @@
---------------------------------------
+--------------------------
 The Scope of this Document
---------------------------------------
+--------------------------
 
 
 Lie groups and algebras
-------------------------
+-----------------------
 
 Sage can be used to do standard computations for Lie groups and Lie
 algebras. The following categories of representations are equivalent:
 
-- Complex representations of a compact, semisimple simply connected Lie group :math:`G`.
+- Complex representations of a compact, semisimple simply connected
+  Lie group `G`.
 
-- Complex representations of its Lie algebra :math:`\mathfrak{g}`. This is a real Lie algebra, so representations are not required to be complex linear maps.
+- Complex representations of its Lie algebra `\mathfrak{g}`. This is a
+  real Lie algebra, so representations are not required to be complex
+  linear maps.
 
-- Complex representations of its complexified Lie algebra :math:`\mathfrak{g}_{\mathbb{C}}=\mathbb{C}\otimes\mathfrak{g}`. This is a complex Lie algebra and representations are required to be complex linear transformations.
+- Complex representations of its complexified Lie algebra
+  `\mathfrak{g}_{\mathbb{C}} = \mathbb{C} \otimes \mathfrak{g}`. This
+  is a complex Lie algebra and representations are required to be
+  complex linear transformations.
 
-- The complex analytic representations of the semisimple simply-connected complex analytic group :math:`G_{\mathbb{C}}` having :math:`\mathfrak{g}_{\mathbb{C}}` as its Lie algebra.
+- The complex analytic representations of the semisimple
+  simply-connected complex analytic group `G_{\mathbb{C}}` having
+  `\mathfrak{g}_{\mathbb{C}}` as its Lie algebra.
 
-- Modules of the universal enveloping algebra :math:`U(\mathfrak{g}_{\mathbb{C}})`.
+- Modules of the universal enveloping algebra
+  `U(\mathfrak{g}_{\mathbb{C}})`.
 
-- Modules of the quantized enveloping algebra :math:`U_q(\mathfrak{g}_{\mathbb{C}})`.
+- Modules of the quantized enveloping algebra
+  `U_q(\mathfrak{g}_{\mathbb{C}})`.
 
-For example, we could take :math:`G=SU(n)`,
-:math:`\mathfrak{g}=\mathfrak{sl}(n,\mathbb{R})`,
-:math:`\mathfrak{g}_{\mathbb{C}}=\mathfrak{sl}(n,\mathbb{C})` and
-:math:`G=SL(n,\mathbb{C})`. Because these categories are the same, their
-representations may be studied simultaneously. The above equivalences may be
-expanded to include reductive groups like :math:`U(n)` and :math:`GL(n)` with
-a bit of care.
+For example, we could take `G = SU(n)`,
+`\mathfrak{g} = \mathfrak{sl}(n, \mathbb{R})`,
+`\mathfrak{g}_{\mathbb{C}} = \mathfrak{sl}(n, \mathbb{C})` and
+`G = SL(n, \mathbb{C})`. Because these categories are the same, their
+representations may be studied simultaneously. The above equivalences
+may be expanded to include reductive groups like `U(n)` and `GL(n)`
+with a bit of care.
 
 Here are some typical problems that can be solved using Sage:
 
@@ -37,14 +47,15 @@
 
 - Compute the tensor product of two modules.
 
-- If :math:`H` is a subgroup of :math:`G`, study the restriction of modules for :math:`G` to :math:`H`. The solution to this problem is called a *branching rule*.
+- If `H` is a subgroup of `G`, study the restriction of modules for
+  `G` to `H`. The solution to this problem is called a *branching rule*.
 
-- Find the multiplicies of the weights of the representation.
+- Find the multiplicities of the weights of the representation.
 
-In addition to its representations, which we may study as above, a Lie group
-has various related structures. These include:
+In addition to its representations, which we may study as above, a Lie
+group has various related structures. These include:
 
-- The Weyl Group :math:`W`.
+- The Weyl Group `W`.
 
 - The Weight Lattice.
 
@@ -58,27 +69,32 @@
 
 Sage contains methods for working with these structures.
 
-If there is something you need that is not implemented, getting it added to
-Sage will likely be possible. You may write your own algorithm for an
-unimplemented task, and if it is something others will be interested in, it is
-probably possible to get it added to Sage.
+If there is something you need that is not implemented, getting it
+added to Sage will likely be possible. You may write your own
+algorithm for an unimplemented task, and if it is something others
+will be interested in, it is probably possible to get it added to
+Sage.
+
 
 Combinatorics
-------------------------
+-------------
 
 Sage supports a great many related mathematical objects. Some of these
-properly belong to combinatorics. It is beyond the scope of these notes to
-cover all the combinatorics in Sage, but we will try to touch on those
-combinatorial methods which have some connection with Lie groups and
-representation theory. These include:
+properly belong to combinatorics. It is beyond the scope of these
+notes to cover all the combinatorics in Sage, but we will try to touch
+on those combinatorial methods which have some connection with Lie
+groups and representation theory. These include:
 
-- The affine Weyl group, an infinite group containing :math:`W`.
+- The affine Weyl group, an infinite group containing `W`.
 
-- Kashiwara crystals, which are combinatorial analogs of modules in the above categories,
+- Kashiwara crystals, which are combinatorial analogs of modules in
+  the above categories.
 
-- Coxeter group methods applicable to Weyl groups and the affine Weyl group, such as Bruhat order.
+- Coxeter group methods applicable to Weyl groups and the affine Weyl
+  group, such as Bruhat order.
 
-- The Iwahori Hecke algebras, which are deformations of the group algebras of :math:`W` and the affine Weyl group.
+- The Iwahori Hecke algebras, which are deformations of the group
+  algebras of `W` and the affine Weyl group.
 
 - Kazhdan-Lusztig polynomials.
 
diff --git a/doc/en/thematic_tutorials/lie/iwahori_hecke_algebra.rst b/doc/en/thematic_tutorials/lie/iwahori_hecke_algebra.rst
--- a/doc/en/thematic_tutorials/lie/iwahori_hecke_algebra.rst
+++ b/doc/en/thematic_tutorials/lie/iwahori_hecke_algebra.rst
@@ -2,268 +2,332 @@
 Iwahori Hecke Algebras
 ----------------------
 
-The Iwahori Hecke algebra is defined in:
-
-Nagayoshi Iwahori, On the structure of a Hecke ring of a Chevalley group
-over a finite field.  J. Fac. Sci. Univ. Tokyo Sect. I 10 1964 215--236
-(1964).
-
-In this original paper, the algebra occurs as the convolution
-ring of functions on a p-adic group that are compactly supported
-and invariant both left and right by the Iwahori subgroup.
-However Iwahori determined its structure in terms of generators
-and relations, and it turns out to be a deformation of the
-group algebra of the affine Weyl group.
+The Iwahori Hecke algebra is defined in [Iwahori1964]_. In that
+original paper, the algebra occurs as the convolution ring of
+functions on a `p`-adic group that are compactly supported and
+invariant both left and right by the Iwahori subgroup. However Iwahori
+determined its structure in terms of generators and relations, and it
+turns out to be a deformation of the group algebra of the affine Weyl
+group.
 
 Once the presentation is found, the Iwahori Hecke algebra can be
-defined for any Coxeter group. It depends on a parameter :math:`q`
-which in Iwahori's paper is the cardinality of the residue field.
-But it could just as easily be an indeterminate.
+defined for any Coxeter group. It depends on a parameter `q` which in
+Iwahori's paper is the cardinality of the residue field. But it could
+just as easily be an indeterminate.
 
-Then the Iwahori Hecke algebra has the following description.
-Let :math:`W` be a Coxeter group, with generators (simple reflections)
-:math:`s_1,\cdots,s_n`. They satisfy the relations :math:`s_i^2=1` and
-the braid relations
+Then the Iwahori Hecke algebra has the following description. Let
+`W` be a Coxeter group, with generators (simple reflections)
+`s_1,\dots,s_n`. They satisfy the relations `s_i^2 = 1` and the braid
+relations
 
-:math:`s_i s_j s_i s_j ... = s_j s_i s_j s_i ...`
+.. MATH::
 
-where the number of terms on each side is the order
-of :math:`s_i s_j`.
+    s_i s_j s_i s_j \cdots = s_j s_i s_j s_i \cdots
 
-The Iwahori Hecke algebra has a basis :math:`T_1,\cdots,T_n`
-subject to relations that resemble those of the :math:`s_i`.
-They satisfy the braid relations and the quadratic
-relation
+where the number of terms on each side is the order of `s_i s_j`.
 
-:math:`(T_i-q)(T_i+1)=0.`
+The Iwahori Hecke algebra has a basis `T_1,\dots,T_n` subject to
+relations that resemble those of the `s_i`. They satisfy the braid
+relations and the quadratic relation
 
-This can be modified by letting :math:`q_1` and :math:`q_2` be two
-indeterminates and letting
+.. MATH::
 
-:math:`(T_i-q_1)(T_i-q_2) = 0.`
+    (T_i-q)(T_i+1) = 0.
 
-In this generality, Iwahori Hecke algebras have significance
-far beyond their origin in the representation theory of
-p-adic groups. For example, they appear in the geometry
-of Schubert varieties, where they are used in the definition
-of the Kazhdan-Lusztig polynomials. They appear in connection
-with quantum groups, and in Jones's original paper on the
-Jones polynomial.
+This can be modified by letting `q_1` and `q_2` be two indeterminates
+and letting
+
+.. MATH::
+
+    (T_i-q_1)(T_i-q_2) = 0.
+
+In this generality, Iwahori Hecke algebras have significance far
+beyond their origin in the representation theory of `p`-adic
+groups. For example, they appear in the geometry of Schubert
+varieties, where they are used in the definition of the
+Kazhdan-Lusztig polynomials. They appear in connection with quantum
+groups, and in Jones's original paper on the Jones polynomial.
 
 Here is how to create an Iwahori Hecke algebra::
 
-    sage: R.<q>=PolynomialRing(ZZ)
-    sage: H=IwahoriHeckeAlgebraT("B3",q); H
+    sage: R.<q> = PolynomialRing(ZZ)
+    sage: H = IwahoriHeckeAlgebraT("B3",q); H
     The Iwahori Hecke Algebra of Type B3 in q,-1 over Univariate
         Polynomial Ring in q over Integer Ring and prefix T
     sage: T1,T2,T3 = H.algebra_generators()
     sage: T1*T1
     (q-1)*T1 + q
 
-If the Cartan type is affine, the generators will be numbered
-starting with ``T0`` instead of ``T1``.
+If the Cartan type is affine, the generators will be numbered starting
+with ``T0`` instead of ``T1``.
 
 You may coerce a Weyl group element into the Iwahori Hecke algebra::
 
     sage: W = WeylGroup("G2",prefix="s")
     sage: [s1,s2]=W.simple_reflections()
-    sage: P.<q>=LaurentPolynomialRing(QQ)
+    sage: P.<q> = LaurentPolynomialRing(QQ)
     sage: H = IwahoriHeckeAlgebraT(W,q)
     sage: H(s1*s2)
     T1*T2
 
-Intertwining Operators
+
+Intertwining operators
 ----------------------
 
-The Iwahori Hecke operator can be used to study representations
-of p-adic groups that have fixed vectors with respect to the
-Iwahori subgroup. References:
+The Iwahori Hecke operator can be used to study representations of
+`p`-adic groups that have fixed vectors with respect to the Iwahori
+subgroup. References:
 
- - Rogawski, On modules over the Hecke algebra of a :math:`p`-adic
-   group, Invent. Math., Inventiones Mathematicae, 79, 1985, 3,
-   443--465,
+- [Rogawski1985]_
 
--  Reeder, On certain Iwahori invariants in the unramified principal
-   series, Pacific J. Math., Pacific Journal of Mathematics, 153, 1992, 2,
-   313--342,
+- [Reeder1992]_
 
--  Haines, Kottwitz and Parsad, Iwahori-Hecke Algebras,
-   http://arxiv.org/abs/math/0309168.
+- [HainesEtAl2009]_
 
--  Bump and Nakasuji, Casselman's basis of Iwahori vectors and the Bruhat order,
-   http://arxiv.org/abs/1002.2996.
+- [BumpNakasuji2010]_
 
--  Casselman, The unramified principal series of :math:`\mathfrak{p}`-adic groups. I. The
-   spherical function, Compositio Math., Compositio Mathematica, 40, 1980, 3,
-   387--406.
+- [Casselman1980]_
 
-A key feature of the theory are the intertwining operators between different
-induced representations. We will show how to implement these intertwining
-operators in Sage.
+A key feature of the theory are the intertwining operators between
+different induced representations. We will show how to implement these
+intertwining operators in Sage.
 
-For simplicity we will work over :math:`G=SL(n,F)` where :math:`F=\mathbb{Q}_q`,
-with :math:`q` a prime number, but everything works for an arbitrary split reductive group over a
-nonarchimedean local field. If :math:`\mathbf{z}=(z_1,\cdots,z_n)\in\mathbb{C}^n`,
-define the following quasicharacters of :math:`T(F)`, the diagonal subgroup
-in :math:`G`:
+For simplicity we will work over `G = SL(n,F)` where `F = \mathbb{Q}_q`,
+with `q` a prime number, but everything works for an arbitrary split
+reductive group over a nonarchimedean local field. If
+`\mathbf{z} = (z_1,\dots,z_n) \in \mathbb{C}^n`, define the following
+quasicharacters of `T(F)`, the diagonal subgroup in `G`:
 
-   :math:`\chi_{\mathbf{z}}\left(\begin{array}{ccc} t_1\\&\ddots\\&&t_n\end{array}\right)=\prod_{i=1}^n z_i^{\hbox{ord}(t_i)},\qquad
-   \delta\left(\begin{array}{ccc} t_1\\&\ddots\\&&t_n\end{array}\right)=\prod_{i=1}^n |t_i|^{n+1-2i}`
+.. MATH::
 
-We extend both to characters of the Borel subgroup :math:`B(F)` of upper triangular
-matrices by letting the subgroup :math:`N(F)` of upper triangular unipotent matrices
-be in the kernels. Let :math:`V(\chi)` with :math:`\chi=\chi_{\mathbf{z}}` is defined to be
-the space of locally constant functions :math:`f` on :math:`G` such that:
+    \chi_{\mathbf{z}}
+    \left(\begin{array}{ccc}
+    t_1 \\
+    & \ddots \\
+    && t_n
+    \end{array}\right)
+    =
+    \prod_{i=1}^n z_i^{\hbox{ord}(t_i)},
+    \qquad
+   \delta
+   \left(\begin{array}{ccc}
+   t_1 \\
+   & \ddots \\
+   && t_n
+   \end{array}\right)
+   =
+   \prod_{i=1}^n |t_i|^{n+1-2i}
 
-  :math:`f(b g) = (\delta^{1/2}\chi)(b)f(g),\qquad b\in B(F).`
+We extend both to characters of the Borel subgroup `B(F)` of upper
+triangular matrices by letting the subgroup `N(F)` of upper triangular
+unipotent matrices be in the kernels. Let `V(\chi)` with
+`\chi = \chi_{\mathbf{z}}` is defined to be the space of locally
+constant functions `f` on `G` such that:
 
-We have a representation :math:`\pi:G\to\hbox{End}(V(\chi))` by right translation:
-:math:`\pi(g)f(h)=f(h g)`. These are the *spherical principal series representations*.
-Let :math:`K=SL(n,\mathbb{Z}_q)`. This is the standard maximal compact subgroup. It has a
-homomorphism :math:`K\to SL(n,\mathbb{F}_q)` by reduction modulo :math:`q`. The subgroup :math:`J`
-of elements of :math:`K` whose images are upper triangular is an open subgroup, the
-*Iwahori subgroup*.
+.. MATH::
 
-Suppose that the :math:`z_i` are all distinct. Then for each :math:`w\in W` there exists
-an *intertwining integral* :math:`M_w:V(\chi)\to V({^w\chi})` where the Weyl group
-acts on characters of :math:`T(F)` by conjugation. This integral is defined by the
-formula
+    f(b g) = (\delta^{1/2}\chi)(b)f(g),\qquad b\in B(F).
 
-  :math:`M h(g)=\int_{N\cap w N_- w^{-1}} h(w^{-1}n g)\,d n`
+We have a representation `\pi: G \to \hbox{End}(V(\chi))` by right
+translation: `\pi(g)f(h) = f(h g)`. These are the *spherical principal
+series representations*. Let `K = SL(n,\mathbb{Z}_q)`. This is the
+standard maximal compact subgroup. It has a homomorphism
+`K \to SL(n,\mathbb{F}_q)` by reduction modulo `q`. The subgroup `J`
+of elements of `K` whose images are upper triangular is an open
+subgroup, the *Iwahori subgroup*.
 
-where :math:`N` is the group of upper triangular unipotent matrices and :math:`N_-` is the
-group of lower triangular matrices. The integral is convergent provided :math:`|z_i/z_{i+1}|<1`
-and in general it may be defined by analytic continuation in the :math:`z_i` or another method.
-See Casselman *loc. cit.*.
+Suppose that the `z_i` are all distinct. Then for each `w \in W` there
+exists an *intertwining integral* `M_w: V(\chi) \to V({^w\chi})` where
+the Weyl group acts on characters of `T(F)` by conjugation. This
+integral is defined by the formula
+
+.. MATH::
+
+    M h(g) = \int_{N \cap w N_- w^{-1}} h(w^{-1}n g) \, dn
+
+where `N` is the group of upper triangular unipotent matrices and
+`N_-` is the group of lower triangular matrices. The integral is
+convergent provided `|z_i/z_{i+1}|<1` and in general it may be defined
+by analytic continuation in the `z_i` or another method. See Casselman
+*loc. cit.*.
 
 The problem is how to model the intertwining operators in Sage.
 
-Let :math:`W=N(F)/T(\mathbb{Z}_q)` and :math:`W'=N(F)/T(F)`. These are isomorphic
-to the affine and finite Weyl groups, that is, the Weyl groups with
-Cartan types ``[`A`,n-1,1]`` and ``[`A`,n-1]``, respectively.
+Let `W = N(F) / T(\mathbb{Z}_q)` and `W' = N(F)/T(F)`. These are
+isomorphic to the affine and finite Weyl groups, that is, the Weyl
+groups with Cartan types ``[`A`,n-1,1]`` and ``[`A`,n-1]``,
+respectively.
 
-The *Iwahori Hecke algebra* :math:`\mathcal{H}` is the ring of compactly supported functions :math:`h`
-on :math:`G` such that :math:`h(k g k')=h(g)` when :math:`k,k'\in J`. It is a ring under convolution.
-:math:`V(\chi)` becomes a module over it by
+The *Iwahori Hecke algebra* `\mathcal{H}` is the ring of compactly
+supported functions `h` on `G` such that `h(k g k') = h(g)` when
+`k,k' \in J`. It is a ring under convolution. Then `V(\chi)` becomes a
+module over it by
 
-   :math:`(h f)(g)=\int_G h(x) f(g x)\, d x`.
+.. MATH::
 
-The subspace :math:`V(\chi)^J` of :math:`V(\chi)` consisting of elements that are fixed by
-:math:`J` is invariant under :math:`\mathcal{H}`. This module is finite-dimensional: in
-fact, its order is :math:`|W'|=n!`, whereas :math:`V(\chi)` itself is infinite dimensional.
-However the finite-dimensional :math:`\mathcal{H}`-module :math:`V(\chi)^J` accurately reflects the
-structure of the :math:`G`-module :math:`V(\chi)`. For example :math:`V(\chi)` is irreducible
-as a :math:`G`-module if and only if :math:`V(\chi)^J` is irreducible as an :math:`\mathcal{H}`-module.
+    (h f)(g) = \int_G h(x) f(g x) \, dx.
 
-Normalizing the Haar measure so that :math:`J` has volume :math:`1`, let :math:`T_w` be the
-characteristic function of :math:`J w J`, and if :math:`1 \le i \le r` let
-:math:`T_i` denote :math:`T_{\sigma_i}`. The :math:`T_w` with :math:`w \in W` form a
-basis, and the :math:`T_i` form a set of algebra generators The :math:`T_i` satisfy the
-same braid relations as the :math:`s_i`, but the relation :math:`\sigma_i^2 = 1` is
-replaced by :math:`T_i^2 = (q - 1) T_i + q`.
+The subspace `V(\chi)^J` of `V(\chi)` consisting of elements that are
+fixed by `J` is invariant under `\mathcal{H}`. This module is
+finite-dimensional: in fact, its order is `|W'|=n!`, whereas `V(\chi)`
+itself is infinite dimensional. However the finite-dimensional
+`\mathcal{H}`-module `V(\chi)^J` accurately reflects the structure of
+the `G`-module `V(\chi)`. For example `V(\chi)` is irreducible as a
+`G`-module if and only if `V(\chi)^J` is irreducible as an
+`\mathcal{H}`-module.
 
-The subalgebra elements of :math:`\mathcal{H}` consisting of functions that are
-supported in :math:`K` is the finite Iwahori Hecke algebra :math:`\mathcal{H}'`.  Thus
-:math:`\dim (H) = |W|` but :math:`\mathcal{H}` is infinite-dimensional The subalgebra :math:`H`
-has generators :math:`T_1, \cdots, T_r` but omits :math:`T_0`.
+Normalizing the Haar measure so that `J` has volume `1`, let `T_w` be
+the characteristic function of `J w J`, and if `1 \le i \le r` let
+`T_i` denote `T_{\sigma_i}`. The `T_w` with `w \in W` form a basis,
+and the `T_i` form a set of algebra generators The `T_i` satisfy the
+same braid relations as the `s_i`, but the relation `\sigma_i^2 = 1` is
+replaced by `T_i^2 = (q - 1) T_i + q`.
 
-We see that :math:`W`, :math:`W'`, :math:`\mathcal{H}` and :math:`\mathcal{H'}` are all objects that
-can be created in Sage.
+The subalgebra elements of `\mathcal{H}` consisting of functions that
+are supported in `K` is the finite Iwahori Hecke algebra
+`\mathcal{H}'`.  Thus `\dim (H) = |W|` but `\mathcal{H}` is
+infinite-dimensional The subalgebra `H` has generators
+`T_1, \dots, T_r` but omits `T_0`.
 
-We define a vector space isomorphism :math:`\alpha = \alpha (\chi) : V (\chi)^J
-\to H'` as follows. If :math:`F \in V (\chi)^J` then let :math:`\alpha (F) = f`
-where :math:`f` is the function :math:`f (g) = F (g^{- 1})` if :math:`g \in K`, 0 if :math:`g \notin K`.
-It may be checked that :math:`\alpha (F) \in H'`. This allows us to model the :math:`|W'|`-dimensional
-:math:`\mathcal{H}`-module :math:`V(\chi)` by the :math:`|W'|`-dimensional subalgebra :math:`\mathcal{H}'`.
-This idea, which appears in the paper of Rogawski cited above, is due to Joseph
-Bernstein.
+We see that `W`, `W'`, `\mathcal{H}` and `\mathcal{H'}` are all
+objects that can be created in Sage.
 
-Let :math:`w\in W` and define a map :math:`\mathcal{M}_w:H\to H` by requiring that
+We define a vector space isomorphism
+`\alpha = \alpha (\chi) : V (\chi)^J \to H'` as follows. If
+`F \in V (\chi)^J` then let `\alpha (F) = f` where `f` is the function
+`f (g) = F (g^{- 1})` if `g \in K`, 0 if `g \notin K`. It may be
+checked that `\alpha (F) \in H'`. This allows us to model the
+`|W'|`-dimensional `\mathcal{H}`-module `V(\chi)` by the
+`|W'|`-dimensional subalgebra `\mathcal{H}'`. This idea, which appears
+in the paper of Rogawski cited above, is due to Joseph Bernstein.
 
-   :math:`\alpha({^w\chi})\circ M_w = \mathcal{M}_w\circ\alpha(\chi)`
+Let `w \in W` and define a map `\mathcal{M}_w: H \to H` by requiring that
 
-as maps from :math:`V(\chi)^J\to H`. Since :math:`M_w` and :math:`\alpha(\chi)`,
-:math:`\alpha({^w\chi})` are all homomorphisms of left :math:`\mathcal{H}'`-modules,
-:math:`\mathcal{M}_w` is a homomorphism of left :math:`\mathcal{H}'` modules. Now let
-:math:`\mu_{\mathbf{z}}(w)= \mathcal{M}_w(1)` where :math:`1` denotes the identity element
-of :math:`\mathcal{H}'`.
+.. MATH::
 
-Because :math:`\mathcal{M}_w` is a :math:`\mathcal{H}'`-module homomorphism, we have
+    \alpha({^w\chi})\circ M_w = \mathcal{M}_w\circ\alpha(\chi)
 
-   :math:`\mathcal{M}_w(h) = \mathcal{M}_w(h\cdot 1)= h \mathcal{M}_w(1) = h\cdot\mu_{\mathbf{z}}(w)`.
+as maps from `V(\chi)^J \to H`. Since `M_w` and `\alpha(\chi)`,
+`\alpha({^w\chi})` are all homomorphisms of left `\mathcal{H}'`-modules,
+`\mathcal{M}_w` is a homomorphism of left `\mathcal{H}'` modules. Now
+let `\mu_{\mathbf{z}}(w) = \mathcal{M}_w(1)` where `1` denotes the
+identity element of `\mathcal{H}'`.
+
+Because `\mathcal{M}_w` is a `\mathcal{H}'`-module homomorphism, we have
+
+.. MATH::
+
+    \mathcal{M}_w(h)
+    =
+    \mathcal{M}_w(h\cdot 1)
+    =
+    h \mathcal{M}_w(1)
+    =
+    h\cdot\mu_{\mathbf{z}}(w).
 
 In other words, the intertwining operator is modeled by multiplication
-by :math:`\mu_{\mathbf{z}}(w)` when we identify :math:`V(\chi)^J` and :math:`V({^w\chi})^J` with
-:math:`H` by means of the homomorphisms :math:`\alpha`. We are therefore left with the
-problem of computing :math:`\mu_{\mathbf{z}}(w)`. If :math:`l(w_1w_2)=l(w_1)+l(w_2)`
-then :math:`M_{w_1w_2}=M_{w_1}M_{w_2}` and it follows that
+by `\mu_{\mathbf{z}}(w)` when we identify `V(\chi)^J` and
+`V({^w\chi})^J` with `H` by means of the homomorphisms `\alpha`. We
+are therefore left with the problem of computing
+`\mu_{\mathbf{z}}(w)`. If `l(w_1w_2) = l(w_1)+l(w_2)` then
+`M_{w_1w_2} = M_{w_1}M_{w_2}` and it follows that
 
-   :math:`\mu_{\mathbf{z}}(w_1w_2)=\mu_{\mathbf{z}}(w_2)\mu_{w_2\mathbf{z}}(w_1)`.
+.. MATH::
 
-(Here :math:`w_2` acts on the spectral parameters :math:`\mathbf{z}` in the
-obvious way.) Thus we are reduced to the determination of :math:`\mu_{\mathbf{z}}(w)`
-when :math:`w=s_i` is a simple reflection, and this is accomplished by Theorem 3.4
-in Casselman, *loc. cit.*:
+    \mu_{\mathbf{z}}(w_1w_2)
+    =
+    \mu_{\mathbf{z}}(w_2)\mu_{w_2\mathbf{z}}(w_1).
 
-   :math:`\mu_{\mathbf{z}}(s_i)=\frac{1}{q}T_i+\left(1-\frac{1}{q}\right)\frac{\mathbf{z}^{\alpha_i}}{1-\mathbf{z}^{\alpha_i}}.`
+(Here `w_2` acts on the spectral parameters `\mathbf{z}` in the
+obvious way.) Thus we are reduced to the determination of
+`\mu_{\mathbf{z}}(w)` when `w = s_i` is a simple reflection, and this
+is accomplished by Theorem 3.4 in Casselman, *loc. cit.*:
 
-Here the simple root :math:`\alpha_i=(0,\cdots,0,1,-1,0,\cdots,0)` in the ambient lattice,
-where the :math:`1` is in the :math:`i`-th position, so :math:`\mathbf{z}^\alpha_i=z_i/z_{i+1}`.
+.. MATH::
 
-In addition to the intertwining operators, let us construct a basis :math:`\psi_w` of
-:math:`V(\chi)^J` indexed by elements of :math:`W'`. Let
+    \mu_{\mathbf{z}}(s_i)
+    =
+    \frac{1}{q}T_i +
+    \left(1-\frac{1}{q}\right)
+    \frac{\mathbf{z}^{\alpha_i}}{1-\mathbf{z}^{\alpha_i}}.
 
-   :math:`\psi_w(b k)=\left\{\begin{array}{ll}\delta^{1/2}\chi(b) & \text{if $k\in J u^{-1} J$ with $u \ge w$},\\0&\text{otherwise,}\end{array}\right.`
+Here the simple root `\alpha_i = (0,\dots,0,1,-1,0,\dots,0)` in the
+ambient lattice, where the `1` is in the `i`-th position, so
+`\mathbf{z}^\alpha_i = z_i/z_{i+1}`.
 
-where :math:`b\in B(F)` and :math:`k\in K`. In order to make sense of this definition,
-bear in mind that every element of :math:`G` has a decomposition as a product :math:`b k` with
-:math:`b\in B(F)` and :math:`k\in K`, and every :math:`k\in K` belongs to a unique double coset
-:math:`J u^{-1} J` with :math:`u\in W'`.
+In addition to the intertwining operators, let us construct a basis
+`\psi_w` of `V(\chi)^J` indexed by elements of `W'`. Let
 
-The image of :math:`\psi_w` under the homomorphism :math:`\alpha` is just :math:`\sum_{u\ge w} T_u`,
-and by abuse of notation we will denote this element of :math:`\mathcal{H}'` also
-by :math:`\psi_w`. Now let us ask to evaluate :math:`m(u,v)=(\Lambda_v\psi_u)(1)`. It
-may be shown that :math:`m(u,v)=0` unless :math:`u\le v`, and that :math:`m(u,u)=1`. In other
-words, the "matrix" :math:`m` is upper triangular in the Bruhat order.
+.. MATH::
 
-Bump and Nakasuji used Sage to investigate this question and arrived at the
-following conjecture. This is conjectured for more general groups than just
-the :math:`SL(n)` that we are considering, but only for the simply-laced groups
-(types A,D,E). It follows from the Deodhar conjecture that the set
+    \psi_w(b k)
+    =
+    \begin{cases}
+    \delta^{1/2}\chi(b) & \text{if $k\in J u^{-1} J$ with $u \ge w$},\\
+    0 & \text{otherwise},
+    \end{cases}
 
-    :math:`S(u,v)=\{\alpha\in\Phi^+|u\le v r_\alpha < v\}`
+where `b\in B(F)` and `k \in K`. In order to make sense of this
+definition, bear in mind that every element of `G` has a decomposition
+as a product `b k` with `b \in B(F)` and `k \in K`, and every
+`k \in K` belongs to a unique double coset `J u^{-1} J` with `u \in W'`.
 
-has cardinality :math:`\ge l(v)-l(u)`, where :math:`l` is the length function on :math:`W'`.
-(Remember that :math:`r_\alpha` is the reflection in the positive root :math:`\alpha`.)
-If the Kazhdan-Lusztig polynomial :math:`P_{w_0v,w_0u}=1`, then
-:math:`|S(u,v)|=l(v)-l(u)`.
+The image of `\psi_w` under the homomorphism `\alpha` is just
+`\sum_{u \ge w} T_u`, and by abuse of notation we will denote this
+element of `\mathcal{H}'` also by `\psi_w`. Now let us ask to evaluate
+`m(u,v) = (\Lambda_v\psi_u)(1)`. It may be shown that `m(u,v) = 0`
+unless `u \le v`, and that `m(u,u) = 1`. In other words, the "matrix"
+`m` is upper triangular in the Bruhat order.
 
-**Conjecture** (Bump and Nakasuji) If the Kazhdan-Lusztig polynomial :math:`P_{w_0v,w_0u}=1` then
+Bump and Nakasuji used Sage to investigate this question and arrived
+at the following conjecture. This is conjectured for more general
+groups than just the `SL(n)` that we are considering, but only for the
+simply-laced groups (types A, D, E). It follows from the Deodhar
+conjecture that the set
 
-    :math:`m(u,v)=\prod_{\alpha\in S(u,v)}\frac{1-q^{-1}\mathbf{z}^\alpha}{1-\mathbf{z}^\alpha}`
+.. MATH::
 
-The following Sage code is capable of verifying this statement for ``['A',3]``, and of
-course can be adapted to any root system.
+    S(u,v) = \{\alpha \in \Phi^+|u \le v r_\alpha < v\}
 
-Intertwining Operator Program
+has cardinality `\ge l(v)-l(u)`, where `l` is the length function on
+`W'`. (Remember that `r_\alpha` is the reflection in the positive root
+`\alpha`.) If the Kazhdan-Lusztig polynomial `P_{w_0v,w_0u} = 1`, then
+`|S(u,v)| = l(v)-l(u)`.
+
+**Conjecture** (Bump and Nakasuji) If the Kazhdan-Lusztig polynomial
+`P_{w_0v,w_0u} = 1` then
+
+.. MATH::
+
+    m(u,v)
+    =
+    \prod_{\alpha \in S(u,v)}
+    \frac{1-q^{-1}\mathbf{z}^\alpha}{1-\mathbf{z}^\alpha}.
+
+The following Sage code is capable of verifying this statement for
+``['A',3]``, and of course can be adapted to any root system.
+
+
+Intertwining operator program
 -----------------------------
 
-This program can compute both the actual and conjectured values of :math:`m(u,v)`.
+This program can compute both the actual and conjectured values of
+`m(u,v)`.
 
 ::
 
    import copy
 
-   P1.<q>=PolynomialRing(QQ)
-   W = WeylGroup("A3",prefix="s")
-   KL = KazhdanLusztigPolynomial(W,q)
+   P1.<q> = PolynomialRing(QQ)
+   W = WeylGroup("A3", prefix="s")
+   KL = KazhdanLusztigPolynomial(W, q)
 
-   P.<q,z1,z2,z3,z4>=PolynomialRing(QQ)
+   P.<q,z1,z2,z3,z4> = PolynomialRing(QQ)
    F = Frac(P)
    H = IwahoriHeckeAlgebraT(W,q,base_ring=F)
-   [s1,s2,s3]=W.simple_reflections()
+   [s1,s2,s3] = W.simple_reflections()
    w0 = W.long_element()
-   [T1,T2,T3]=H.algebra_generators()
+   [T1,T2,T3] = H.algebra_generators()
 
    def mu(z,s):
        """
diff --git a/doc/en/thematic_tutorials/lie/kazhdan_lusztig_polynomials.rst b/doc/en/thematic_tutorials/lie/kazhdan_lusztig_polynomials.rst
--- a/doc/en/thematic_tutorials/lie/kazhdan_lusztig_polynomials.rst
+++ b/doc/en/thematic_tutorials/lie/kazhdan_lusztig_polynomials.rst
@@ -1,14 +1,14 @@
-----------------------------
+---------------------------
 Kazhdan-Lusztig Polynomials
-----------------------------
+---------------------------
 
 Sage can compute ordinary Kazhdan-Lusztig polynomials for Weyl groups
 or affine Weyl groups (and potentially other Coxeter groups).
 
-You must create a Weyl group W and a ring containing an indeterminate ``q``.
-The ring may be a univariate polynomial ring or a univariate Laurent
-polynomial ring. Then you may calculate Kazhdan-Lusztig polynomials
-as follows::
+You must create a Weyl group ``W`` and a ring containing an
+indeterminate ``q``. The ring may be a univariate polynomial ring or a
+univariate Laurent polynomial ring. Then you may calculate
+Kazhdan-Lusztig polynomials as follows::
 
     sage: W = WeylGroup("A3", prefix="s")
     sage: [s1,s2,s3] = W.simple_reflections()
@@ -21,27 +21,26 @@
 
 Thus we have the Kazhdan-Lusztig R and P polynomials.
 
-Known algorithms for computing Kazhdan-Lusztig polynomials
-are highly recursive, and caching of intermediate results
-is necessary for the programs not to be prohibitively slow.
-Therefore intermediate results are cached. This has the effect that
-as you run the program for any given KazhdanLusztigPolynomial
-class, the calculations will be slow at first but progressively
-faster as more polynomials are computed.
+Known algorithms for computing Kazhdan-Lusztig polynomials are highly
+recursive, and caching of intermediate results is necessary for the
+programs not to be prohibitively slow. Therefore intermediate results
+are cached. This has the effect that as you run the program for any
+given ``KazhdanLusztigPolynomial`` class, the calculations will be
+slow at first but progressively faster as more polynomials are
+computed.
 
-You may see the results of the intermediate calculations
-by creating the class with the option ``trace="true"``.
+You may see the results of the intermediate calculations by creating
+the class with the option ``trace="true"``.
 
-Since the parent of ``q`` must be a univariate ring, if you want
-to work with other indeterminates, *first* create a univariate
-polynomial or Laurent polynomial ring, and the Kazhdan-Lusztig
-class. *Then* create a ring containing ``q`` and the other
-variables::
+Since the parent of ``q`` must be a univariate ring, if you want to
+work with other indeterminates, *first* create a univariate polynomial
+or Laurent polynomial ring, and the Kazhdan-Lusztig class. *Then*
+create a ring containing ``q`` and the other variables::
 
     sage: W = WeylGroup("B3", prefix="s")
     sage: [s1,s2,s3] = W.simple_reflections()
-    sage: P.<q>=PolynomialRing(QQ)
+    sage: P.<q> = PolynomialRing(QQ)
     sage: KL = KazhdanLusztigPolynomial(W,q)
-    sage: P1.<x,y>=PolynomialRing(P)
+    sage: P1.<x,y> = PolynomialRing(P)
     sage: x*KL.P(s1*s3,s1*s3*s2*s1*s3)
     (q + 1)*x
diff --git a/doc/en/thematic_tutorials/lie/lie_basics.rst b/doc/en/thematic_tutorials/lie/lie_basics.rst
--- a/doc/en/thematic_tutorials/lie/lie_basics.rst
+++ b/doc/en/thematic_tutorials/lie/lie_basics.rst
@@ -1,140 +1,187 @@
---------------------------------
+----------------
 Lie Group Basics
---------------------------------
+----------------
 
-Goals of this Section
---------------------------------
 
-Since we must be brief here, this is not really a place to learn
-about Lie groups. Rather, the point of this section is to outline
-what you need to know to use Sage effectively for Lie computations,
-and to fix ideas and notations.
+Goals of this section
+---------------------
 
-Semisimple and Reductive Groups
---------------------------------
+Since we must be brief here, this is not really a place to learn about
+Lie groups. Rather, the point of this section is to outline what you
+need to know to use Sage effectively for Lie computations, and to fix
+ideas and notations.
 
-If :math:`g\in GL(n,\mathbb{C})`, then g may be uniquely factored as
-:math:`g_1 g_2` where :math:`g_1` and :math:`g_2` commute, with :math:`g_1`
-semisimple (diagonalizable) and :math:`g_2` unipotent (all its eigenvalues
-equal to 1). This follows from the Jordan canonical form. If :math:`g=g_1` then
-:math:`g` is called *semisimple* and if :math:`g=g_2` then :math:`g` is
-called *unipotent*.
 
-We consider a Lie group :math:`G` and a class of representations such that if
-an element :math:`g\in G` is unipotent (resp. semisimple) in one faithful
-representation from the class, then it is unipotent (resp. semisimple) in
-every faithful representation of the class. Thus the notion of being
-semisimple or unipotent is intrinsic. Examples:
+Semisimple and reductive groups
+-------------------------------
+
+If `g \in GL(n,\mathbb{C})`, then `g` may be uniquely factored as
+`g_1 g_2` where `g_1` and `g_2` commute, with `g_1` semisimple
+(diagonalizable) and `g_2` unipotent (all its eigenvalues equal to
+1). This follows from the Jordan canonical form. If `g = g_1` then `g`
+is called *semisimple* and if `g = g_2` then `g` is called
+*unipotent*.
+
+We consider a Lie group `G` and a class of representations such that
+if an element `g \in G` is unipotent (resp. semisimple) in one
+faithful representation from the class, then it is unipotent
+(resp. semisimple) in every faithful representation of the class. Thus
+the notion of being semisimple or unipotent is intrinsic. Examples:
 
 - Compact Lie groups with continuous representations
 
 - Complex analytic groups with analytic representations
 
-- Algebraic groups over :math:`\mathbb{R}` with algebraic representations.
+- Algebraic groups over `\mathbb{R}` with algebraic representations.
 
-A subgroup of :math:`G` is called *unipotent* if it is connected and all its
-elements are unipotent. It is called a *torus* if it is connected, abelian,
-and all its elements are semisimple. The group :math:`G` is called *reductive*
-if it has no nontrivial normal unipotent subgroup. For example,
-:math:`GL(2,\mathbb{C})` is reductive, but its subgroup:
+A subgroup of `G` is called *unipotent* if it is connected and all its
+elements are unipotent. It is called a *torus* if it is connected,
+abelian, and all its elements are semisimple. The group `G` is called
+*reductive* if it has no nontrivial normal unipotent subgroup. For
+example, `GL(2,\mathbb{C})` is reductive, but its subgroup:
 
-  :math:`\left\{\left(\begin{array}{cc} a & b\\ & d\end{array}\right)\right\}`
+.. MATH::
+
+    \left\{\left(
+    \begin{array}{cc}
+    a & b \\
+    & d
+    \end{array}
+    \right)\right\}
 
 is not since it has a normal unipotent subgroup
 
-  :math:`\left\{\left(\begin{array}{cc} 1 & b\\ & 1\end{array}\right)\right\}.`
+.. MATH::
+
+    \left\{\left(
+    \begin{array}{cc}
+    1 & b \\
+    & 1
+    \end{array}
+    \right)\right\}.
 
 A group has a unique largest normal unipotent subgroup, called the
 *unipotent radical*, so it is reductive if and only if the unipotent
 radical is trivial.
 
-A Lie group is called *semisimple* it is reductive and furthermore has no
-nontrivial normal tori. For example :math:`GL(2,\mathbb{C})` is reductive but
-not semisimple because it has a normal torus:
+A Lie group is called *semisimple* it is reductive and furthermore has
+no nontrivial normal tori. For example `GL(2,\mathbb{C})` is reductive
+but not semisimple because it has a normal torus:
 
-  :math:`\left\{\left(\begin{array}{cc} a \\ & a\end{array}\right)\right\}.`
+.. MATH::
 
-The group :math:`SL(2,\mathbb{C})` is semisimple.
+    \left\{\left(
+    \begin{array}{cc}
+    a \\
+    & a
+    \end{array}
+    \right)\right\}.
 
-Fundamental Group and Center
+The group `SL(2,\mathbb{C})` is semisimple.
+
+
+Fundamental group and center
 ----------------------------
 
-If :math:`G` is a semisimple Lie group then its center and fundamental group
-are finite abelian groups. The universal covering group :math:`\tilde G` is
-therefore a finite extension with the same Lie algebra. Any representation of
-:math:`G` may be reinterpreted as a representation of the simply connected
-:math:`\tilde G`. Therefore we may as well consider representations of
-:math:`\tilde G`, and restrict ourselves to the simply connected group.
+If `G` is a semisimple Lie group then its center and fundamental group
+are finite abelian groups. The universal covering group `\tilde G` is
+therefore a finite extension with the same Lie algebra. Any
+representation of `G` may be reinterpreted as a representation of the
+simply connected `\tilde G`. Therefore we may as well consider
+representations of `\tilde G`, and restrict ourselves to the simply
+connected group.
+
 
 Parabolic subgroups and Levi subgroups
 --------------------------------------
 
-Let :math:`G` be a reductive complex analytic group. A maximal solvable
-subgroup of :math:`G` is called a *Borel subgroup*. All Borel subgroups are
-conjugate. Any subgroup :math:`P` containing a Borel subgroup is called a
-*parabolic subgroup*.  We may write :math:`P` as a semidirect product of its
-maximal normal unipotent subgroup or *unipotent radical* :math:`P` and a
-reductive subgroup :math:`M`, which is determined up to conjugacy. The
-subgroup :math:`M` is called a *Levi subgroup*.
+Let `G` be a reductive complex analytic group. A maximal solvable
+subgroup of `G` is called a *Borel subgroup*. All Borel subgroups are
+conjugate. Any subgroup `P` containing a Borel subgroup is called a
+*parabolic subgroup*.  We may write `P` as a semidirect product of its
+maximal normal unipotent subgroup or *unipotent radical* `P` and a
+reductive subgroup `M`, which is determined up to conjugacy. The
+subgroup `M` is called a *Levi subgroup*.
 
-**Example:** Let :math:`G=GL_n(\mathbb{C})` and let :math:`r_1,\cdots, r_k` be integers
-whose sum is :math:`n`. Then we may consider matrices of the form:
+**Example:** Let `G = GL_n(\mathbb{C})` and let `r_1, \dots, r_k` be
+integers whose sum is `n`. Then we may consider matrices of the form:
 
-:math:`\left(\begin{array}{cccc}g_1 & * & \cdots & * \\ & g_2 & & *\\ &&\ddots\\&&& g_r\end{array}\right)`,
+.. MATH::
 
-where :math:`g_i\in GL(r_i,\mathbb{C}`. The unipotent radical consists of the subgroup in
-which all :math:`g_i=I_{r_i}`. The Levi subgroup (determined up to conjugacy) is:
+    \left(\begin{array}{cccc}
+    g_1 & * & \cdots & * \\
+    & g_2 & & * \\
+    && \ddots \\
+    &&& g_r
+    \end{array}\right)
 
-:math:`M=\left\{\left(\begin{array}{cccc}g_1  \\ & g_2\\ &&\ddots\\&&& g_r\end{array}\right)\right\}`,
+where `g_i \in GL(r_i,\mathbb{C}`. The unipotent radical consists of
+the subgroup in which all `g_i = I_{r_i}`. The Levi subgroup
+(determined up to conjugacy) is:
 
-and is isomorphic to :math:`M=GL(r_1,\mathbb{C})\times\cdots\times GL(r_k,\mathbb{C})`. Therefore :math:`M`
-is a Levi subgroup.
+.. MATH::
 
-The notion of a Levi subgroup can be extended to compact Lie groups. Thus
-:math:`U(r_1)\times\cdots\times U(r_k)` is a Levi subgroup of :math:`U(n)`. However
-Parabolic subgroups do not exist for compact Lie groups.
+    M
+    =
+    \left\{\left(
+    \begin{array}{cccc}
+    g_1  \\
+    & g_2 \\
+    && \ddots \\
+    &&& g_r
+    \end{array}
+    \right)\right\},
 
-Cartan Types
+and is isomorphic to
+`M = GL(r_1,\mathbb{C}) \times \cdots \times GL(r_k,\mathbb{C})`.
+Therefore `M` is a Levi subgroup.
+
+The notion of a Levi subgroup can be extended to compact Lie
+groups. Thus `U(r_1) \times \cdots \times U(r_k)` is a Levi subgroup
+of `U(n)`. However Parabolic subgroups do not exist for compact Lie
+groups.
+
+
+Cartan types
 ------------
 
 Semisimple Lie groups are classified by their *Cartan types*. There
-are both reducible and irreducible Cartan types in Sage. Let us
-start with the irreducible types. Such a type is
-implemented in Sage as a pair ``[`X`,r]`` where X is one of
-A, B, C, D, E, F or G and :math:`r` is a positive integer.
-If X=D then we must have :math:`r>1` and if X is one of the
-*exceptional types* `E`, `F` or `G` then :math:`r` is limited to only
-a few possibilities. The exceptional types are::
+are both reducible and irreducible Cartan types in Sage. Let us start
+with the irreducible types. Such a type is implemented in Sage as a
+pair ``[`X`,r]`` where `X` is one of A, B, C, D, E, F or G and `r` is a
+positive integer. If `X = D` then we must have `r > 1` and if `X` is
+one of the *exceptional types* `E`, `F` or `G` then `r` is limited to
+only a few possibilities. The exceptional types are::
 
     ['G',2],  ['F',4],  ['E',6], ['E',7] or ['E',8].
 
-A simply-connected semisimple group is a direct product of simple Lie groups,
-which are given by the following table. The integer :math:`r` is called the
-*rank*, and is the dimension of the maximal torus.
+A simply-connected semisimple group is a direct product of simple Lie
+groups, which are given by the following table. The integer `r` is
+called the *rank*, and is the dimension of the maximal torus.
 
 Here are the Lie groups corresponding to the classical types:
 
-+--------------------+-------------------------------+--------------------+
-| compact group      | complex analytic group        | Cartan type        |
-+====================+===============================+====================+
-| :math:`SU(r+1)`    | :math:`SL(r+1,\mathbb{C})`    | :math:`A_r`        |
-+--------------------+-------------------------------+--------------------+
-| :math:`spin(2r+1)` | :math:`spin(2r+1,\mathbb{C})` | :math:`B_r`        |
-+--------------------+-------------------------------+--------------------+
-| :math:`Sp(2r)`     | :math:`Sp(2r,\mathbb{C})`     | :math:`C_r`        |
-+--------------------+-------------------------------+--------------------+
-| :math:`spin(2r)`   | :math:`spin(2r,\mathbb{C})`   | :math:`D_r`        |
-+--------------------+-------------------------------+--------------------+
++---------------+-------------------------+-------------+
+| compact group | complex analytic group  | Cartan type |
++===============+=========================+=============+
+| `SU(r+1)`     | `SL(r+1,\mathbb{C})`    | `A_r`       |
++---------------+-------------------------+-------------+
+| `spin(2r+1)`  | `spin(2r+1,\mathbb{C})` | `B_r`       |
++---------------+-------------------------+-------------+
+| `Sp(2r)`      | `Sp(2r,\mathbb{C})`     | `C_r`       |
++---------------+-------------------------+-------------+
+| `spin(2r)`    | `spin(2r,\mathbb{C})`   | `D_r`       |
++---------------+-------------------------+-------------+
 
 You may create these Cartan types and their Dynkin diagrams as follows::
 
-
     sage: ct = CartanType("D5"); ct
     ['D', 5]
 
 Here ``"D5"`` is an abbreviation for ``['D',5]``.
 
-Dual Cartan Types
+
+Dual Cartan types
 ------------------
 
 Every Cartan type has a dual, which you can get from within Sage::
@@ -142,10 +189,10 @@
     sage: CartanType("B4").dual()
     ['C', 4]
 
-Types other than ``B`` and ``C`` are self-dual in the sense that
-the dual is isomorphic to the original type, but the isomorphism
-of a Cartan type with its dual might relabel the vertices. We can
-see this as follows::
+Types other than ``B`` and ``C`` are self-dual in the sense that the
+dual is isomorphic to the original type, but the isomorphism of a
+Cartan type with its dual might relabel the vertices. We can see this
+as follows::
 
     sage: CartanType("F4").dynkin_diagram()
     O---O=>=O---O
@@ -158,14 +205,16 @@
     1   2   3   4
     F4*
 
-Reducible Cartan Types
+
+Reducible Cartan types
 ----------------------
 
-If :math:`G` is a Lie group of finite index in :math:`G_1\times G_2`, where :math:`G_1` and
-:math:`G_2` are Lie groups of dimension :math:`>0`, then :math:`G` is called *reducible*. In
-this case, the root system of :math:`G` is the disjoint union of the root systems of
-:math:`G_1` and :math:`G_2`, which lie in orthogonal subspaces of the ambient space of the
-weight space of :math:`G`. The Cartan type of :math:`G` is thus *reducible*.
+If `G` is a Lie group of finite index in `G_1 \times G_2`, where `G_1`
+and `G_2` are Lie groups of dimension `>0`, then `G` is called
+*reducible*. In this case, the root system of `G` is the disjoint
+union of the root systems of `G_1` and `G_2`, which lie in orthogonal
+subspaces of the ambient space of the weight space of `G`. The Cartan
+type of `G` is thus *reducible*.
 
 Reducible Cartan types are supported in Sage as follows::
 
@@ -174,34 +223,36 @@
     sage: WeylCharacterRing("A1xA1")
     The Weyl Character Ring of Type A1xA1 with Integer Ring coefficients
 
+
 Low dimensional Cartan types
---------------------------------------
+----------------------------
 
 There are some isomorphisms that occur in low degree.
 
-+-------------+------------------+-----------------+---------------------------+
-| Cartan Type | Group            | Equivalent Type | Isomorphic Group          |
-+=============+==================+=================+===========================+
-| B2          | :math:`spin(5)`  | C2              | :math:`Sp(4)`             |
-+-------------+------------------+-----------------+---------------------------+
-| D3          | :math:`spin(6)`  | A3              | :math:`SL(4)`             |
-+-------------+------------------+-----------------+---------------------------+
-| D2          | :math:`spin(4)`  | A1xA1           | :math:`SL(2)\times SL(2)` |
-+-------------+------------------+-----------------+---------------------------+
-| B1          | :math:`spin(3)`  | A1              | :math:`SL(2)`             |
-+-------------+------------------+-----------------+---------------------------+
-| C1          | :math:`Sp(2)`    | A1              | :math:`SL(2)`             |
-+-------------+------------------+-----------------+---------------------------+
++-------------+------------+-----------------+---------------------+
+| Cartan Type | Group      | Equivalent Type | Isomorphic Group    |
++=============+============+=================+=====================+
+| B2          | `spin(5)`  | C2              | `Sp(4)`             |
++-------------+------------+-----------------+---------------------+
+| D3          | `spin(6)`  | A3              | `SL(4)`             |
++-------------+------------+-----------------+---------------------+
+| D2          | `spin(4)`  | A1xA1           | `SL(2)\times SL(2)` |
++-------------+------------+-----------------+---------------------+
+| B1          | `spin(3)`  | A1              | `SL(2)`             |
++-------------+------------+-----------------+---------------------+
+| C1          | `Sp(2)`    | A1              | `SL(2)`             |
++-------------+------------+-----------------+---------------------+
 
 Sometimes the redundant Cartan types such as D3 and D2 are excluded
 from the list of Cartan types. Folks will tell there's no such Cartan
-types. However Sage allows them since excluding them leads to exceptions
-having to be made in algorithms. A better approach, which is followed by Sage,
-is to allow the redundant Cartan types, but to implement the isomorphisms
-explicitly as special cases of branching rules. The utility of this
-approach may be seen by considering that the rank one group :math:`SL(2)`
-has different natural weight lattices realizations depending on
-whether we consider it to be :math:`SL(2)`, :math:`spin(2)` or :math:`Sp(2)`::
+types. However Sage allows them since excluding them leads to
+exceptions having to be made in algorithms. A better approach, which
+is followed by Sage, is to allow the redundant Cartan types, but to
+implement the isomorphisms explicitly as special cases of branching
+rules. The utility of this approach may be seen by considering that
+the rank one group `SL(2)` has different natural weight lattices
+realizations depending on whether we consider it to be `SL(2)`,
+`spin(2)` or `Sp(2)`::
 
     sage: RootSystem("A1").ambient_space().simple_roots()
     Finite family {1: (1, -1)}
@@ -210,20 +261,21 @@
     sage: RootSystem("C1").ambient_space().simple_roots()
     Finite family {1: (2)}
 
+
 Affine Cartan types
---------------------------------
+-------------------
 
 There are also affine Cartan types, which correspond to (infinite)
 affine Lie algebras. There is an affine Cartan type of the of the
 form ``[`X`,r,1]`` if ``X=A,B,C,D,E,F,G`` and ``[`X`,r]`` is an ordinary
 Cartan type. There are also *twisted affine types* of the form ``[X,r,k]``
-where :math:`k=2` or 3 if the Dynkin diagram of the ordinary Cartan
-type ``[X,r]`` has an automorphism of degree :math:`k`.
+where `k = 2` or 3 if the Dynkin diagram of the ordinary Cartan type
+``[X,r]`` has an automorphism of degree `k`.
 
 Illustrating some of the methods available for the untwisted affine
 Cartan type ``['A',4,1]``::
 
-    sage: ct=CartanType(['A',4,1]); ct
+    sage: ct = CartanType(['A',4,1]); ct
     ['A', 4, 1]
     sage: ct.dual()
     ['A', 4, 1]
@@ -247,19 +299,18 @@
     ['G', 2, 1]^* relabelled by {0: 0, 1: 2, 2: 1}
 
 
-Relabeled Cartan Types
------------------------
+Relabeled Cartan types
+----------------------
 
-By default Sage uses the labeling of the Dynkin Diagram from
-Bourbaki, *Lie Groups and Lie Algebras* Chapters 4,5,6.
-There is another labeling of the vertices due to Dynkin. Most of
-the literature follows Bourbaki, though Kac's book *Infinite
-Dimensional Lie algebras* follows Dynkin.
+By default Sage uses the labeling of the Dynkin Diagram from Bourbaki,
+*Lie Groups and Lie Algebras* Chapters 4,5,6. There is another
+labeling of the vertices due to Dynkin. Most of the literature follows
+Bourbaki, though Kac's book *Infinite Dimensional Lie algebras*
+follows Dynkin.
 
-If you need to use Dynkin's labeling you should be aware
-that Sage does support relabeled Cartan types. See the
-documentation in sage.combinat.root_system.type_relabel
-for further information.
+If you need to use Dynkin's labeling you should be aware that Sage
+does support relabeled Cartan types. See the documentation in
+``sage.combinat.root_system.type_relabel`` for further information.
 
 
 .. _standard-realizations:
@@ -270,13 +321,14 @@
 These realizations follow the Appendix in Bourbaki, *Lie Groups
 and Lie Algebras, Chapters 4-6*.
 
+
 Type A
 ^^^^^^
 
-For type :math:`A_r` we use an :math:`r+1` dimensional ambient space. This means that
-we are modeling the Lie group :math:`U(r+1)` or :math:`GL(r+1,\mathbb{C})` rather
-than :math:`SU(r+1)` or :math:`SL(r+1,\mathbb{C})`. The ambient space is identified
-with :math:`\mathbb{Q}^{r+1}`::
+For type `A_r` we use an `r+1` dimensional ambient space. This means
+that we are modeling the Lie group `U(r+1)` or `GL(r+1,\mathbb{C})`
+rather than `SU(r+1)` or `SL(r+1,\mathbb{C})`. The ambient space is
+identified with `\mathbb{Q}^{r+1}`::
 
    sage: RootSystem("A3").ambient_space().simple_roots()
    Finite family {1: (1, -1, 0, 0), 2: (0, 1, -1, 0), 3: (0, 0, 1, -1)}
@@ -285,17 +337,17 @@
    sage: RootSystem("A3").ambient_space().rho()
    (3, 2, 1, 0)
 
-The dominant weights consist of integer :math:`r+1`-tuples
-:math:`\lambda=(\lambda_1,\cdots,\lambda_{r+1})` such that
-:math:`\lambda_1\ge\cdots\ge\lambda_{r+1}`.
+The dominant weights consist of integer `r+1`-tuples
+`\lambda = (\lambda_1,\dots,\lambda_{r+1})` such that
+`\lambda_1 \ge \dots \ge \lambda_{r+1}`.
 
 See :ref:`SLvsGL` for further remarks about Type A.
 
 
 Type B
 ^^^^^^
-For the remaining classical Cartan types :math:`B_r`, :math:`C_r` and :math:`D_r` we use an :math:`r`-dimensional
-ambient space::
+For the remaining classical Cartan types `B_r`, `C_r` and `D_r` we use
+an `r`-dimensional ambient space::
 
    sage: RootSystem("B3").ambient_space().simple_roots()
    Finite family {1: (1, -1, 0), 2: (0, 1, -1), 3: (0, 0, 1)}
@@ -304,15 +356,18 @@
    sage: RootSystem("B3").ambient_space().rho()
    (5/2, 3/2, 1/2)
 
-This is the Cartan type of :math:`spin(2r+1)`. The last fundamental weight ``(1/2,
-1/2, ... , 1/2)`` is the highest weight of the :math:`2^r` dimensional *spin
-representation*. All the other fundamental representations factor through the
-homomorphism :math:`spin(2r+1)\to SO(2r+1)` and are representations of the
-orthogonal group.
+This is the Cartan type of `spin(2r+1)`. The last fundamental weight
+``(1/2, 1/2, ... , 1/2)`` is the highest weight of the `2^r`
+dimensional *spin representation*. All the other fundamental
+representations factor through the homomorphism
+`spin(2r+1) \to SO(2r+1)` and are representations of the orthogonal
+group.
 
-The dominant weights consist of :math:`r`-tuples of integers or half-integers
-:math:`(\lambda_1,\cdots,\lambda_r)` such that :math:`\lambda_1\ge\lambda_2\cdots\ge\lambda_r\ge0`,
-and such that the differences :math:`\lambda_i-\lambda_j\in\mathbb{Z}`.
+The dominant weights consist of `r`-tuples of integers or
+half-integers `(\lambda_1,\dots,\lambda_r)` such that
+`\lambda_1 \ge \lambda_2 \dots \ge \lambda_r \ge 0`, and such that the
+differences `\lambda_i - \lambda_j \in \mathbb{Z}`.
+
 
 Type C
 ^^^^^^
@@ -325,11 +380,12 @@
    sage: RootSystem("C3").ambient_space().rho()
    (3, 2, 1)
 
-This is the Cartan type of the symplectic group :math:`Sp(2r)`.
+This is the Cartan type of the symplectic group `Sp(2r)`.
 
-The dominant weights consist of :math:`r`-tuples of integers
-:math:`\lambda=(\lambda_1,\cdots,\lambda_{r+1})` such that
-:math:`\lambda_1\ge\cdots\ge\lambda_r\ge 0`.
+The dominant weights consist of `r`-tuples of integers
+`\lambda = (\lambda_1,\dots,\lambda_{r+1})` such that
+`\lambda_1 \ge \cdots \ge \lambda_r \ge 0`.
+
 
 Type D
 ^^^^^^
@@ -342,125 +398,145 @@
    sage: RootSystem("D4").ambient_space().rho()
    (3, 2, 1, 0)
 
-This is the Cartan type of :math:`spin(2r)`.  The last two fundamental weights are
-the highest weights of the two :math:`2^{r-1}`-dimensional spin
+This is the Cartan type of `spin(2r)`.  The last two fundamental
+weights are the highest weights of the two `2^{r-1}`-dimensional spin
 representations.
 
-The dominant weights consist of :math:`r`-tuples of integers
-:math:`\lambda=(\lambda_1,\cdots,\lambda_{r+1})` such that
-:math:`\lambda_1\ge\cdots\ge\lambda_{r-1}\ge |\lambda_r|`.
+The dominant weights consist of `r`-tuples of integers
+`\lambda = (\lambda_1,\dots,\lambda_{r+1})` such that
+`\lambda_1 \ge \cdots \ge \lambda_{r-1} \ge |\lambda_r|`.
 
 We leave the reader to examine the exceptional types. You can use
 Sage to list the fundamental dominant weights and simple roots.
 
 
 Weights and the ambient space
---------------------------------------
+-----------------------------
 
-Let :math:`G` be a reductive complex analytic group. Let :math:`T` be a
-maximal torus, :math:`\Lambda = X^{\ast} (T)` be its group of analytic
-characters. Then :math:`T \cong (\mathbb{C}^{\times})^r` for some :math:`r`
-and :math:`\Lambda \cong \mathbb{Z}^r`.
+Let `G` be a reductive complex analytic group. Let `T` be a maximal
+torus, `\Lambda = X^{\ast} (T)` be its group of analytic
+characters. Then `T \cong (\mathbb{C}^{\times})^r` for some `r` and
+`\Lambda \cong \mathbb{Z}^r`.
 
-**Example 1:** Let :math:`G = \hbox{GL}_{r+1} (\mathbb{C})`. Then :math:`T` is
-the diagonal subgroup and :math:`X^{\ast} (T) \cong \mathbb{Z}^{r+1}`. If :math:`\lambda =
-(\lambda_1, \cdots, \lambda_n)` then :math:`\lambda` is identified with the rational
-character
-:math:`{\bf t}= \left(\begin{array}{ccc} t_1 &  & \\ & \ddots & \\  &  & t_n \end{array}\right) \longmapsto \prod t_i^{\lambda_i}.`
+**Example 1:** Let `G = \hbox{GL}_{r+1} (\mathbb{C})`. Then `T` is the
+diagonal subgroup and `X^{\ast} (T) \cong \mathbb{Z}^{r+1}`. If
+`\lambda = (\lambda_1, \dots, \lambda_n)` then `\lambda` is identified
+with the rational character
 
-**Example 2:** Let :math:`G = \hbox{SL}_{r+1} (\mathbb{C})`. Again :math:`T` is
+.. MATH::
+
+    {\bf t}
+    =
+    \left(\begin{array}{ccc}
+    t_1 &  & \\
+    & \ddots & \\
+    &  & t_n
+    \end{array}\right)
+    \longmapsto \prod t_i^{\lambda_i}.
+
+**Example 2:** Let `G = \hbox{SL}_{r+1} (\mathbb{C})`. Again `T` is
 the diagonal subgroup but now if
-:math:`\lambda \in \mathbb{Z}^{\Delta} =\{(d, \cdots, d) | d \in \mathbb{Z}\} \subseteq \mathbb{Z}^{r+1}`
-then :math:`\prod t_i^{\lambda_i} = \det ({\bf t})^d = 1`, so :math:`X^{\ast} (T)
-\cong \mathbb{Z}^{r+1} /\mathbb{Z}^{\Delta} \cong \mathbb{Z}^r`.
+`\lambda \in \mathbb{Z}^{\Delta} = \{(d, \cdots, d) | d \in \mathbb{Z}\} \subseteq \mathbb{Z}^{r+1}`
+then `\prod t_i^{\lambda_i} = \det ({\bf t})^d = 1`, so
+`X^{\ast} (T) \cong \mathbb{Z}^{r+1} /\mathbb{Z}^{\Delta} \cong \mathbb{Z}^r`.
 
-- Elements of :math:`\Lambda` are called *weights*.
+- Elements of `\Lambda` are called *weights*.
 
-- If :math:`\pi:G\to GL(V)` is any representation we may restrict :math:`\pi` to :math:`T`. Then the characters of :math:`T` that occur in this restriction are called the *weights of* :math:`\pi`.
+- If `\pi: G \to GL(V)` is any representation we may restrict `\pi` to
+  `T`. Then the characters of `T` that occur in this restriction are
+  called the *weights of* `\pi`.
 
-- :math:`G` acts on its Lie algebra by conjugation (the *adjoint representation*).
+- `G` acts on its Lie algebra by conjugation (the *adjoint representation*).
 
 - The nonzero weights of the adjoint representation are called *roots*.
 
-- The *ambient space* of :math:`\Lambda` is :math:`\mathbb{Q}\otimes\Lambda`.
+- The *ambient space* of `\Lambda` is `\mathbb{Q} \otimes \Lambda`.
 
-The Root System
+
+The root system
 ---------------
 
 As we have mentioned, `G` acts on its complexified Lie algebra
-:math:`\mathfrak{g}_{\mathbb{C}}` by the adjoint representation. The zero weight space
-:math:`\mathfrak{g}_{\mathbb{C}}(0)` is just the Lie algebra of :math:`T` itself. The other
-nonzero weights each appear with multiplicity one and form an interesting
-configuration of vectors called the *root system* :math:`\Phi`.
+`\mathfrak{g}_{\mathbb{C}}` by the adjoint representation. The zero
+weight space `\mathfrak{g}_{\mathbb{C}}(0)` is just the Lie algebra of
+`T` itself. The other nonzero weights each appear with multiplicity
+one and form an interesting configuration of vectors called the
+*root system* `\Phi`.
 
-It is convenient to partition :math:`\Phi` into two sets :math:`\Phi^+` and
-:math:`\Phi^-` such that :math:`\Phi^+` consists of all roots lying on one
-side of a hyperplane. Often we arrange things so that :math:`G` is embedded in
-:math:`GL(n,\mathbb{C})` in such a way that the positive weights correspond to upper
-triangular matrices. Thus if :math:`\alpha` is a positive root, its weight space
-:math:`\mathfrak{g}_{\mathbb{C}}(\alpha)` is spanned by a vector :math:`X_\alpha`, and the
-exponential of this eigenspace in :math:`G` is a one-parameter subgroup of unipotent
-matrices. It is always possible to arrange that this one-parameter subgroup
-consists of upper triangular matrices.
+It is convenient to partition `\Phi` into two sets `\Phi^+` and
+`\Phi^-` such that `\Phi^+` consists of all roots lying on one side of
+a hyperplane. Often we arrange things so that `G` is embedded in
+`GL(n,\mathbb{C})` in such a way that the positive weights correspond
+to upper triangular matrices. Thus if `\alpha` is a positive root, its
+weight space `\mathfrak{g}_{\mathbb{C}}(\alpha)` is spanned by a
+vector `X_\alpha`, and the exponential of this eigenspace in `G` is a
+one-parameter subgroup of unipotent matrices. It is always possible to
+arrange that this one-parameter subgroup consists of upper triangular
+matrices.
 
-If :math:`\alpha` is a positive root that cannot be decomposed as a sum of other
-positive roots, then :math:`\alpha` is called a *simple root*. If :math:`G` is semisimple
-of rank :math:`r`, then :math:`r` is the number of positive roots. Let
-:math:`\alpha_1,\cdots,\alpha_r` be these.
+If `\alpha` is a positive root that cannot be decomposed as a sum of
+other positive roots, then `\alpha` is called a *simple root*. If `G`
+is semisimple of rank `r`, then `r` is the number of positive
+roots. Let `\alpha_1,\dots,\alpha_r` be these.
 
-The Weyl Group
+
+The Weyl group
 --------------
 
-Let :math:`G` be a complex analytic group. Let :math:`T` be a maximal torus, and let
-:math:`N(T)` be its normalizer. Let :math:`W=N(T)/T` be the *Weyl group*. It acts on
-:math:`T` by conjugation; therefore it acts on the weight lattice :math:`\Lambda` and
-its ambient space.  The ambient space admits an inner product that is
-invariant under this action. Let :math:`\left<v,w\right>` denote this inner
-product. If :math:`\alpha` is a root let :math:`r_\alpha` denote the reflection in
-the hyperplane of the ambient space that is perpendicular to :math:`\alpha`.
-If :math:`\alpha=\alpha_i` is a simple root, then we use the notation :math:`s_i` to
-denote :math:`r_\alpha`.
+Let `G` be a complex analytic group. Let `T` be a maximal torus, and
+let `N(T)` be its normalizer. Let `W = N(T)/T` be the *Weyl group*. It
+acts on `T` by conjugation; therefore it acts on the weight lattice
+`\Lambda` and its ambient space.  The ambient space admits an inner
+product that is invariant under this action. Let `\left<v,w\right>`
+denote this inner product. If `\alpha` is a root let `r_\alpha` denote
+the reflection in the hyperplane of the ambient space that is
+perpendicular to `\alpha`. If `\alpha = \alpha_i` is a simple root,
+then we use the notation `s_i` to denote `r_\alpha`.
 
-Then :math:`s_1,\cdots,s_r` generate :math:`W`, which is a *Coxeter group*. This
-means that it is generated by elements :math:`s_i` of order two and that
-if :math:`m(i,j)` is the order of :math:`s_i s_j`, then
+Then `s_1,\dots,s_r` generate `W`, which is a *Coxeter group*. This
+means that it is generated by elements `s_i` of order two and that
+if `m(i,j)` is the order of `s_i s_j`, then
 
-:math:`W=\left<s_i| s_i^2=1, (s_i s_j)^{m(i,j)}=1\right>`
+.. MATH::
 
-is a presentation. An important function :math:`l:W\to\mathbb{Z}` is the *length*
-function, where :math:`l(w)` is the length of the shortest decomposition of :math:`w`
-into a product of simple reflections.
+    W = \left<s_i| s_i^2=1, (s_i s_j)^{m(i,j)} = 1\right>
+
+is a presentation. An important function `l: W \to \mathbb{Z}` is the
+*length* function, where `l(w)` is the length of the shortest
+decomposition of `w` into a product of simple reflections.
+
 
 The dual root system
 --------------------
 
 The *coroots* are certain linear functionals on the ambient space
 that also form a root system. Since the ambient space admits a
-$W$-invariant inner product, they may be identified with elements
+`W`-invariant inner product, they may be identified with elements
 of the ambient space itself. Then they are proportional to the
 roots, though if the roots have different lengths, long roots
 correspond to short coroots and conversely. The coroot corresponding
-to the root $\alpha$ is
+to the root `\alpha` is
 
-$\alpha^\vee = \frac{2\alpha}{\left<\alpha,\alpha\right>}.$
+.. MATH::
 
+    \alpha^\vee = \frac{2\alpha}{\left<\alpha,\alpha\right>}.
 
-The Dynkin Diagram
---------------------------------------------------
 
-The Dynkin Diagram is a graph whose vertices are in bijection
-with the set simple roots. We connect the vertices corresponding
-to roots that are not orthogonal. Usually two such vertices
-make an angle of :math:`2\pi/3`, in which case we connect them
-with a single bond. Occasionally they may make an angle
-of :math:`3\pi/4` in which case we connect them with a double
-bond, or :math:`5\pi/6` in which case we connect them with a
-triple bond. If the bond is single, the roots have the
-same length with respect to the inner product on the ambient
-space. In the case of a double or triple bond, the two simple
-roots in questions have different length, and the bond is drawn
-as an arrow from the long root to the short root. Only
-the exceptional group :math:`G_2` has a triple bond.
+The Dynkin diagram
+------------------
+
+The Dynkin diagram is a graph whose vertices are in bijection with the
+set simple roots. We connect the vertices corresponding to roots that
+are not orthogonal. Usually two such vertices make an angle of
+`2\pi/3`, in which case we connect them with a single
+bond. Occasionally they may make an angle of `3\pi/4` in which case we
+connect them with a double bond, or `5\pi/6` in which case we connect
+them with a triple bond. If the bond is single, the roots have the
+same length with respect to the inner product on the ambient space. In
+the case of a double or triple bond, the two simple roots in questions
+have different length, and the bond is drawn as an arrow from the long
+root to the short root. Only the exceptional group `G_2` has a triple
+bond.
 
 There are various ways to get the Dynkin diagram::
 
@@ -492,19 +568,20 @@
     1   2
     G2
 
-The Affine Root and the Extended Dynkin Diagram
---------------------------------------------------
+
+The affine root and the extended Dynkin diagram
+-----------------------------------------------
 
 For the extended Dynkin diagram, we add one negative root
-:math:`\alpha_0`. This is the root whose negative is the highest
-weight in the adjoint representation. Sometimes this is called
-the *affine root*. We make the Dynkin diagram as before by
-measuring the angles between the roots.  This extended Dynkin
-diagram is useful for many purposes, such as finding maximal
-subgroups and for describing the affine Weyl group.
+`\alpha_0`. This is the root whose negative is the highest weight in
+the adjoint representation. Sometimes this is called the
+*affine root*. We make the Dynkin diagram as before by measuring the
+angles between the roots.  This extended Dynkin diagram is useful for
+many purposes, such as finding maximal subgroups and for describing
+the affine Weyl group.
 
-The extended Dynkin diagram may be obtained as the Dynkin
-diagram of the corresponding untwisted affine type::
+The extended Dynkin diagram may be obtained as the Dynkin diagram of
+the corresponding untwisted affine type::
 
     sage: ct = CartanType("E6"); ct
     ['E', 6]
@@ -523,7 +600,7 @@
     1   3   4   5   6
     E6~
 
-The extended Dynkin diagram is also a method of the WeylCharacterRing::
+The extended Dynkin diagram is also a method of the ``WeylCharacterRing``::
 
     sage: WeylCharacterRing("E7").extended_dynkin_diagram()
                 O 2
@@ -534,70 +611,96 @@
     E7~
 
 
-Fundamental Weights and the Weyl Vector
+Fundamental weights and the Weyl vector
 ---------------------------------------
 
-There are certain weights :math:`\omega_1,\cdots,\omega_r` that:
+There are certain weights `\omega_1,\dots,\omega_r` that:
 
-:math:`\frac{2\left<\alpha_i,\omega_j\right>}{\left<\alpha_i,\alpha_i\right>}=\delta(i,j).`
+.. MATH::
 
-If :math:`G` is semisimple then these are uniquely determined, whereas if
-:math:`G` is reductive but not semisimple we may choose them conveniently.
+    \frac{2\left<\alpha_i,\omega_j\right>}{\left<\alpha_i,\alpha_i\right>}
+    =
+    \delta(i,j).
 
-Let :math:`\rho` be the sum of the fundamental dominant weights. If
-:math:`G` is semisimple, then :math:`\rho` is half the sum of the positive
-roots. In case :math:`G` is not semisimple, we have noted, the fundamental
-weights are not completely determined by the inner product condition
-given above. If we make a different choice, then :math:`\rho` is altered by
-a vector that is orthogonal to all roots. This is a harmless change
-for many purposes such as the Weyl character formula.
+If `G` is semisimple then these are uniquely determined, whereas if
+`G` is reductive but not semisimple we may choose them conveniently.
+
+Let `\rho` be the sum of the fundamental dominant weights. If `G` is
+semisimple, then `\rho` is half the sum of the positive roots. In case
+`G` is not semisimple, we have noted, the fundamental weights are not
+completely determined by the inner product condition given above. If
+we make a different choice, then `\rho` is altered by a vector that is
+orthogonal to all roots. This is a harmless change for many purposes
+such as the Weyl character formula.
 
 In Sage, this issue arises only for Cartan type A. See :ref:`SLvsGL`.
 
+
 .. _representations:
 
-Representations and Characters
+Representations and characters
 ------------------------------
 
-Let :math:`\Lambda = X^{\ast} (T)` be the group of rational characters. Then
-:math:`\Lambda \cong \mathbb{Z}^r`.
+Let `\Lambda = X^{\ast} (T)` be the group of rational characters. Then
+`\Lambda \cong \mathbb{Z}^r`.
 
-- Recall that elements of :math:`\Lambda \cong \mathbb{Z}^r` are called *weights*.
+- Recall that elements of `\Lambda \cong \mathbb{Z}^r` are called *weights*.
 
-- The Weyl group :math:`W=N(T)/T` acts on :math:`T`, hence on :math:`\Lambda` and its ambient space by conjugation.
+- The Weyl group `W = N(T)/T` acts on `T`, hence on `\Lambda` and its
+  ambient space by conjugation.
 
-- The ambient space :math:`\mathbb{Q} \otimes X^{\ast} (T) \cong \mathbb{Q}^r` has a fundamental domain :math:`\mathcal{C}^+` for the Weyl group :math:`W` called the *positive Weyl chamber*. Weights in :math:`\mathcal{C}^+` are called *dominant*.
+- The ambient space `\mathbb{Q} \otimes X^{\ast} (T) \cong \mathbb{Q}^r`
+  has a fundamental domain `\mathcal{C}^+` for the Weyl group `W`
+  called the *positive Weyl chamber*. Weights in `\mathcal{C}^+` are
+  called *dominant*.
 
-- Then :math:`\mathcal{C}^+` consists of all vectors such that :math:`\left<\alpha,v\right> \ge 0` for all positive roots :math:`\alpha`.
+- Then `\mathcal{C}^+` consists of all vectors such that
+  `\left<\alpha,v\right> \ge 0` for all positive roots `\alpha`.
 
-- It is useful to embed :math:`\Lambda` in :math:`\mathbb{R}^r` and consider weights as lattice points.
+- It is useful to embed `\Lambda` in `\mathbb{R}^r` and consider
+  weights as lattice points.
 
-- If :math:`(\pi, V)` is a representation then restricting to :math:`T`, the module :math:`V` decomposes into a direct sum of weight eigenspaces :math:`V(\mu)` with  multiplicity :math:`m (\mu)` for weight :math:`\mu`.
+- If `(\pi, V)` is a representation then restricting to `T`, the
+  module `V` decomposes into a direct sum of weight eigenspaces
+  `V(\mu)` with  multiplicity `m (\mu)` for weight `\mu`.
 
-- There is a unique *highest weight* :math:`\lambda` with respect to the partial order. We have :math:`\lambda \in \mathcal{C}` and :math:`m (\lambda) = 1`.
+- There is a unique *highest weight* `\lambda` with respect to the
+  partial order. We have `\lambda \in \mathcal{C}` and `m (\lambda) = 1`.
 
-- :math:`V \longleftrightarrow \lambda` gives a bijection between irreducible representations and   weights :math:`\lambda` in :math:`\mathcal{C}^+`.
+- `V \longleftrightarrow \lambda` gives a bijection between
+  irreducible representations and   weights `\lambda` in
+  `\mathcal{C}^+`.
 
-Assuming that :math:`G` is simply-connected (or more generally, reductive
-with a simply-connected derived group) every dominant weight :math:`\lambda` is the
-highest weight of a unique irreducible representation :math:`\pi_\lambda`, and
-:math:`\lambda\mapsto\pi_\lambda` gives a parametrization of the isomorphism classes
-of irreducible representations of :math:`G` by the dominant weights.
+Assuming that `G` is simply-connected (or more generally, reductive
+with a simply-connected derived group) every dominant weight `\lambda`
+is the highest weight of a unique irreducible representation
+`\pi_\lambda`, and `\lambda \mapsto \pi_\lambda` gives a
+parametrization of the isomorphism classes of irreducible
+representations of `G` by the dominant weights.
 
-The *character* of :math:`\pi_\lambda` is the function :math:`\chi_\lambda(g)=tr(\pi_\lambda(g))`.
-It is determined by its values on :math:`T`. If :math:`\mathbf(z)\in T` and :math:`\mu\in\Lambda`,
-let us write :math:`\mathbf{z}^\mu` for the value of :math:`\mu` on :math:`\mathbf{z}`. Then
-the character:
+The *character* of `\pi_\lambda` is the function
+`\chi_\lambda(g) = tr(\pi_\lambda(g))`. It is determined by its values
+on `T`. If `\mathbf(z) \in T` and `\mu \in \Lambda`, let us write
+`\mathbf{z}^\mu` for the value of `\mu` on `\mathbf{z}`. Then the
+character:
 
-:math:`\chi_\lambda(\mathbf{z})=\sum_{\mu\in\Lambda}m(\mu)\,\mathbf{z}^\lambda`.
+.. MATH::
+
+    \chi_\lambda(\mathbf{z})
+    =
+    \sum_{\mu\in\Lambda}m(\mu)\,\mathbf{z}^\lambda.
 
 Sometimes this is written
 
-:math:`\chi_\lambda = \sum_{\mu\in\Lambda}m(\mu)\,e^\lambda`.
+.. MATH::
 
-The meaning of :math:`e^\lambda` is subject to interpretation, but we may regard it as
-the image of the additive group :math:`\Lambda` in its group algebra. The character
-is then regarded as an element of this ring, the group algebra of :math:`\Lambda`.
+    \chi_\lambda = \sum_{\mu\in\Lambda}m(\mu)\,e^\lambda.
+
+The meaning of `e^\lambda` is subject to interpretation, but we may
+regard it as the image of the additive group `\Lambda` in its group
+algebra. The character is then regarded as an element of this ring,
+the group algebra of `\Lambda`.
+
 
 Representations: an example
 ---------------------------
@@ -605,12 +708,13 @@
 .. image:: ../static/wcf1.png
    :scale: 50
 
-In this example, :math:`G=\hbox{SL}(3,\mathbb{C})`. We have drawn the
-weights of an irreducible representation with highest weight :math:`\lambda`.
-The shaded region is :math:`\mathcal{C}^+`. :math:`\lambda` is a dominant
-weight, and the labeled vertices are the weights with positive multiplicity in
-:math:`V(\lambda)`. The weights weights on the outside have :math:`m(\mu)=1`,
-while the six interior weights (with double circles) have :math:`m(\mu)=2`.
+In this example, `G = \hbox{SL}(3,\mathbb{C})`. We have drawn the
+weights of an irreducible representation with highest weight `\lambda`.
+The shaded region is `\mathcal{C}^+`. `\lambda` is a dominant weight,
+and the labeled vertices are the weights with positive multiplicity in
+`V(\lambda)`. The weights weights on the outside have `m(\mu) = 1`,
+while the six interior weights (with double circles) have `m(\mu) = 2`.
+
 
 .. _`Schur Polynomials`:
 
@@ -618,45 +722,63 @@
 --------------------------------
 
 The considerations of this section are particular to type A. We review
-the relationship between characters of :math:`GL(n,\mathbb{C})` and
+the relationship between characters of `GL(n,\mathbb{C})` and
 symmetric function theory.
 
-A *partition* :math:`\lambda` is a sequence of descending nonnegative
+A *partition* `\lambda` is a sequence of descending nonnegative
 integers:
 
-:math:`\lambda = (\lambda_1, \lambda_2, \cdots, \lambda_n),\qquad \lambda_1\ge\lambda_2\ge\cdots\ge\lambda_n\ge 0 .`
+.. MATH::
 
-We do not distinguish between two partitions if they differ only by some
-trailing zeros, so :math:`(3, 2) = (3, 2, 0)`. If :math:`l` is the last integer such that
-:math:`\lambda_l > 0` then we say that :math:`l` is the *length* of :math:`\lambda`. If
-:math:`k = \sum \lambda_i` then we say that :math:`\lambda` is a *partition* of :math:`k`
-and write :math:`\lambda \vdash k`.
+    \lambda
+    =
+    (\lambda_1, \lambda_2, \dots, \lambda_n),
+    \qquad
+    \lambda_1 \ge \lambda_2 \ge \cdots \ge \lambda_n \ge 0.
 
-A partition of length :math:`\le n=r+1` is therefore a dominant weight of type ``['A',r]``.
-Not every dominant weight is a partition, since the coefficients in a dominant
-weight could be negative. Let us say that an element :math:`\mu=(\mu_1, \mu_2, \cdots, \mu_n)`
-of the ``['A',r]`` root lattice is *effective* if the :math:`\mu_i\ge0`. Thus an effective
-dominant weight of ``['A',r]`` is a partition of length :math:`\le n`, where :math:`n=r+1`.
+We do not distinguish between two partitions if they differ only by
+some trailing zeros, so `(3, 2) = (3, 2, 0)`. If `l` is the last
+integer such that `\lambda_l > 0` then we say that `l` is the *length*
+of `\lambda`. If `k = \sum \lambda_i` then we say that `\lambda` is a
+*partition* of `k` and write `\lambda \vdash k`.
 
-Let :math:`\lambda` be a dominant weight, and let :math:`\chi_\lambda` be the character
-of :math:`GL(n,\mathbb{C})` with highest weight :math:`\lambda`. If :math:`k` is any integer
-we may consider the weight :math:`\lambda'=(\lambda_1+k,\cdots,\lambda_n+k)`
-obtained by adding :math:`k` to each entry. Then :math:`\chi_{\lambda'}=\det^k\otimes\chi_\lambda`.
-Clearly by choosing :math:`k` large enough, we may make :math:`\lambda'` effective.
+A partition of length `\le n=r+1` is therefore a dominant weight of
+type ``['A',r]``. Not every dominant weight is a partition, since the
+coefficients in a dominant weight could be negative. Let us say that
+an element `\mu = (\mu_1, \mu_2, \cdots, \mu_n)` of the ``['A',r]``
+root lattice is *effective* if the `\mu_i \ge 0`. Thus an effective
+dominant weight of ``['A',r]`` is a partition of length `\le n`, where
+`n = r+1`.
 
-So the characters of irreducible representations of :math:`GL(n,\mathbb{C})`
+Let `\lambda` be a dominant weight, and let `\chi_\lambda` be the
+character of `GL(n,\mathbb{C})` with highest weight `\lambda`. If `k`
+is any integer we may consider the weight
+`\lambda' = (\lambda_1+k,\dots,\lambda_n+k)` obtained by adding `k` to
+each entry. Then `\chi_{\lambda'} = \det^k \otimes \chi_\lambda`.
+Clearly by choosing `k` large enough, we may make `\lambda'` effective.
+
+So the characters of irreducible representations of `GL(n,\mathbb{C})`
 do not all correspond to partitions, but the characters indexed by
 partitions (effective dominant weights) are enough that we can
-write any character :math:`\det^{-k}\chi_{\lambda'}` where :math:`\lambda'` is a
-partition. If we take :math:`k=-\lambda_n` we could also arrange that
-the last entry in :math:`\lambda` is zero.
+write any character `\det^{-k}\chi_{\lambda'}` where `\lambda'` is a
+partition. If we take `k = -\lambda_n` we could also arrange that
+the last entry in `\lambda` is zero.
 
-If :math:`\lambda` is an effective dominant weight, then every weight that
-appears in :math:`\chi_\lambda` is effective. (Indeed, it lies in the convex
-hull of :math:`w(\lambda)` where :math:`w` runs through the Weyl group :math:`W=S_n`.)
+If `\lambda` is an effective dominant weight, then every weight that
+appears in `\chi_\lambda` is effective. (Indeed, it lies in the convex
+hull of `w(\lambda)` where `w` runs through the Weyl group `W = S_n`.)
 This means that if
 
-:math:`g = \left(\begin{array}{ccc}z_1\\&\ddots\\&&z_n\end{array}\right)\in GL(n,\mathbb{C})`
+.. MATH::
 
-then :math:`\chi_\lambda(g)` is a polynomial in the eigenvalues of :math:`g`.
-This is the *Schur polynomial* :math:`s_\lambda(z_1,\cdots,z_n)`.
+    g
+    =
+    \left(\begin{array}{ccc}
+    z_1 \\
+    & \ddots \\
+    && z_n
+    \end{array}\right)
+    \in GL(n,\mathbb{C})
+
+then `\chi_\lambda(g)` is a polynomial in the eigenvalues of `g`.
+This is the *Schur polynomial* `s_\lambda(z_1,\dots,z_n)`.
diff --git a/doc/en/thematic_tutorials/lie/weight_ring.rst b/doc/en/thematic_tutorials/lie/weight_ring.rst
--- a/doc/en/thematic_tutorials/lie/weight_ring.rst
+++ b/doc/en/thematic_tutorials/lie/weight_ring.rst
@@ -1,32 +1,31 @@
---------------------------------------
+------------
 Weight Rings
---------------------------------------
+------------
 
 You may wish to work directly with the weights of a representation.
 
-WeylCharacterRingElements are represented internally by a dictionary
-of their weights with multiplicities. However these are subject to
-a constraint: the coefficients must be invariant under the action
-of the Weyl group.
+``WeylCharacterRingElements`` are represented internally by a
+dictionary of their weights with multiplicities. However these are
+subject to a constraint: the coefficients must be invariant under the
+action of the Weyl group.
 
-The WeightRing is also a ring whose elements are represented
-internally by a dictionary of their weights with multiplicities,
-but it is not subject to this constraint of Weyl group invariance.
-The weights are allowed to be fractional, that is, elements of
-the ambient space. In other words, the weight ring is the group
-algebra over the ambient space of the weight lattice.
+The ``WeightRing`` is also a ring whose elements are represented
+internally by a dictionary of their weights with multiplicities, but
+it is not subject to this constraint of Weyl group invariance. The
+weights are allowed to be fractional, that is, elements of the ambient
+space. In other words, the weight ring is the group algebra over the
+ambient space of the weight lattice.
 
-To create a WeightRing first construct the Weyl Character Ring,
-then create the WeightRing as follows::
+To create a ``WeightRing`` first construct the Weyl Character Ring,
+then create the ``WeightRing`` as follows::
 
     sage: A2 = WeylCharacterRing(['A',2])
     sage: a2 = WeightRing(A2)
 
-You may coerce elements of the WeylCharacterRing into the
-weight ring. For example, if you want to see the weights of
-the adjoint representation of :math:`GL(3)`, you may use the method
-:meth:`mlist`, but another way is to coerce it into the
-weight ring::
+You may coerce elements of the ``WeylCharacterRing`` into the weight
+ring. For example, if you want to see the weights of the adjoint
+representation of `GL(3)`, you may use the method ``mlist``, but
+another way is to coerce it into the weight ring::
 
     sage: ad = A2(1,0,-1)
     sage: ad.mlist()
@@ -37,13 +36,17 @@
 
 For example, the Weyl denominator formula is usually written this way:
 
-:math:`\prod_{\alpha\in\Phi^+}\left(e^{\alpha/2}-e^{-\alpha/2}\right) = \sum_{w\in W} (-1)^{l(w)}e^{w(\rho)}.`
+.. MATH::
 
-The notation is as follows. Here if :math:`\lambda` is a weight, or more generally,
-an element of the ambient space, then :math:`e^\lambda` means the image of :math:`\lambda`
-in the group algebra of the ambient space of the weight lattice :math:`\lambda`.
-Since this group algebra is just the weight ring, we can interpret
-:math:`e^\lambda` as its image in the weight ring.
+    \prod_{\alpha\in\Phi^+}\left(e^{\alpha/2}-e^{-\alpha/2}\right)
+    =
+    \sum_{w\in W} (-1)^{l(w)}e^{w(\rho)}.
+
+The notation is as follows. Here if `\lambda` is a weight, or more
+generally, an element of the ambient space, then `e^\lambda` means the
+image of `\lambda` in the group algebra of the ambient space of the
+weight lattice `\lambda`. Since this group algebra is just the weight
+ring, we can interpret `e^\lambda` as its image in the weight ring.
 
 Let us confirm the Weyl denominator formula for ``A2``::
 
@@ -59,10 +62,10 @@
     sage: lhs == rhs
     True
 
-Note that we have to be careful to use the right value of :math:`\rho`. The
+Note that we have to be careful to use the right value of `\rho`. The
 reason for this is explained in :ref:`SLvsGL`.
 
-We have seen that elements of the WeylCharacterRing can be coerced
-into the WeightRing. Elements of the WeightRing can be coerced into
-the WeylCharacterRing *provided* they are invariant under the Weyl
-group.
+We have seen that elements of the ``WeylCharacterRing`` can be coerced
+into the ``WeightRing``. Elements of the ``WeightRing`` can be coerced
+into the ``WeylCharacterRing`` *provided* they are invariant under the
+Weyl group.
diff --git a/doc/en/thematic_tutorials/lie/weyl_character_ring.rst b/doc/en/thematic_tutorials/lie/weyl_character_ring.rst
--- a/doc/en/thematic_tutorials/lie/weyl_character_ring.rst
+++ b/doc/en/thematic_tutorials/lie/weyl_character_ring.rst
@@ -1,21 +1,24 @@
+=======================
 The Weyl Character Ring
-=================================================================
+=======================
 
-Weyl Character Rings
+
+Weyl character rings
 --------------------
 
-The Weyl Character ring has a basis consisting of the irreducible
-representations of :math:`G`, or equivalently, their characters.
-The addition and multiplication in the Weyl character ring
-correspond to direct sum and tensor product of representations.
+The Weyl character ring has a basis consisting of the irreducible
+representations of `G`, or equivalently, their characters. The
+addition and multiplication in the Weyl character ring correspond to
+direct sum and tensor product of representations.
+
 
 Methods of the ambient space
---------------------------------------
+----------------------------
 
-In Sage, many useful features of the Lie group are available as methods
-of the ambient space::
+In Sage, many useful features of the Lie group are available as
+methods of the ambient space::
 
-    sage: S=RootSystem("B2").ambient_space(); S
+    sage: S = RootSystem("B2").ambient_space(); S
     Ambient space of the Root system of type ['B', 2]
     sage: S.roots()
     [(1, -1), (1, 1), (1, 0), (0, 1), (-1, 1), (-1, -1), (-1, 0), (0, -1)]
@@ -26,14 +29,15 @@
     sage: S.weyl_group()
     Weyl Group of type ['B', 2] (as a matrix group acting on the ambient space)
 
-Methods of the Weyl Character Ring
---------------------------------------
 
-If you are going to work with representations, you may want to
-create a *Weyl Character ring*. Many methods of the ambient
-space are available as methods of the Weyl Character ring::
+Methods of the Weyl character ring
+----------------------------------
 
-    sage: B3=WeylCharacterRing("B3")
+If you are going to work with representations, you may want to create
+a *Weyl Character ring*. Many methods of the ambient space are
+available as methods of the Weyl character ring::
+
+    sage: B3 = WeylCharacterRing("B3")
     sage: B3.fundamental_weights()
     Finite family {1: (1, 0, 0), 2: (1, 1, 0), 3: (1/2, 1/2, 1/2)}
     sage: B3.simple_roots()
@@ -45,21 +49,20 @@
 
 Other useful methods of the Weyl character ring include:
 
-- :meth:`cartan_type`
+- ``cartan_type``
 
-- :meth:`highest_root`
+- ``highest_root``
 
-- :meth:`positive_root`
+- ``positive_root``
 
-- :meth:`extended_dynkin_diagram`
+- ``extended_dynkin_diagram``
 
-- :meth:`rank`
+- ``rank``
 
-
-Some methods of the ambient space are not implemented as methods
-of the Weyl Character ring. However the ambient space itself is
-a method, and so you have access to its methods from the Weyl
-Character Ring::
+Some methods of the ambient space are not implemented as methods of
+the Weyl character ring. However, the ambient space itself is a
+method, and so you have access to its methods from the Weyl character
+ring::
 
     sage: B3.space().weyl_group()
     Weyl Group of type ['B', 3] (as a matrix group acting on the ambient space)
@@ -70,23 +73,23 @@
     sage: B3.cartan_type()
     ['B', 3]
 
-Coroot Notation
---------------------------------------
 
-It is useful to give the Weyl Character Ring a name that
-corresponds to its Cartan Type. This has the effect that
-the ring can parse its own output::
+Coroot notation
+---------------
 
-    sage: G2=WeylCharacterRing("G2")
+It is useful to give the Weyl character ring a name that corresponds
+to its Cartan type. This has the effect that the ring can parse its
+own output::
+
+    sage: G2 = WeylCharacterRing("G2")
     sage: [G2(fw) for fw in G2.fundamental_weights()]
     [G2(1,0,-1), G2(2,-1,-1)]
     sage: G2(1,0,-1)
     G2(1,0,-1)
 
-Actually the prefix for the ring is configurable, so
-you don't really have to call this ring ``G2``. Type
-``WeylCharacterRing?`` at the ``sage:`` prompt for
-details.
+Actually the prefix for the ring is configurable, so you don't really
+have to call this ring ``G2``. Type ``WeylCharacterRing?`` at the
+``sage:`` prompt for details.
 
 There is one important option that you may want to know about. This
 is *coroot notation*. You select this by specifying the option
@@ -102,32 +105,30 @@
     sage: B3(0,0,1).degree()
     8
 
-The last representation is the eight dimensional spin
-representation of :math:`G=spin(7)`, the double cover of the
-orthogonal group :math:`SO(7)`. In the default notation it
-would be represented ``B3(1/2,1/2,1/2)``.
+The last representation is the eight dimensional spin representation
+of `G = spin(7)`, the double cover of the orthogonal group `SO(7)`. In
+the default notation it would be represented ``B3(1/2,1/2,1/2)``.
 
-With the coroot notation every irreducible representation
-is represented ``B3(a,b,c)`` where ``a``, ``b`` and ``c``
-are nonnegative integers. This is often convenient.
-For many purposes the coroot style is preferable.
+With the coroot notation every irreducible representation is
+represented ``B3(a,b,c)`` where ``a``, ``b`` and ``c`` are nonnegative
+integers. This is often convenient. For many purposes the coroot style
+is preferable.
 
-One disadvantage: in the coroot style the Lie group or
-Lie algebra is treated as semisimple, so you lose the
-distinction between :math:`GL(n)` and :math:`SL(n)`; you also some
-information about representations of E6 and E7 for the
-same reason.
+One disadvantage: in the coroot style the Lie group or Lie algebra is
+treated as semisimple, so you lose the distinction between `GL(n)` and
+`SL(n)`; you also some information about representations of E6 and E7
+for the same reason.
 
 
 Tensor products of representations
---------------------------------------
+----------------------------------
 
-The multiplication in the Weyl Character ring corresponds to tensor
-product. This gives us a convenient way of decomposing a tensor product into
-irreducibles::
+The multiplication in the Weyl character ring corresponds to tensor
+product. This gives us a convenient way of decomposing a tensor
+product into irreducibles::
 
      sage: B3 = WeylCharacterRing("B3")
-     sage: fw=B3.fundamental_weights()
+     sage: fw = B3.fundamental_weights()
      sage: spinweight = fw[3]; spinweight
      (1/2, 1/2, 1/2)
      sage: spin = B3(spinweight)
@@ -136,14 +137,12 @@
      sage: chi = spin*spin; chi
      B3(0,0,0) + B3(1,0,0) + B3(1,1,0) + B3(1,1,1)
 
-We have taken the eight-dimensional spin representation
-and tensored with itself. We see that the tensor
-square splits into four irreducibles, each with
-multiplicity one.
+We have taken the eight-dimensional spin representation and tensored
+with itself. We see that the tensor square splits into four
+irreducibles, each with multiplicity one.
 
-The highest weights that appear here are available
-(with their coefficients) are available through the
-method ``hlist``::
+The highest weights that appear here are available (with their
+coefficients) are available through the method ``hlist``::
 
     sage: chi.hlist()
     [[(1, 1, 1), 1], [(1, 0, 0), 1], [(1, 1, 0), 1], [(0, 0, 0), 1]]
@@ -159,12 +158,13 @@
 Here we've extracted the individual representations, computed
 their degrees and checked that they sum to 64.
 
+
 Weights
 -------
 
-The weights of the character are (with their coefficients)
-are available through the method ``mlist``. Continuing from
-the example in the last section::
+The weights of the character are (with their coefficients) are
+available through the method ``mlist``. Continuing from the example in
+the last section::
 
     sage: chi.mlist()
     [[(0, 1, 0), 4], [(1, -1, 1), 1], [(-1, -1, 1), 1],
@@ -181,17 +181,19 @@
 Frobenius-Schur indicator
 -------------------------
 
-The Frobeinus-Schur indicator of an irreducible representation
-of a compact Lie group :math:`G` with character :math:`\chi` is:
+The Frobeinus-Schur indicator of an irreducible representation of a
+compact Lie group `G` with character `\chi` is:
 
-:math:`\int_G\chi(g^2)\,dg`
+.. MATH::
 
-The Haar measure is normalized so that :math:`vol(G)=1`. The Frobenius-Schur
-indicator equals 1 if the representation is real (orthogonal),
--1 if it is quaternionic (symplectic) and 0 if it is complex
-(not self-contragredient). This is a method of weight ring elements
-corresponding to irreducible representations. Let us compute the
-Frobenius-Schur indicators of the spin representations of some
+    \int_G\chi(g^2) \, dg
+
+The Haar measure is normalized so that `vol(G) = 1`. The
+Frobenius-Schur indicator equals 1 if the representation is real
+(orthogonal), `-1` if it is quaternionic (symplectic) and 0 if it is
+complex (not self-contragredient). This is a method of weight ring
+elements corresponding to irreducible representations. Let us compute
+the Frobenius-Schur indicators of the spin representations of some
 odd spin groups::
 
     sage: for r in [1..4]:
@@ -204,17 +206,17 @@
     3 1
     4 1
 
-We see that the spin representations of :math:`spin(3)` and :math:`spin(5)`
-are symplectic, while those of :math:`spin(7)` and :math:`spin(9)` are
-orthogonal.
+We see that the spin representations of `spin(3)` and `spin(5)` are
+symplectic, while those of `spin(7)` and `spin(9)` are orthogonal.
 
-Symmetric and Exterior Square
+
+Symmetric and exterior square
 -----------------------------
 
 The tensor square of any representation decomposes as the direct sum
 of the symmetric and exterior squares::
 
-    sage: C4=WeylCharacterRing("C4",style="coroots")
+    sage: C4 = WeylCharacterRing("C4",style="coroots")
     sage: chi = C4(1,0,0,0); chi.degree()
     8
     sage: chi.symmetric_square()
@@ -224,9 +226,9 @@
     sage: chi^2 == chi.symmetric_square() + chi.exterior_square()
     True
 
-Since in this example the exterior square contains the
-trivial representation we expect the Frobenius-Schur indicator
-to be -1, and indeed it is::
+Since in this example the exterior square contains the trivial
+representation we expect the Frobenius-Schur indicator to be `-1`, and
+indeed it is::
 
     sage: chi.frobenius_schur_indicator()
     -1
@@ -234,25 +236,25 @@
 This is not surprising since this is the standard representation
 of a symplectic group, which is symplectic *by definition*!
 
-Weyl Dimension Formula
+
+Weyl dimension formula
 ----------------------
 
-If the representation is truly large you will not be able to
-construct it in the Weyl character ring, since internally it
-is represented by a dictionary of its weights. If you want
-to know its degree, you can still compute that since Sage
-implements the Weyl dimension formula. The degree of the
-representation is implemented as a method of its highest
-weight vector::
+If the representation is truly large you will not be able to construct
+it in the Weyl character ring, since internally it is represented by a
+dictionary of its weights. If you want to know its degree, you can
+still compute that since Sage implements the Weyl dimension
+formula. The degree of the representation is implemented as a method
+of its highest weight vector::
 
     sage: L = RootSystem("E8").ambient_space()
     sage: [L.weyl_dimension(f) for f in L.fundamental_weights()]
     [3875, 147250, 6696000, 6899079264, 146325270, 2450240, 30380, 248]
 
-It is a fact that if :math:`\rho` is the Weyl vector then the degree
-of the irreducible representation with highest weight :math:`\rho`
-equals :math:`2^N` where :math:`N` is the number of positive roots. Let
-us check this for :math:`E_8`. In this case :math:`N=120`::
+It is a fact that if `\rho` is the Weyl vector then the degree of the
+irreducible representation with highest weight `\rho` equals `2^N`
+where `N` is the number of positive roots. Let us check this for
+`E_8`. In this case `N = 120`::
 
    sage: len(L.positive_roots())
    120
@@ -261,85 +263,89 @@
    sage: L.weyl_dimension(L.rho())
    1329227995784915872903807060280344576
 
+
 .. _SLvsGL:
 
 SL versus GL
 ------------
 
-Sage takes the weight space for type ``['A',r]`` to be r+1 dimensional.
-As a biproduct, if you create the Weyl character ring with the command::
+Sage takes the weight space for type ``['A',r]`` to be `r+1`
+dimensional. As a biproduct, if you create the Weyl character ring
+with the command::
 
-    sage: A2=WeylCharacterRing("A2")
+    sage: A2 = WeylCharacterRing("A2")
 
-Then you are effectively working with GL(3) instead of SL(3). For
-example, the determinant is the character ``A2(1,1,1)``.
-However, as we will explain later, you can work with SL(3) if
-you like, so long as you are willing to work with fractional
-weights. On the other hand if you create the Weyl character
-ring with the command::
+Then you are effectively working with `GL(3)` instead of `SL(3)`. For
+example, the determinant is the character ``A2(1,1,1)``. However, as
+we will explain later, you can work with `SL(3)` if you like, so long
+as you are willing to work with fractional weights. On the other hand
+if you create the Weyl character ring with the command::
 
-    sage: A2=WeylCharacterRing("A2",style="coroots")
+    sage: A2 = WeylCharacterRing("A2", style="coroots")
 
-Then you are working with SL(3).
+Then you are working with `SL(3)`.
 
 There are some advantages to this arrangement.
 
-- The group :math:`GL(r+1)` arises frequently in practice. For example, even
-  if you care mainly about semisimple groups, the group :math:`GL(r+1)` may
+- The group `GL(r+1)` arises frequently in practice. For example, even
+  if you care mainly about semisimple groups, the group `GL(r+1)` may
   arise as a Levi subgroup.
 
-- It avoids fractional weights. If you want to work with :math:`SL(3)` the
-  fundamental weights are ``(2/3,-1/3,-1/3)`` and ``(1/3,1/3,-2/3)``. If you
-  work instead with :math:`GL(3)`, they are ``(1,0,0)`` and ``(1,1,0)``. For
-  many mathematical purposes it doesn't make any difference which you
-  use. This is because the difference between ``(2/3,-1/3,-1/3)`` and
-  ``(1,0,0)`` is a vector that is orthogonal to all the simple roots. Thus
-  these vectors are interchangeable. But for convenience avoiding fractional
-  weights is advantageous.
+- It avoids fractional weights. If you want to work with `SL(3)` the
+  fundamental weights are ``(2/3,-1/3,-1/3)`` and
+  ``(1/3,1/3,-2/3)``. If you work instead with `GL(3)`, they are
+  ``(1,0,0)`` and ``(1,1,0)``. For many mathematical purposes it
+  doesn't make any difference which you use. This is because the
+  difference between ``(2/3,-1/3,-1/3)`` and ``(1,0,0)`` is a vector
+  that is orthogonal to all the simple roots. Thus these vectors are
+  interchangeable. But for convenience avoiding fractional weights is
+  advantageous.
 
-However if you want to be an SL purist, Sage will support you.
-The weight space for SL(3) can be taken to be the hyperplane in
-:math:`\mathbb{Q}^3` consisting of vectors :math:`(a,b,c)` with
-:math:`a+b+c=0`. The fundamental weights for SL(3) are then
+However if you want to be an `SL` purist, Sage will support you. The
+weight space for `SL(3)` can be taken to be the hyperplane in
+`\mathbb{Q}^3` consisting of vectors `(a,b,c)` with
+`a+b+c = 0`. The fundamental weights for SL(3) are then
 ``(2/3,-1/3,-1/3)`` and ``(1/3,1/3,-2/3)``, though Sage will tell you
-they are ``(1,0,0)`` and ``(1,1,0)``. The work-around is to
-filter them through the method :meth:`coerce_to_sl` as follows::
+they are ``(1,0,0)`` and ``(1,1,0)``. The work-around is to filter
+them through the method ``coerce_to_sl`` as follows::
 
-    sage: A2=WeylCharacterRing("A2")
-    sage: [fw1,fw2]=[A2.coerce_to_sl(w) for w in A2.fundamental_weights()]
+    sage: A2 = WeylCharacterRing("A2")
+    sage: [fw1,fw2] = [A2.coerce_to_sl(w) for w in A2.fundamental_weights()]
     sage: [standard, contragredient] = [A2(fw1), A2(fw2)]
     sage: standard, contragredient
     (A2(2/3,-1/3,-1/3), A2(1/3,1/3,-2/3))
     sage: standard*contragredient
     A2(0,0,0) + A2(1,0,-1)
 
-Sage is not confused by the fractional weights. Note
-that if you use coroot notation, you are working with
-SL automatically::
+Sage is not confused by the fractional weights. Note that if you use
+coroot notation, you are working with SL automatically::
 
-    sage: A2=WeylCharacterRing("A2",style="coroots")
+    sage: A2 = WeylCharacterRing("A2", style="coroots")
     sage: A2(1,0).mlist()
     [[(2/3, -1/3, -1/3), 1], [(-1/3, 2/3, -1/3), 1], [(-1/3, -1/3, 2/3), 1]]
 
-There is no convenient way to create the determinant in the
-Weyl Character Ring if you adopt the coroot style.
+There is no convenient way to create the determinant in the Weyl
+character ring if you adopt the coroot style.
 
-Just as we coerced the fundamental weights into the :math:`SL` weight
-lattice, you may need to coerce the Weyl vector :math:`\rho` if you are
-working with :math:`SL`. The default value for :math:`\rho` in type
-:math:`A_r` is :math:`(r,r-1,\cdots,0)`,
-but if you are an SL purist you want
-:math:`\left(\frac{r}{2}, \frac{r}{2}-1,\cdots,-\frac{r}{2}\right)`.
-Therefore take the value of rho that you get from the method of the
-ambient space and coerce it into SL::
+Just as we coerced the fundamental weights into the `SL` weight
+lattice, you may need to coerce the Weyl vector `\rho` if you are
+working with `SL`. The default value for `\rho` in type `A_r` is
+`(r,r-1,\dots,0)`, but if you are an SL purist you want
+
+.. MATH::
+
+    \left(\frac{r}{2}, \frac{r}{2}-1,\dots,-\frac{r}{2}\right).
+
+Therefore take the value of `\rho` that you get from the method of the
+ambient space and coerce it into `SL`::
 
     sage: rho = A2.coerce_to_sl(A2.space().rho()); rho
     (1, 0, -1)
     sage: rho == (1/2)*sum(a for a in A2.space().positive_roots())
     True
 
-You do not need to do this for other Cartan types. If you
-are working with (say) F4 then a rho is a rho is a rho::
+You do not need to do this for other Cartan types. If you are working
+with (say) `F4` then a `\rho` is a `\rho` is a `\rho`::
 
     sage: F4 = WeylCharacterRing("F4")
     sage: L = F4.space()
@@ -347,6 +353,7 @@
     sage: rho == (1/2)*sum(a for a in L.positive_roots())
     True
 
+
 Caching
 -------
 
diff --git a/doc/en/thematic_tutorials/lie/weyl_groups.rst b/doc/en/thematic_tutorials/lie/weyl_groups.rst
--- a/doc/en/thematic_tutorials/lie/weyl_groups.rst
+++ b/doc/en/thematic_tutorials/lie/weyl_groups.rst
@@ -1,13 +1,14 @@
--------------------------------------------------
+------------------------------------------------
 Weyl Groups, Coxeter Groups and the Bruhat Order
--------------------------------------------------
+------------------------------------------------
 
-Classical and affine Weyl Groups
----------------------------------
 
-You can create Weyl groups and affine Weyl groups for any root system.
-A variety of methods are available for these. Some of these are
-methods are available for general Coxeter groups.
+Classical and affine Weyl groups
+--------------------------------
+
+You can create Weyl groups and affine Weyl groups for any root
+system. A variety of methods are available for these. Some of these
+are methods are available for general Coxeter groups.
 
 By default, elements of the Weyl group are represented as matrices::
 
@@ -17,12 +18,12 @@
     [0 0 1 0]
     [0 0 0 1]
 
-You may prefer a notation in which elements are written out
-as products of simple reflections. In order to implement this
-you need to specify a prefix, typically ``"s"``::
+You may prefer a notation in which elements are written out as
+products of simple reflections. In order to implement this you need to
+specify a prefix, typically ``"s"``::
 
     sage: W = WeylGroup("A3",prefix="s")
-    sage: [s1,s2,s3]=W.simple_reflections()
+    sage: [s1,s2,s3] = W.simple_reflections()
     sage: (s1*s2*s1).length()
     3
     sage: W.long_element()
@@ -30,11 +31,10 @@
     sage: s1*s2*s3*s1*s2*s1 == s3*s2*s1*s3*s2*s3
     True
 
-The Weyl group acts on the ambient space, which is
-available as a :meth:`space`. To illustrate this, recall
-that if :math:`w_0` is the long element then :math:`\alpha\mapsto -w_0(\alpha)`
-is a permutation of the simple roots. We may compute this
-as follows::
+The Weyl group acts on the ambient space, which is available as a
+``space``. To illustrate this, recall that if `w_0` is the long
+element then `\alpha \mapsto -w_0(\alpha)` is a permutation of the
+simple roots. We may compute this as follows::
 
     sage: W = WeylGroup("E6",prefix="s")
     sage: w0 = W.long_element(); w0
@@ -49,21 +49,21 @@
     (0, -1, 1, 0, 0, 0, 0, 0), (-1, 1, 0, 0, 0, 0, 0, 0),
     (1/2, -1/2, -1/2, -1/2, -1/2, -1/2, -1/2, 1/2)]
 
-We may ask when this permutation is trivial. If it is nontrivial
-it induces an automorphism of the Dynkin diagram, so it must
-be nontrivial when the Dynkin diagram has no automorphism. But
-if there is a nontrivial automorphism, the permutation might
-or might not be trivial::
+We may ask when this permutation is trivial. If it is nontrivial it
+induces an automorphism of the Dynkin diagram, so it must be
+nontrivial when the Dynkin diagram has no automorphism. But if there
+is a nontrivial automorphism, the permutation might or might not be
+trivial::
 
     sage: def roots_not_permuted(ct):
-    ....:     W = WeylGroup(ct)
-    ....:     w0 = W.long_element()
-    ....:     sr = W.space().simple_roots()
-    ....:     return all(a == -w0.action(a) for a in sr)
-    ....:
+    ...       W = WeylGroup(ct)
+    ...       w0 = W.long_element()
+    ...       sr = W.space().simple_roots()
+    ...       return all(a == -w0.action(a) for a in sr)
+    ...
     sage: for ct in [CartanType(['D',r]) for r in [2..8]]:
-    ....:    print ct,roots_not_permuted(ct)
-    ....:
+    ...      print ct,roots_not_permuted(ct)
+    ...
     ['D', 2] True
     ['D', 3] False
     ['D', 4] True
@@ -72,17 +72,16 @@
     ['D', 7] False
     ['D', 8] True
 
-If :math:`\alpha` is a root let :math:`r_\alpha` denote the reflection
-in the hyperplane of the ambient space that is orthogonal
-to :math:`\alpha`. We reserve the notation :math:`s_\alpha` for
-the simple reflections, that is, the case where :math:`\alpha` is a simple
-root. The reflections are just the conjugates of the simple
-reflections.
+If `\alpha` is a root let `r_\alpha` denote the reflection in the
+hyperplane of the ambient space that is orthogonal to `\alpha`. We
+reserve the notation `s_\alpha` for the simple reflections, that is,
+the case where `\alpha` is a simple root. The reflections are just the
+conjugates of the simple reflections.
 
-The reflections are the keys in a finite family, which is a
-wrapper around a python dictionary. The values are the positive
-roots, so given a reflection, you can look up the corresponding root. If
-you want a list of all reflections, use the method :meth:`keys` for the
+The reflections are the keys in a finite family, which is a wrapper
+around a python dictionary. The values are the positive roots, so
+given a reflection, you can look up the corresponding root. If you
+want a list of all reflections, use the method ``keys`` for the
 family of reflections::
 
     sage: W = WeylGroup("B3",prefix="s")
@@ -96,10 +95,10 @@
     sage: ref.keys()
     [s1*s2*s1, s2, s3*s2*s3, s2*s3*s1*s2*s3*s1*s2, s1, s3*s1*s2*s3*s1, s1*s2*s3*s2*s1, s2*s3*s2, s3]
 
-If instead you want a dictionary whose keys are the roots and whose values are
-the reflections, you may use the inverse family::
+If instead you want a dictionary whose keys are the roots and whose
+values are the reflections, you may use the inverse family::
 
-    sage: altref=W.reflections().inverse_family(); altref
+    sage: altref = W.reflections().inverse_family(); altref
     Finite family {(1, 0, 0): s1*s2*s3*s2*s1, (1, 0, 1): s3*s1*s2*s3*s1, (0, 1, 0): s2*s3*s2,
     (0, 1, -1): s2, (1, 0, -1): s1*s2*s1, (0, 1, 1): s3*s2*s3, (1, 1, 0): s2*s3*s1*s2*s3*s1*s2,
     (0, 0, 1): s3, (1, -1, 0): s1}
@@ -109,9 +108,9 @@
     sage: altref[a1+a2+a3]
     s1*s2*s3*s2*s1
 
-The Weyl group is implemented as a GAP Matrix group. You therefore
-can display its character table. The character table is
-returned as a string, which you can print::
+The Weyl group is implemented as a GAP matrix group. You therefore can
+display its character table. The character table is returned as a
+string, which you can print::
 
     sage: print WeylGroup("D4").character_table()
     CT1
@@ -136,16 +135,16 @@
     X.13     8  .  .  1  .  .  .  .  .  . -1  . -8
 
 
-Affine Weyl Groups
--------------------
+Affine Weyl groups
+------------------
 
-Affine Weyl Groups may be created the same way. You simply begin
-with an affine Cartan type::
+Affine Weyl groups may be created the same way. You simply begin with
+an affine Cartan type::
 
     sage: W = WeylGroup(['A',2,1],prefix="s")
     sage: W.cardinality()
     +Infinity
-    sage: [s0,s1,s2]=W.simple_reflections()
+    sage: [s0,s1,s2] = W.simple_reflections()
     sage: s0*s1*s2*s1*s0
     s0*s1*s2*s1*s0
 
@@ -154,130 +153,119 @@
 extracted as follows::
 
     sage: W = WeylGroup(['A',2,1],prefix="s")
-    sage: W1=W.classical(); W1
+    sage: W1 = W.classical(); W1
     Parabolic Subgroup of the Weyl Group of type ['A', 2, 1] (as a matrix group
     acting on the root space)
     sage: W1.simple_reflections()
     Finite family {1: s1, 2: s2}
 
-Although W1 in this example is isomorphic to WeylGroup("A2") it
+Although ``W1`` in this example is isomorphic to ``WeylGroup("A2")`` it
 has a different matrix realization::
 
     sage: for s in WeylGroup(['A',2,1]).classical().simple_reflections():
-    ....:    print s
-    ....:    print
-    ....:
+    ...      print s
+    ...      print
+    ...
     [ 1  0  0]
     [ 1 -1  1]
     [ 0  0  1]
-
+    <BLANKLINE>
     [ 1  0  0]
     [ 0  1  0]
     [ 1  1 -1]
 
     sage: for s in WeylGroup(['A',2]).simple_reflections():
-    ....:    print s
-    ....:    print
-    ....:
+    ...      print s
+    ...      print
+    ...
     [0 1 0]
     [1 0 0]
     [0 0 1]
-
+    <BLANKLINE>
     [1 0 0]
     [0 0 1]
     [0 1 0]
 
+
 Bruhat order
 ------------
 
 The Bruhat partial order on the Weyl group may be defined as follows.
 
-If :math:`u,v \in W`, find a reduced expression of :math:`v` into a product
-of simple reflections: :math:`v=s_1\cdots s_n`. (It is not assumed
-that the :math:`s_i` are distinct.) If omitting some of the :math:`s_i`
-gives a product that represents :math:`u`, then :math:`u \le v`.
+If `u,v \in W`, find a reduced expression of `v` into a product of
+simple reflections: `v = s_1 \cdots s_n`. (It is not assumed that the
+`s_i` are distinct.) If omitting some of the `s_i` gives a product
+that represents `u`, then `u \le v`.
 
-The Bruhat order is implemented in Sage as a method of Coxeter
-groups, and so it is available for Weyl groups, classical or
-affine.
+The Bruhat order is implemented in Sage as a method of Coxeter groups,
+and so it is available for Weyl groups, classical or affine.
 
-If :math:`u`, :math:`v\in W` then ``u.bruhat_le(v)`` returns true of
-:math:`u\le v` in the Bruhat order.
+If `u`, `v \in W` then ``u.bruhat_le(v)`` returns true of
+`u \le v` in the Bruhat order.
 
-If :math:`u\le v` then The *Bruhat interval* :math:`[u,v]` is defined
-to be the set of all :math:`t` such that :math:`u\le t\le v`. One
-might try to implement this as follows::
+If `u \le v` then The *Bruhat interval* `[u,v]` is defined to be the
+set of all `t` such that `u \le t \le v`. One might try to implement
+this as follows::
 
     sage: W = WeylGroup("A2",prefix="s")
     sage: [s1,s2] = W.simple_reflections()
     sage: def bi(u,v) : return [t for t in W if u.bruhat_le(t) and t.bruhat_le(v)]
-    ....:
+    ...
     sage: bi(s1,s1*s2*s1)
     [s1, s1*s2, s1*s2*s1, s2*s1]
 
-This would not be a good definition since it would fail
-if :math:`W` is affine and be inefficient of :math:`W` is large. Sage
-has a Bruhat interval method::
+This would not be a good definition since it would fail if `W` is
+affine and be inefficient of `W` is large. Sage has a Bruhat interval
+method::
 
     sage: W.bruhat_interval(s1,s1*s2*s1)
     [s1*s2*s1, s2*s1, s1*s2, s1]
 
 This works even for affine Weyl groups.
 
-The Bruhat Graph
+
+The Bruhat graph
 ----------------
 
 References:
 
-- Carrell, The Bruhat graph of a Coxeter group, a conjecture of Deodhar, and
-  rational smoothness of Schubert varieties, in Algebraic groups
-  and their generalizations: classical methods, AMS Proc. Sympos. Pure Math., 56,
-  53--61 (1994).
+- [Carrell1994]_
 
-- Deodhar, Vinay V., Some characterizations of Bruhat ordering on a
-  Coxeter group and determination of the relative Moebius function,
-  Invent. Math., 39, 1977, 2, 187--198.
+- [Deodhar1977]_
 
-- Dyer, The nil Hecke ring and Deodhar's conjecture on Bruhat intervals,
-  Invent. Math., 111, 1993, 3, 571--574.
+- [Dyer1993]_
 
-- Bump and Nakasuji, Casselman's basis of Iwahori vectors and the Bruhat order,
-  http://arxiv.org/abs/1002.2996.
+- [BumpNakasuji2010]_
 
-The *Bruhat Graph* is a structure on the Bruhat interval.
-Suppose that :math:`u\le v`. The vertices of the graph are
-:math:`x` with :math:`u\le x\le v`. There is a vertex connecting
-:math:`x,y\in[x,y]` if :math:`x = y.r` where :math:`r` is a reflection.
-If this is true then either :math:`x < y` or :math:`y < x`.
+The *Bruhat Graph* is a structure on the Bruhat interval. Suppose that
+`u \le v`. The vertices of the graph are `x` with `u \le x \le v`.
+There is a vertex connecting `x,y \in [x,y]` if `x = y.r` where `r` is
+a reflection. If this is true then either `x < y` or `y < x`.
 
-If :math:`W` is a classical Weyl group the Bruhat graph is
-implemented in Sage::
+If `W` is a classical Weyl group the Bruhat graph is implemented in Sage::
 
     sage: W = WeylGroup("A3",prefix="s")
-    sage: [s1,s2,s3]=W.simple_reflections()
-    sage: bg=W.bruhat_graph(s2,s2*s1*s3*s2); bg
+    sage: [s1,s2,s3] = W.simple_reflections()
+    sage: bg = W.bruhat_graph(s2,s2*s1*s3*s2); bg
     Digraph on 10 vertices
     sage: bg.show3d()
 
-The Bruhat graph has interesting regularity properties
-that were investigated by Carrell and Peterson. It is
-a regular graph if both the Kazhdan Lusztig polynomials
-:math:`P_{u,v}` and :math:`P_{w_0v,w_0u}` are 1, where :math:`w_0` is the
-long Weyl group element. It is closely related to the
-*Deodhar conjecture* which was proved by Deodhar,
-Carrell and Peterson, Dyer and Polo.
+The Bruhat graph has interesting regularity properties that were
+investigated by Carrell and Peterson. It is a regular graph if both
+the Kazhdan Lusztig polynomials `P_{u,v}` and `P_{w_0v,w_0u}` are 1,
+where `w_0` is the long Weyl group element. It is closely related to
+the *Deodhar conjecture* which was proved by Deodhar, Carrell and
+Peterson, Dyer and Polo.
 
-Deodhar proved that if :math:`u<v` then the Bruhat interval
-:math:`[u,v]` contains as many elements of odd length as it
-does of even length. We observe that often this can be
-strengthened: if there exists a reflection :math:`r` such
-that left (or right) multiplication by :math:`r` takes the
-Bruhat interval :math:`[u,v]` to itself, then this gives
-an explicit bijection between the elements of odd and
-even length in :math:`[u,v]`.
+Deodhar proved that if `u < v` then the Bruhat interval `[u,v]`
+contains as many elements of odd length as it does of even length. We
+observe that often this can be strengthened: if there exists a
+reflection `r` such that left (or right) multiplication by `r` takes
+the Bruhat interval `[u,v]` to itself, then this gives an explicit
+bijection between the elements of odd and even length in `[u,v]`.
 
-Let us search for such reflections. Put the following
-commands in a file and load or attach the file::
+Let us search for such reflections. Put the following commands in a
+file and load or attach the file::
 
     W = WeylGroup("A3",prefix="s")
     [s1,s2,s3]=W.simple_reflections()
@@ -294,18 +282,15 @@
 Now inspect the output of this command::
 
     sage: for v in W:
-    ....:    for u in W.bruhat_interval(1,v):
-    ....:       if u != v:
-    ....:          print u,v,find_reflection(u,v)
+    ...      for u in W.bruhat_interval(1,v):
+    ...         if u != v:
+    ...            print u,v,find_reflection(u,v)
 
-This shows that the Bruhat interval is stabilized by
-a reflection for all pairs :math:`(u,v)` with :math:`u<v` except
-the following two: :math:`s_3s_1,s_1s_2s_3s_2s_1` and
-:math:`s_2,s_2s_3s_1s_2`. Now these are precisely the pairs
-such that :math:`u\prec v` in the notation of Kazhdan and
-Lusztig, and :math:`l(v)-l(u) > 1`. One should not rashly
-suppose that this is a general characterization of
-the pairs :math:`(u,v)` such that no reflection stabilizes
-the Bruhat interval, for this is not true, but it does
-suggest that the question is worthy of further
-investigation.
+This shows that the Bruhat interval is stabilized by a reflection for
+all pairs `(u,v)` with `u < v` except the following two:
+`s_3s_1,s_1s_2s_3s_2s_1` and `s_2,s_2s_3s_1s_2`. Now these are
+precisely the pairs such that `u\prec v` in the notation of Kazhdan
+and Lusztig, and `l(v)-l(u) > 1`. One should not rashly suppose that
+this is a general characterization of the pairs `(u,v)` such that no
+reflection stabilizes the Bruhat interval, for this is not true, but
+it does suggest that the question is worthy of further investigation.
