ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Descriptions/enumerations with a background
@ 2002-09-10 10:52 Duncan Hothersall
  2002-09-16 20:05 ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Duncan Hothersall @ 2002-09-10 10:52 UTC (permalink / raw)


Hello all,

I have been trying to set up an enumeration to have a background screen.
Having completely failed, I ended up putting a \startbackground ...
\stopbackground pair inside the \startsubactivity ... \stopsubactivity, but
this does strange things with page breaks, presumbly because it is
interfering with the glue between the enumeration title and the body of it.

Can anyone help me with a \defineenumeration or \setupenumeration parameter
that will make the background go grey? Here's what I have up top:

\defineenumeration[activity]
	[text=Activity,
	before={\blank[2*big]},
	after={\blank[2*big]}]

\setupenumerations[activity]
	[headstyle=\ss\tfa]

\setupbackground
	[background=screen,
	corner=round,
	offset=6pt]

Here's what I currently do, which doesn't work well:

\startsubactivity
\startbackground
This text sometimes jumps over a page break even when there is lots of space
on the page.

It can have more than one paragraph in it.
\stopbackground
\stopsubactivity

And here's what I'd like to do:

\startsubactivity
This text behaves well and has a grey box behind it.

It can have more than one paragraph in it too.
\stopsubactivity

Any pointers as to what to put at the top to make the bottom happen would be
gratefully received.

Thanks,

Duncan


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

* Re: Descriptions/enumerations with a background
  2002-09-10 10:52 Descriptions/enumerations with a background Duncan Hothersall
@ 2002-09-16 20:05 ` Hans Hagen
  2002-09-17 16:14   ` Duncan Hothersall
  2002-09-19 14:05   ` MathML questions Duncan Hothersall
  0 siblings, 2 replies; 9+ messages in thread
From: Hans Hagen @ 2002-09-16 20:05 UTC (permalink / raw)
  Cc: ConTeXt Mailing List

At 08:22 AM 9/10/2002 +0100, Duncan Hothersall wrote:
>Hello all,
>
>I have been trying to set up an enumeration to have a background screen.
>Having completely failed, I ended up putting a \startbackground ...
>\stopbackground pair inside the \startsubactivity ... \stopsubactivity, but
>this does strange things with page breaks, presumbly because it is
>interfering with the glue between the enumeration title and the body of it.
>
>Can anyone help me with a \defineenumeration or \setupenumeration parameter
>that will make the background go grey? Here's what I have up top:
>
>\defineenumeration[activity]
>         [text=Activity,
>         before={\blank[2*big]},
>         after={\blank[2*big]}]
>
>\setupenumerations[activity]
>         [headstyle=\ss\tfa]
>
>\setupbackground
>         [background=screen,
>         corner=round,
>         offset=6pt]
>
>Here's what I currently do, which doesn't work well:
>
>\startsubactivity
>\startbackground
>This text sometimes jumps over a page break even when there is lots of space
>on the page.
>
>It can have more than one paragraph in it.
>\stopbackground
>\stopsubactivity

hm, probably it's better to move the background commands out of the 
subactivity

>And here's what I'd like to do:
>
>\startsubactivity
>This text behaves well and has a grey box behind it.
>
>It can have more than one paragraph in it too.
>\stopsubactivity
>
>Any pointers as to what to put at the top to make the bottom happen would be
>gratefully received.

The good news is:

\definetextbackground
   [activitybg]
   [location=paragraph,
    before={\blank[2*big]},
    after={\blank[2*big]}]

\defineenumeration
   [activity]
   [text=Activity,
    before=\startactivitybg,
    after=\stopactivitybg,
    headstyle=\ss\tfa]

\starttext

\startactivity
This text behaves well and has a grey box behind it. \par
It can have more than one paragraph in it too.       \par
It can have more than one paragraph in it too.       \par
\stopactivity

\stoptext

However, it will fail in your version due to a grouping mix up 
(before/after need to next properly); it's just a few lines that need to be 
swapped; i will post a new beta version.

[this new backgrounder is still under construction but will stabalize the 
next couple of month]

[a few more settings are needed to get the rounding and an offset, more on 
that later]

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------


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

* RE: Descriptions/enumerations with a background
  2002-09-16 20:05 ` Hans Hagen
@ 2002-09-17 16:14   ` Duncan Hothersall
  2002-09-19 14:05   ` MathML questions Duncan Hothersall
  1 sibling, 0 replies; 9+ messages in thread
From: Duncan Hothersall @ 2002-09-17 16:14 UTC (permalink / raw)


I wrote:
> >I have been trying to set up an enumeration to have a background screen.
Hans wrote:
> However, it will fail in your version due to a grouping mix up
> (before/after need to next properly); it's just a few lines that
> need to be
> swapped; i will post a new beta version.

