scalable < > delimiters in plotmath
Hi [shifting to r-devel]
On 13/09/2010 8:43 a.m., David Winsemius wrote:
On Sep 12, 2010, at 4:11 PM, Paul Murrell wrote:
Hi On 13/09/2010 7:57 a.m., baptiste auguie wrote:
Oh, right I see. I was completely off then. Maybe it's not so easy to add<> delimiters after all, I'll have to look at the list of symbol pieces to see if these can be constructed too.
The plotmath stuff assumes a font with an Adobe Symbol encoding. The characters we have to play with are shown at http://www.stat.auckland.ac.nz/~paul/R/CM/AdobeSym.pdf . You can see the components of "growable" delimiters on the bottom two rows.
Hello Paul; Both Baptiste and I have looked at the plotmath.c code and it appears that only a few of those delimiters are supported. We specifically have tried to use the angle brackets:
> plot(1,1,
xlab=expression(bgroup(symbol(0xe1),atop(x,y),symbol(0xf1))))
Error in bgroup(symbol(225), atop(x, y), symbol(241)) :
invalid group delimiter
The supported delimiters appear to each be built up from three parts
that are then assembled within a bounding box and as far as I can
determine are limited to "|", "||", "[", "{", "(", ")", "}",and "}". I
needed to download the full source to find a copy, but I'm fairly sure
a guRu of your standing needs no help finding the code that handles
the bgroup display inside plotmath.c. I am not at my machine where I
was looking at it, but the code that I just found in expanded form on
the Internet bore your name as a copyright holder.
So I guess my feature request would be:
---add option for using scalable single character delimiters such as
Symbol(0xe1) and Symbol(0xe1).
Unfortunately, I don't think this is trivial. How are these supposed to scale? Just get drawn bigger? (which is unlikely to produce nice results because the lines will get thicker).
I'm guessing that the reason three-component delimiters were chosen is that it was easier to expand the middle section while not expanding the ends as much but that's just the guess of someone who is perusing without really being able to fully grasp the intricacies of what is being done.
That's about right. This is all modelled on TeX's equation formatting
algorithms. The Computer Modern fonts have this kind of extendable
components for very large delimiters, but for angled brackets it looks
like the TeX solution is just to offer various "big" versions. For
example, try the following TeX document ...
\documentclass{article}
\begin{document}
\[ \left\{
\begin{array}{ccc}
a & b & c \\
a & b & c \\
a & b & c \\
a & b & c \\
a & b & c \\
a & b & c \\
a & b & c \\
d & e & f \end{array}
\right\} \]
\[ \left\langle
\begin{array}{ccc}
a & b & c \\
a & b & c \\
a & b & c \\
a & b & c \\
a & b & c \\
a & b & c \\
a & b & c \\
d & e & f \end{array}
\right\rangle \]
\end{document}
Paul
Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz http://www.stat.auckland.ac.nz/~paul/