\color affects following \right, put array cells in their own groups (#1845)

* \color affects following \right

Fix #1844 by giving `leftright` nodes a `rightColor` attribute for how
to color the right bracket.  Now `\color` sets the macro
`\current@color` in the current environment (in particular, resetting
after `\right`), just like `color.sty` does in LaTeX.  This is used to
specially pass the current color into any following `\right` and then
into the `leftright` parse node.

* Add test

* Put each array cell in its own group/namespace

* Improve cell group isolation, add test and TODO

* Improve comments
This commit is contained in:
Erik Demaine
2019-07-05 00:27:55 -04:00
committed by Kevin Barabash
parent 39da3f5119
commit 19d9d83ad3
8 changed files with 58 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -77,7 +77,11 @@ Cases: |
Colors:
tex: \blue{a}\textcolor{#0f0}{b}\textcolor{red}{c}
nolatex: different syntax and different scope
ColorImplicit: bl{ack\color{red}red\textcolor{green}{green}red\color{blue}blue}black
ColorImplicit:
\begin{array}{l}
bl{ack\color{red}red\textcolor{green}{green}red\color{blue}blue}black \\
black\left(black\color{red}red\right)black
\end{array}
ColorSpacing: \textcolor{red}{\displaystyle \int x} + 1
Colorbox: a \colorbox{teal} B \fcolorbox{blue}{red}{C} e+\colorbox{teal}x
DashesAndQuotes: |