That would be great, thanks.

> [this new backgrounder is still under construction but will stabalize the
> next couple of month]
>
> [a few more settings are needed to get the rounding and an
> offset, more on
> that later]

Look forward to that.

Duncan


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

* MathML questions
  2002-09-16 20:05 ` Hans Hagen
  2002-09-17 16:14   ` Duncan Hothersall
@ 2002-09-19 14:05   ` Duncan Hothersall
  2002-09-19 16:00     ` Hans Hagen
  1 sibling, 1 reply; 9+ messages in thread
From: Duncan Hothersall @ 2002-09-19 14:05 UTC (permalink / raw)


I've been very impressed with the ability to set MathML mark-up with
ConTeXt, but in contrast to when I had my own translation running, where I
could find and fix bugs myself I find it much more difficult to fix things
that are going wrong now (although much less is going wrong anyway...)

I have two questions:

1. How can I fix an entity not being rendered? When I use, e.g. unicode 22C5
(a ċ), they come out as the word "sdot" in a frame. When I look in
base/xtag-meb.tex the definitions all look right (\defineMMLentity sdot
22C5 {\cdot} ...) but the output doesn't seem to work.

I'm using the default CM font settings so I don't think it's that, and lots
of other special characters render well, so I assume it's a definition
problem but can't identify it. Is xtag-meb.tex loaded by default with MathML
processing, and if not, how can I load it?

2. When using visual rather than semantic mark-up, large equations,
especially with mtable elements in them, seem to generate a lot of

! Missing \right. inserted.

errors. I can post code if necessary, but does this ring any bells?

Thanks much,

Duncan


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

* Re: MathML questions
  2002-09-19 14:05   ` MathML questions Duncan Hothersall
@ 2002-09-19 16:00     ` Hans Hagen
  2002-09-23 10:48       ` MathML questions (long) Duncan Hothersall
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2002-09-19 16:00 UTC (permalink / raw)
  Cc: ConTeXt Mailing List

At 03:05 PM 9/19/2002 +0100, Duncan Hothersall wrote:
>I've been very impressed with the ability to set MathML mark-up with
>ConTeXt, but in contrast to when I had my own translation running, where I
>could find and fix bugs myself I find it much more difficult to fix things
>that are going wrong now (although much less is going wrong anyway...)
>
>I have two questions:
>
>1. How can I fix an entity not being rendered? When I use, e.g. unicode 22C5
>(a ċ), they come out as the word "sdot" in a frame. When I look in
>base/xtag-meb.tex the definitions all look right (\defineMMLentity sdot
>22C5 {\cdot} ...) but the output doesn't seem to work.

hm, can you provide me an example source? (maybe this filter is not loaded 
at all)

>I'm using the default CM font settings so I don't think it's that, and lots
>of other special characters render well, so I assume it's a definition
>problem but can't identify it. Is xtag-meb.tex loaded by default with MathML
>processing, and if not, how can I load it?
>
>2. When using visual rather than semantic mark-up, large equations,
>especially with mtable elements in them, seem to generate a lot of
>
>! Missing \right. inserted.
>
>errors. I can post code if necessary, but does this ring any bells?

I need code indeed.

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------


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

* RE: MathML questions (long)
  2002-09-19 16:00     ` Hans Hagen
