caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [MLPost] Curly brances
@ 2010-03-05 16:51 Alexandre Pilkiewicz
  2010-03-06  9:06 ` [Caml-list] " Johannes Kanig
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Pilkiewicz @ 2010-03-05 16:51 UTC (permalink / raw)
  To: caml-list

Dear list

I'm sorry if that's the wrong list, but mlpost doesn't seem to have
it's own list.

I'm starting to use (quite happily!) MLPost for some drawing, and it
works perfectly. But now I'm trying some more advance things, and I'm
stuck:

I would like to draw variable size curly braces, pretty much like
\underbrace would do in LaTeX. More specifically, I want to draw 16
boxes horizontally alligned (representing 16 bits of a VM
instruction), and "select" (by a curly brace) say the 4 first and say
it's the opcode, and then the 12 next and say it's the argument.

How could I do that?

Thanks in advance.

Alexandre Pilkiewicz


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] [MLPost] Curly brances
  2010-03-05 16:51 [MLPost] Curly brances Alexandre Pilkiewicz
@ 2010-03-06  9:06 ` Johannes Kanig
  2010-03-06 11:45   ` Alexandre Pilkiewicz
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Kanig @ 2010-03-06  9:06 UTC (permalink / raw)
  To: Alexandre Pilkiewicz; +Cc: caml-list

Hi,

On Fri, Mar 5, 2010 at 5:51 PM, Alexandre Pilkiewicz
<alexandre.pilkiewicz@polytechnique.org> wrote:
> I'm sorry if that's the wrong list, but mlpost doesn't seem to have
> it's own list.

You can either use the mlpost-users list on mlpost's ocamlforge site -
it hasn't seen much use yet, but this shouldn't hold you off - or
simply send an email to one of the developers.

> I would like to draw variable size curly braces,

Unfortunately, this is trickier than one might think. TeX itself makes
use of some special characters in the font to do it. However, there
still are several possibilities.

The first is to simply scale the "{" character to the right size,
using either Picture.tex or Box.tex and the corresponding xscale /
yscale functions. However, it's difficult to get it right, it never
has quite the right proportions, and rarely looks good.

The second option is to obtain the intended size (using Box.height /
Box.width etc.), get a float value of this size using the
Concrete.float_of_num function and generate the curly brace using the
corresponding latex macro.

The third option would be to use the same trick as latex does
(aligning several characters of the font) in mlpost, but off the top
of my head I couldn't do it right now.

We really should put such a function in the interface ...

Johannes

-- 
Johannes Kanig
johannes.kanig@lri.fr


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] [MLPost] Curly brances
  2010-03-06  9:06 ` [Caml-list] " Johannes Kanig
@ 2010-03-06 11:45   ` Alexandre Pilkiewicz
  2010-03-06 15:22     ` Johannes Kanig
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Pilkiewicz @ 2010-03-06 11:45 UTC (permalink / raw)
  To: Johannes Kanig; +Cc: caml-list

Hi

Thanks for the answer

2010/3/6 Johannes Kanig <johannes.kanig@gmail.com>:
> The second option is to obtain the intended size (using Box.height /
> Box.width etc.), get a float value of this size using the
> Concrete.float_of_num function and generate the curly brace using the
> corresponding latex macro.

I'm trying that one and it seems pretty good, except that my mlpost
(compiled from godi) does not support Concrete. Is it because I'm on a
mac, or for something else ? Also, it's version 0.7.1, which is not up
to date (but I don't like to install caml software by hand when it is
in godi).

I can already do my drawing since I know the size of my object, so thank you!

Alexnadre


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] [MLPost] Curly brances
  2010-03-06 11:45   ` Alexandre Pilkiewicz
@ 2010-03-06 15:22     ` Johannes Kanig
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Kanig @ 2010-03-06 15:22 UTC (permalink / raw)
  To: Alexandre Pilkiewicz; +Cc: caml-list

On Sat, Mar 6, 2010 at 12:45 PM, Alexandre Pilkiewicz
<alexandre.pilkiewicz@polytechnique.org> wrote:
> my mlpost
> (compiled from godi) does not support Concrete.

Normally the GODI package should support everything. The output of the
./configure script (at the beginning of the GODI output) prints if it
uses the cairo backend (in the 0.7.x versions, Concrete is still part
of the cairo backend; this will be better in 0.8). You need bitstring
and the cairo-bindings for this, but the GODI package has the right
dependencies.

Johannes

-- 
Johannes Kanig
johannes.kanig@lri.fr


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-06 15:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-05 16:51 [MLPost] Curly brances Alexandre Pilkiewicz
2010-03-06  9:06 ` [Caml-list] " Johannes Kanig
2010-03-06 11:45   ` Alexandre Pilkiewicz
2010-03-06 15:22     ` Johannes Kanig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).