Re: [NTG-context] too much space because of margin notes

2006-07-11 Thread Aditya Mahajan
On Tue, 11 Jul 2006, Mojca Miklavec wrote:

 Hello,

 I would like to write a note in the margin next to some framed
 formula, but I guess that the formula starts a new paragraph and
 there's too much space left on the top of the frame. How can I fix
 that?

 \starttext

 \startframedtext

 \inmargin{some text in margin}
 \placeformula
 \startformula
 a+b=c
 \stopformula
 How can I get rid of that space?

 \stopframedtext

 \stoptext

See if margintext suits you better.

\margintext{some text in margin}
\placeformula.

This moves the text into the next paragraph.

Aditya
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] too much space because of margin notes

2006-07-11 Thread Hans Hagen
Mojca Miklavec wrote:
 Hello,

 I would like to write a note in the margin next to some framed
 formula, but I guess that the formula starts a new paragraph and
 there's too much space left on the top of the frame. How can I fix
 that?

 \starttext

 \startframedtext

 \inmargin{some text in margin}
 \placeformula
 \startformula
 a+b=c
 \stopformula
 How can I get rid of that space?

 \stopframedtext

 \stoptext
   
when using framed texts you run into problems with flushing, struts and the 
nature of boxes (vbox,vtop)

in such cases one can do several things 

\starttext

\showframe

\def\MyDisplayCorrection {\vskip-\lineheight}

\margintext{some text in margin}

\starttextbackground
\MyDisplayCorrection
\placeformula  \startformula  a+b=c \stopformula
\stoptextbackground

\stoptext

use a Correction macro that can be nilled (since some day we may have more 
control over math spacing and can fix the problem) 

Here is a nice alternative: 

\starttext

\margintext {some text in margin}

\setupframedtexts[background={YourTrick,MyTrick}]

\definelayer[MyTrick]

\startsetups MyTrick
  \setlayer[MyTrick]{\placemargintexts}
\stopsetups

\defineoverlay[YourTrick][\setups{MyTrick}]

\startframedtext

\placeformula
\startformula
a+b=c
\stopformula
\stopframedtext

\stoptext

I'm sure that yuou can explain this on the wiki 

(There is this Best Of Ruby Quiz book, maybe we should make a Best Of Context 
Quiz one ... ) 

Hans 



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] too much space because of margin notes

2006-07-10 Thread Mojca Miklavec
Hello,

I would like to write a note in the margin next to some framed
formula, but I guess that the formula starts a new paragraph and
there's too much space left on the top of the frame. How can I fix
that?

\starttext

\startframedtext

\inmargin{some text in margin}
\placeformula
\startformula
a+b=c
\stopformula
How can I get rid of that space?

\stopframedtext

\stoptext

Thank you very much,
Mojca
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context