ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: Difficulties with \startformula
Date: Tue, 14 Jan 2014 18:36:38 +0100	[thread overview]
Message-ID: <52D575A6.5070004@wxs.nl> (raw)
In-Reply-To: <CAGMMSTBR9_J0Jxv=UGy8Kr23wrAPcd7R-2hGLVPQN17zeDR=xQ@mail.gmail.com>

On 1/14/2014 12:13 AM, Elspeth McGullicuddy wrote:
> Hi,
>
> 1- I put here a far too long example to show difficulties that I have
> with formulas in conjunction with framed:
> I haven't find a way to insert a formula (displaystyle, vertical
> mode), at the beginning of a \framed.

Here is a small example:

\nopdfcompression

\startTEXpage[offset=3cm]
     \hbox{$ x+y $}
\stopTEXpage

If you look in the pdf file you will see the following:

/FontBBox    [-1042 -3060 4082 3560]
/Ascent      3560
/CapHeight   683
/Descent     -3060
/ItalicAngle 0
/StemV       93
/XHeight     431

The less clever viewer can use that information for the selection 
dimensions. Acrobat instead uses the glyph properties.

If you run instead

\starttext
     \hbox{$$ x+y $$}
\stoptext

you will not get math at all because the $$ == an empty inline math so 
there a text font is used:

/FontBBox    [-422 -280 1394 1127]
/Ascent      1127
/CapHeight   683
/Descent     -280
/ItalicAngle 0
/StemV       91
/XHeight     431

In context,

     \hbox{\startformula x+y \stopformula}

boils down to

   \hbox{\par $$ x+y $$ \par}

plus some more so i decided to turn this into

\hbox{\par \Ustartdisplaymath x+y \Ustopdisplaymath \par}

Now, believe it it not, when I tested that one luatex crashed as we 
never thought about the fact that $$ is catched in the main loop and 
\Ustartdisplaymath falls through and creates havoc. So, after some 
debugging Luigi and I figured out that this was too messy to catch. Math 
magician Taco will fix it in luatex's parser part. So, be warned, don't 
this this trickery now.

In the meantime, i fixed context to deal with such matters. Of course 
that bug doesn't relate to your observations.

Hans





-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


      reply	other threads:[~2014-01-14 17:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-13 23:13 Elspeth McGullicuddy
2014-01-14 17:36 ` Hans Hagen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52D575A6.5070004@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).