From p.murrell at auckland.ac.nz  Mon Sep 13 05:38:50 2010
From: p.murrell at auckland.ac.nz (Paul Murrell)
Date: Mon, 13 Sep 2010 15:38:50 +1200
Subject: [Rd] [R] scalable < > delimiters in plotmath
In-Reply-To: <C28E4EB5-346D-48F0-BE9E-33A6AF74D2B3@comcast.net>
References: <AANLkTikJPdOpuDyEXyThi8-SDf1qp4RUD73K2U8mKD=O@mail.gmail.com>	<AANLkTimmFzDvrg5aEkEXXhFoWUf+eOKXk==PB6O5wrpu@mail.gmail.com>	<AANLkTimTbZ-npnPfG7E_CcR+3FUdxxKXnRf8posB-CO8@mail.gmail.com>	<4C8C2642.8090607@ucalgary.ca>	<EEFDD2EF-421E-4A6D-B130-499CF6440C38@comcast.net>	<AANLkTimaZnbJr=zaOxxz=Shon4KOjnxLNmOtUTe+Qyg1@mail.gmail.com>	<D39BC898-BDB2-4781-8E0B-8933B528A389@comcast.net>
	<AANLkTin=V6FdwGWUNpDPstKoD0RMFi_32n2kdUJ1gbcS@mail.gmail.com>
	<4C8D33E7.8000100@auckland.ac.nz>
	<C28E4EB5-346D-48F0-BE9E-33A6AF74D2B3@comcast.net>
Message-ID: <4C8D9CCA.5080208@auckland.ac.nz>

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/



[Rd] [R] scalable < > delimiters in plotmath
Paul Murrell