@ 2002-09-23 10:48       ` Duncan Hothersall
  2002-09-24  7:46         ` Hans Hagen
  2002-09-24  7:53         ` Hans Hagen
  0 siblings, 2 replies; 9+ messages in thread
From: Duncan Hothersall @ 2002-09-23 10:48 UTC (permalink / raw)
  Cc: ConTeXt Mailing List

> >1. How can I fix an entity not being rendered? When I use, e.g.
> unicode 22C5
> >(a ċ), they come out as the word "sdot" in a frame. When I look in
> >base/xtag-meb.tex the definitions all look right (\defineMMLentity sdot
> >22C5 {\cdot} ...) but the output doesn't seem to work.
>
> hm, can you provide me an example source? (maybe this filter is
> not loaded
> at all)

\startXMLdata
<math>
<mrow><mtext>M</mtext><msub><mtext>U</mtext><mi>a</mi></msub><mo>=</mo><msub
><mtext>P</mtext><mi>a</mi></msub><mo>&sdot;</mo><mtext>M</mtext><msub><mtex
t>U</mtext><mi>e</mi></msub></mrow></math>
\stopXMLdata

I haven't put anything particularly relevant in the preamble - should I do
something to make sure the filter gets loaded? Other entities, like &prime;
and suchlike, render perfectly. Thanks.

> >2. When using visual rather than semantic mark-up, large equations,
> >especially with mtable elements in them, seem to generate a lot of
> >
> >! Missing \right. inserted.
> >
> >errors. I can post code if necessary, but does this ring any bells?
>
> I need code indeed.

Okay; it's quite long and ugly. I have spaced it out here for clarity but in
the original it was all one line. This is code exported by MathType, which
is the pay-for upgrade of Word equation editor.

\startXMLdata
<formula>
  <math>
    <mtable>
      <mtr>
        <mtd>
          <msub>
            <mtext>W</mtext>
            <mi>i</mi>
          </msub>
          <mo>=</mo>
          <msup>
            <mi>&lambda;</mi>
            <mo>&prime;</mo>
          </msup>
          <msub>
            <mi>&tau;</mi>
            <mi>i</mi>
          </msub>
          <mrow>
            <mo>[</mo>
            <mrow>
              <mn>1</mn>
              <mo>+</mo>
              <mo>(</mo>
              <mi>&mu;</mi>
              <mo>/</mo>
              <msup>
                <mi>&lambda;</mi>
                <mo>&prime;</mo>
              </msup>
              <msub>
                <mi>&tau;</mi>
                <mi>i</mi>
              </msub>
              <mo>)</mo>
              <mo>(</mo>
              <msub>
                <mtext>Q</mtext>
                <mi>i</mi>
              </msub>
              <mo>&minus;</mo>
              <mi>&kappa;</mi>
              <mo>&sdot;</mo>
              <msub>
                <mtext>R</mtext>
                <mi>i</mi>
              </msub>
              <mo>)</mo>
            </mrow>
            <mo>]</mo>
          </mrow>
        </mtd>
      </mtr>
      <mtr>
        <mtd>
          <msub>
            <mtext>W</mtext>
            <mi>n</mi>
          </msub>
          <mo>=</mo>
          <msup>
            <mi>&lambda;</mi>
            <mo>&prime;</mo>
          </msup>
          <msub>
            <mi>&tau;</mi>
            <mi>n</mi>
          </msub>
          <mrow>
            <mo>[</mo>
            <mrow>
              <mn>1</mn>
              <mo>+</mo>
              <mo>(</mo>
              <mi>&mu;</mi>
              <mo>/</mo>
              <msup>
                <mi>&lambda;</mi>
                <mo>&prime;</mo>
              </msup>
              <msub>
                <mi>&tau;</mi>
                <mi>n</mi>
              </msub>
              <mo>)</mo>
              <mo>(</mo>
              <msub>
                <mtext>Q</mtext>
                <mi>n</mi>
              </msub>
              <mo>&minus;</mo>
              <mi>&kappa;</mi>
              <mo>&sdot;</mo>
              <msub>
                <mtext>R</mtext>
                <mi>n</mi>
              </msub>
              <mo>)</mo>
            </mrow>
            <mo>]</mo>
          </mrow>
        </mtd>
      </mtr>
    </mtable>
  </math>
</formula>
\stopXMLdata

The output I get is:

[25.5]
! Missing \right. inserted.
<inserted text>
                \right .
<to be read again>
                   $
\MMLpTABLEa ...LpTABLE \let \MMLpTD \MMLpTABLE #2$
                                                  }\fi \ifconditional
\mmlTA...
l.1 ...}}\xmlr {mo}{X}{}{)}}\xmlr {mo}{X}{}{]}}}}}
                                                  \empty \empty
\doXMLremapdata ...remappedXMLdata \empty \empty }
                                                  #3\stopXMLmapping \egroup
l.1 ...o>]</mo></mrow></mtd></mtr></mtable></math>
                                                   </formula>
<gobblespaceto...
...
l.2367 \stopXMLdata
                   {}If you multiply out each expression on the right hand
s...
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

... repeated three times ...

! Missing \right. inserted.
<inserted text>
                \right .
<to be read again>
                   $
<template> $
            \hfil \endtemplate
\MMLpTR ... {\@col@amp@ }{#2}\the \XMLRtoks \crcr

<argument> ...r {mo}{X}{}{)}}\xmlr {mo}{X}{}{]}}}}
                                                  \xmlr {mtr}{X}{}{\xmlr
{mt...

\PLAINmatrix ...noalign {\kern -\baselineskip } #1
                                                  \crcr \mathstrut \crcr
\no...
...
l.2367 \stopXMLdata
                   {}If you multiply out each expression on the right hand
s...
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

! Missing \right. inserted.
<inserted text>
                \right .
<to be read again>
                   $
<template> $
            \hfil \endtemplate
\MMLpTR ... {\@col@amp@ }{#2}\the \XMLRtoks \crcr

<argument> ...r {mo}{X}{}{)}}\xmlr {mo}{X}{}{]}}}}
                                                  \xmlr {mtr}{X}{}{\xmlr
{mt...

\PLAINmatrix ...noalign {\kern -\baselineskip } #1
                                                  \crcr \mathstrut \crcr
\no...
...
l.2367 \stopXMLdata
                   {}If you multiply out each expression on the right hand
s...
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

! Missing \right. inserted.
<inserted text>
                \right .
<to be read again>
                   $
<template> $
            \hfil \endtemplate
\MMLpTR ... {\@col@amp@ }{#2}\the \XMLRtoks \crcr

\PLAINmatrix ...noalign {\kern -\baselineskip } #1
                                                  \crcr \mathstrut \crcr
\no...

\MMLpTABLEa ...e \let \next \matrix \fi \next {#2}
                                                  \endgroup
...
l.2367 \stopXMLdata
                   {}If you multiply out each expression on the right hand
s...
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

! Missing \right. inserted.
<inserted text>
                \right .
<to be read again>
                   $
<template> $
            \hfil \endtemplate
\MMLpTR ... {\@col@amp@ }{#2}\the \XMLRtoks \crcr

\PLAINmatrix ...noalign {\kern -\baselineskip } #1
                                                  \crcr \mathstrut \crcr
\no...

\MMLpTABLEa ...e \let \next \matrix \fi \next {#2}
                                                  \endgroup
...
l.2367 \stopXMLdata
                   {}If you multiply out each expression on the right hand
s...
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.


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

* RE: MathML questions (long)
  2002-09-23 10:48       ` MathML questions (long) Duncan Hothersall
