Re: [NTG-context] Spacing between formula and texts

2007-09-21 Thread Wolfgang Schuster
On Thu, 20 Sep 2007 03:04:20 +0800
Zhichu Chen [EMAIL PROTECTED] wrote:

 Hi Wolfgang,
 
 On 9/20/07, Wolfgang Schuster [EMAIL PROTECTED] wrote:
 
  On Wed, 19 Sep 2007 23:30:26 +0800
  Zhichu Chen [EMAIL PROTECTED] wrote:
 
   \usemodule[units]
  
   \setupindenting[big]
   \indenting[always,next]
   % no, not, yes, always, never, first, next
  
   % \setupformulas[spacebefore=5em]
  
   \starttext
  
   Blah,
   blah, blah, blah, blah, blah, blah, blah, blah,
   blah, blah, blah, blah, blah, blah, blah, blah,
   blah, blah, blah, blah, blah, blah, blah, blah,
   blah, blah, blah, blah, blah, blah, blah, blah,
   I love the following formula:
   \placeformula[-]
 \startformula
   6.670 \times 10^{-11} \Newton \Times \Square \Meter \Per \Square
  \Kilo
   \Gram
 \stopformula
   which is very cool.
   which is very cool.
   which is very cool.
   which is very cool.
   which is very cool.
  
   % \showmathcharacters
  
   \stoptext
 
  Hi Chen,
 
  I can't give a real solution but only a workaround, the problem lies in
  the macro \beforedisplayspace which calls \docomplexdoblank which calls
  itself \presetindentation and this macro causes your real problem.
 
  You solve this now by placing \let\presetindentation\relax at the begin
  in your document or remove the next key for \setupindenting.
 
 
 Really! It works fine with first key. OK, I can just live with that,
 although I hope Hans will have time to fix it, it's not so cool with the
 first paragraph indented :)
 
 This is all what I can do for you in a few minutes, the rest is up to
  Hans to make a extra test in \beforedisplay or somewhere else to
  disable \preetindentation before a display formula.
 
  Wolfgang

Hi Chen,

you use the following code for the moment (untested):

\newif\ifquicksolution \quicksolutiontrue

\def\beforedisplayspace
  {\doifnot{\formulaparameter\c!spacebefore}\v!none
 {\quicksolutionfalse\blank[\formulaparameter\c!spacebefore]}}

\def\afterdisplayspace
  {\doifnot{\formulaparameter\c!spaceafter }\v!none
{\blank[\formulaparameter\c!spaceafter ]\quicksolutiontrue}}

\def\presetindentation
  
{\doifoutervmode{\ifindentfirstparagraph\else\ifquicksolution\noindentation\fi\fi}}

Wolfgang
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Spacing between formula and texts

2007-09-19 Thread Zhichu Chen
Hi,

I happened to review the output of my article and found one thing which is
not perfect for me. The spacing between a formula and its upper texts is not
treated well when I tuned with some indent things. Here is my test file

\usemodule[units]

\setupindenting[big]
\indenting[always,next]
% no, not, yes, always, never, first, next

% \setupformulas[spacebefore=5em]

\starttext

Blah,
blah, blah, blah, blah, blah, blah, blah, blah,
blah, blah, blah, blah, blah, blah, blah, blah,
blah, blah, blah, blah, blah, blah, blah, blah,
blah, blah, blah, blah, blah, blah, blah, blah,
I love the following formula:
\placeformula[-]
  \startformula
6.670 \times 10^{-11} \Newton \Times \Square \Meter \Per \Square \Kilo
\Gram
  \stopformula
which is very cool.
which is very cool.
which is very cool.
which is very cool.
which is very cool.

% \showmathcharacters

\stoptext


I'm really uncomfortable with that, and I want to solve it by myself. When I
looked up the indent macros in core-spa.tex, how complex is that. So I just
hope you guys could help me.

-- 
Best Regards
Chen


  Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
 No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
 tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
   | www.sinap.ac.cn

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Spacing between formula and texts

2007-09-19 Thread Zhichu Chen
Hi Wolfgang,

On 9/20/07, Wolfgang Schuster [EMAIL PROTECTED] wrote:

 On Wed, 19 Sep 2007 23:30:26 +0800
 Zhichu Chen [EMAIL PROTECTED] wrote:

  \usemodule[units]
 
  \setupindenting[big]
  \indenting[always,next]
  % no, not, yes, always, never, first, next
 
  % \setupformulas[spacebefore=5em]
 
  \starttext
 
  Blah,
  blah, blah, blah, blah, blah, blah, blah, blah,
  blah, blah, blah, blah, blah, blah, blah, blah,
  blah, blah, blah, blah, blah, blah, blah, blah,
  blah, blah, blah, blah, blah, blah, blah, blah,
  I love the following formula:
  \placeformula[-]
\startformula
  6.670 \times 10^{-11} \Newton \Times \Square \Meter \Per \Square
 \Kilo
  \Gram
\stopformula
  which is very cool.
  which is very cool.
  which is very cool.
  which is very cool.
  which is very cool.
 
  % \showmathcharacters
 
  \stoptext

 Hi Chen,

 I can't give a real solution but only a workaround, the problem lies in
 the macro \beforedisplayspace which calls \docomplexdoblank which calls
 itself \presetindentation and this macro causes your real problem.

 You solve this now by placing \let\presetindentation\relax at the begin
 in your document or remove the next key for \setupindenting.


Really! It works fine with first key. OK, I can just live with that,
although I hope Hans will have time to fix it, it's not so cool with the
first paragraph indented :)

This is all what I can do for you in a few minutes, the rest is up to
 Hans to make a extra test in \beforedisplay or somewhere else to
 disable \preetindentation before a display formula.

 Wolfgang

 ___
 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  : https://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net

 ___




-- 
Best Regards
Chen


  Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
 No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
 tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
   | www.sinap.ac.cn

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Spacing between formula and texts

2007-09-19 Thread Wolfgang Schuster
On Wed, 19 Sep 2007 23:30:26 +0800
Zhichu Chen [EMAIL PROTECTED] wrote:

 \usemodule[units]
 
 \setupindenting[big]
 \indenting[always,next]
 % no, not, yes, always, never, first, next
 
 % \setupformulas[spacebefore=5em]
 
 \starttext
 
 Blah,
 blah, blah, blah, blah, blah, blah, blah, blah,
 blah, blah, blah, blah, blah, blah, blah, blah,
 blah, blah, blah, blah, blah, blah, blah, blah,
 blah, blah, blah, blah, blah, blah, blah, blah,
 I love the following formula:
 \placeformula[-]
   \startformula
 6.670 \times 10^{-11} \Newton \Times \Square \Meter \Per \Square \Kilo
 \Gram
   \stopformula
 which is very cool.
 which is very cool.
 which is very cool.
 which is very cool.
 which is very cool.
 
 % \showmathcharacters
 
 \stoptext

Hi Chen,

I can't give a real solution but only a workaround, the problem lies in
the macro \beforedisplayspace which calls \docomplexdoblank which calls
itself \presetindentation and this macro causes your real problem.

You solve this now by placing \let\presetindentation\relax at the begin
in your document or remove the next key for \setupindenting.

This is all what I can do for you in a few minutes, the rest is up to
Hans to make a extra test in \beforedisplay or somewhere else to
disable \preetindentation before a display formula.

Wolfgang
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___