@ 2002-09-24  7:46         ` Hans Hagen
  2002-09-24 13:14           ` Duncan Hothersall
  2002-09-24  7:53         ` Hans Hagen
  1 sibling, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2002-09-24  7:46 UTC (permalink / raw)
  Cc: ConTeXt Mailing List

At 11:48 AM 9/23/2002 +0100, Duncan Hothersall wrote:

>Okay; it's quite long and ugly. I have spaced it out here for clarity but in
>the original it was all one line. This is code exported by MathType, which
>is the pay-for upgrade of Word equation editor.

it took me a while to find out that the problem is in:

\defineXMLentity [{[}] {\getXMLentity{lbracket}}
\defineXMLentity [{]}] {\getXMLentity{rbracket}}  % was lbracket

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------


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

* RE: MathML questions (long)
  2002-09-23 10:48       ` MathML questions (long) Duncan Hothersall
  2002-09-24  7:46         ` Hans Hagen
@ 2002-09-24  7:53         ` Hans Hagen
  1 sibling, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2002-09-24  7:53 UTC (permalink / raw)
  Cc: ConTeXt Mailing List

At 11:48 AM 9/23/2002 +0100, Duncan Hothersall wrote:
> > >1. How can I fix an entity not being rendered? When I use, e.g.
> > unicode 22C5
> > >(a &cdot;), they come out as the word "sdot" in a frame. When I look in
> > >base/xtag-meb.tex the definitions all look right (\defineMMLentity sdot
> > >22C5 {\cdot} ...) but the output doesn't seem to work.

that part is not yet implemented (waiting for those fonts)

adding

   \defineXMLentity [sdot] {\mathematics\cdot}

to xtag-mml will help you out

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------


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

* RE: MathML questions (long)
  2002-09-24  7:46         ` Hans Hagen
@ 2002-09-24 13:14           ` Duncan Hothersall
  0 siblings, 0 replies; 9+ messages in thread
From: Duncan Hothersall @ 2002-09-24 13:14 UTC (permalink / raw)
  Cc: ConTeXt Mailing List

Brilliant, thanks. Once I had remembered that I needed to remake the format
it worked a treat.

Any chance of that new beta going up so that I can fix my textbackgrounds
issue too? ;)

Duncan

> -----Original Message-----
> Subject: RE: MathML questions (long)

> it took me a while to find out that the problem is in:
>
> \defineXMLentity [{[}] {\getXMLentity{lbracket}}
> \defineXMLentity [{]}] {\getXMLentity{rbracket}}  % was lbracket
>
> Hans


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

end of thread, other threads:[~2002-09-24 13:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-10 10:52 Descriptions/enumerations with a background Duncan Hothersall
2002-09-16 20:05 ` Hans Hagen
2002-09-17 16:14   ` Duncan Hothersall
2002-09-19 14:05   ` MathML questions Duncan Hothersall
2002-09-19 16:00     ` Hans Hagen
2002-09-23 10:48       ` MathML questions (long) Duncan Hothersall
2002-09-24  7:46         ` Hans Hagen
2002-09-24 13:14           ` Duncan Hothersall
2002-09-24  7:53         ` Hans Hagen

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).