ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \indenting[next] and math => no vertical space before the formula
@ 2008-04-24 10:15 Mikael Persson
  2008-04-24 11:29 ` Wolfgang Schuster
  0 siblings, 1 reply; 16+ messages in thread
From: Mikael Persson @ 2008-04-24 10:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear all,

I have a problem with \indenting[next] combined with math formulas.
Look at the example below. The space between the text above the
formula and the formula is way to small. This goes away if I change
next to for example yes.

Btw, this happens on my TeXLive 2007 on ubuntu at home, my ConTeXt
minimal from 2007-04-03 at work and on live.contextgarden.net (with
pdfTeX but not LuaTeX).

Do I misuse the indenting macros?

Thanks, Micke P

% test file
\setupindenting[yes,small]
\indenting[next]

\starttext
Hello World! This is just some dumb text to show the problem.
\startformula
a=b
\stopformula
Goodbye World! The space below the formula is OK.
\stoptext
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: \indenting[next] and math => no vertical space before the formula
  2008-04-24 10:15 \indenting[next] and math => no vertical space before the formula Mikael Persson
@ 2008-04-24 11:29 ` Wolfgang Schuster
  2008-04-24 14:27   ` Aditya Mahajan
  2008-04-28 18:17   ` Mikael Persson
  0 siblings, 2 replies; 16+ messages in thread
From: Wolfgang Schuster @ 2008-04-24 11:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, Apr 24, 2008 at 12:15 PM, Mikael Persson <mickep@gmail.com> wrote:
> Dear all,
>
> I have a problem with \indenting[next] combined with math formulas.
> Look at the example below. The space between the text above the
> formula and the formula is way to small. This goes away if I change
> next to for example yes.
>
> Btw, this happens on my TeXLive 2007 on ubuntu at home, my ConTeXt
> minimal from 2007-04-03 at work and on live.contextgarden.net (with
> pdfTeX but not LuaTeX).
>
> Do I misuse the indenting macros?
>
> Thanks, Micke P
>
> % test file
> \setupindenting[yes,small]
> \indenting[next]
>
> \starttext
> Hello World! This is just some dumb text to show the problem.
> \startformula
> a=b
> \stopformula
> Goodbye World! The space below the formula is OK.
> \stoptext

I could reproduce the result and have also a fix but I don't know what
the correct
reults should be and other people like Aditya should decide if it makes sense
to change the current behaviour.

\def\startdisplaymath
  {\ifgridsnapping
     \beforedisplayspace
     \snapmathtogrid\vbox
     \bgroup
     \informulatrue
    %\forgetall % breaks side floats
   \else
     \bgroup
     \parskip\formulaparskip % ! !
     \informulatrue
    %\forgetall % otherwise backgrounds fail
     \ifdim\lastskip<\zeropoint\else
       \par
       \ifvmode \ifdim\parskip>\zeropoint\relax
         \whitespace \vskip-\parskip % kind of forces and cancels again
       \fi \fi
     \fi
     \doif\displaygridcorrection{-\v!top}{\kern-\strutht}% new,
currently only option/default
     \beforedisplayspace
     \par
     \ifvmode
       \ifindentfirstparagraph
         \verticalstrut
         \vskip-\struttotal
         \vskip-\baselineskip
       \fi
     \fi
   \fi
   $$\setdisplaydimensions
   \setpredisplaysize\lastlinewidth
   \startinnermath}

I added the \ifindentfirstparagraph test before the last skip
upwards is executed.

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
___________________________________________________________________________________


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

* Re: \indenting[next] and math => no vertical space before the formula
  2008-04-24 11:29 ` Wolfgang Schuster
@ 2008-04-24 14:27   ` Aditya Mahajan
  2008-04-24 17:28     ` Hans Hagen
  2008-04-28 18:17   ` Mikael Persson
  1 sibling, 1 reply; 16+ messages in thread
From: Aditya Mahajan @ 2008-04-24 14:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 24 Apr 2008, Wolfgang Schuster wrote:

> On Thu, Apr 24, 2008 at 12:15 PM, Mikael Persson <mickep@gmail.com> wrote:
>> Dear all,
>>
>> I have a problem with \indenting[next] combined with math formulas.
>> Look at the example below. The space between the text above the
>> formula and the formula is way to small. This goes away if I change
>> next to for example yes.
>>
>> Btw, this happens on my TeXLive 2007 on ubuntu at home, my ConTeXt
>> minimal from 2007-04-03 at work and on live.contextgarden.net (with
>> pdfTeX but not LuaTeX).
>>
>> Do I misuse the indenting macros?
>>
>> Thanks, Micke P
>>
>> % test file
>> \setupindenting[yes,small]
>> \indenting[next]
>>
>> \starttext
>> Hello World! This is just some dumb text to show the problem.
>> \startformula
>> a=b
>> \stopformula
>> Goodbye World! The space below the formula is OK.
>> \stoptext
>
> I could reproduce the result and have also a fix but I don't know what
> the correct
> reults should be and other people like Aditya should decide if it makes sense
> to change the current behaviour.

The current behaviour is visually wrong, so it should be channged. I am 
not sure how.

Hans, if you agree with Wolfgang's fix, I think it should be included in 
core-mat.

Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: \indenting[next] and math => no vertical space before the formula
  2008-04-24 14:27   ` Aditya Mahajan
@ 2008-04-24 17:28     ` Hans Hagen
  2008-04-24 18:37       ` Mikael Persson
  0 siblings, 1 reply; 16+ messages in thread
From: Hans Hagen @ 2008-04-24 17:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Aditya Mahajan wrote:

> Hans, if you agree with Wolfgang's fix, I think it should be included in 
> core-mat.

i just wait till you send me a core-mat with fixes .. fixing whitespace 
is always a bit tricky ... test with/without whitespace as well as with 
grids

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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: \indenting[next] and math => no vertical space before the formula
  2008-04-24 17:28     ` Hans Hagen
@ 2008-04-24 18:37       ` Mikael Persson
  2008-04-24 18:43         ` Hans Hagen
  0 siblings, 1 reply; 16+ messages in thread
From: Mikael Persson @ 2008-04-24 18:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thank you Wolfgang, Aditya and Hans for your kind answers.

Today the new ubuntu was released, and I did upgrade. That was not too smart:

With the newer TeXLive in ubuntu 8.04 came an updated ConTeXt which
gave me the problem explained in
http://archive.contextgarden.net/message/20070830.154143.005528b8.en.html
again.

Since I am finishing my PhD thesis and really want to use the
utopia+fourier fonts, I downgraded to an old ConTeXt minimal for now.
I have not managed to get Wolfgang's solution to work (just tried to
copy that definition to my file, and that did not change the vertical
space. I will try to make the change in core-mat.tex now). However,
some questions remain:

1) I also tried the new context minimal with LuaTeX  (to see if it
worked better there) and found out that the fourier fonts are not
included in the minimals anymore. Are there any plans to include them?
Or to make some kind of package with these and other nice free fonts?

2) Will the problem from
http://archive.contextgarden.net/message/20070830.154143.005528b8.en.html
go away in the near future (of new versions)? From the answers to that
question I did not really get if the problem was a big one or not.

Best Regards, Micke P

PS I am impressed by the speed of LuaTeX. It compiled my document in
~20s instead of 1-2 minutes.

On Thu, Apr 24, 2008 at 7:28 PM, Hans Hagen <pragma@wxs.nl> wrote:
> Aditya Mahajan wrote:
>
>  > Hans, if you agree with Wolfgang's fix, I think it should be included in
>  > core-mat.
>
>  i just wait till you send me a core-mat with fixes .. fixing whitespace
>  is always a bit tricky ... test with/without whitespace as well as with
>  grids
>
>  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
>  -----------------------------------------------------------------
>
>
> ___________________________________________________________________________________
>  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
>  ___________________________________________________________________________________
>
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: \indenting[next] and math => no vertical space before the formula
  2008-04-24 18:37       ` Mikael Persson
@ 2008-04-24 18:43         ` Hans Hagen
  2008-04-24 19:14           ` Mikael Persson
  0 siblings, 1 reply; 16+ messages in thread
From: Hans Hagen @ 2008-04-24 18:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Mikael Persson wrote:

> 1) I also tried the new context minimal with LuaTeX  (to see if it
> worked better there) and found out that the fourier fonts are not
> included in the minimals anymore. Are there any plans to include them?
> Or to make some kind of package with these and other nice free fonts?

mojca will look into it (out of reach, mail etc now) since it came up 
last week

> 2) Will the problem from
> http://archive.contextgarden.net/message/20070830.154143.005528b8.en.html
> go away in the near future (of new versions)? From the answers to that
> question I did not really get if the problem was a big one or not.

depends on who wants to fix it -)


> PS I am impressed by the speed of LuaTeX. It compiled my document in
> ~20s instead of 1-2 minutes.

Due to mplib or in general? Some parts of mkiv can still be sped up, 
e.g. xml processing, but there's not that much more to gain in font 
handling (that is ... we're playing with runtime mp fonts and there we 
can gain a lot when the new img related features show up). Also, some 
mechanisms will be reimplemented and  as such be sped up.

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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: \indenting[next] and math => no vertical space before the formula
  2008-04-24 18:43         ` Hans Hagen
@ 2008-04-24 19:14           ` Mikael Persson
  2008-04-24 19:34             ` Hans Hagen
  0 siblings, 1 reply; 16+ messages in thread
From: Mikael Persson @ 2008-04-24 19:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

First, thank you Wolfgang, I tried to change it in the core-mat.tex
and it looks great now!

>  > 1) I also tried the new context minimal with LuaTeX  (to see if it
>  > worked better there) and found out that the fourier fonts are not
>  > included in the minimals anymore. Are there any plans to include them?
>  > Or to make some kind of package with these and other nice free fonts?
>
>  mojca will look into it (out of reach, mail etc now) since it came up
>  last week

sounds great!

>
>  > 2) Will the problem from
>  > http://archive.contextgarden.net/message/20070830.154143.005528b8.en.html
>  > go away in the near future (of new versions)? From the answers to that
>  > question I did not really get if the problem was a big one or not.
>
>  depends on who wants to fix it -)
>

I don't know what to do (and I am not a programmer), but if there is
some monkey-see-monkey-do work, I am happy to help.

>
>  > PS I am impressed by the speed of LuaTeX. It compiled my document in
>  > ~20s instead of 1-2 minutes.
>
>  Due to mplib or in general? Some parts of mkiv can still be sped up,
>  e.g. xml processing, but there's not that much more to gain in font
>  handling (that is ... we're playing with runtime mp fonts and there we
>  can gain a lot when the new img related features show up). Also, some
>  mechanisms will be reimplemented and  as such be sped up.

Hm, I hoped you would tell me why ;)
The document is a math document with a lot of references, 5 different
bibliographies. But no MetaPost graphics, just plain text + formulas.
It is about 100 pages at the moment. Could it maybe be the fact that I
am changing font? With LuaTeX I was using the lm fonts. I have a
feeling it takes a bit longer to load other fonts, but that might just
be a feeling from what is written in the terminal?

Micke P
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: \indenting[next] and math => no vertical space before the formula
  2008-04-24 19:14           ` Mikael Persson
@ 2008-04-24 19:34             ` Hans Hagen
  0 siblings, 0 replies; 16+ messages in thread
From: Hans Hagen @ 2008-04-24 19:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Mikael Persson wrote:
> First, thank you Wolfgang, I tried to change it in the core-mat.tex
> and it looks great now!
> 
>>  > 1) I also tried the new context minimal with LuaTeX  (to see if it
>>  > worked better there) and found out that the fourier fonts are not
>>  > included in the minimals anymore. Are there any plans to include them?
>>  > Or to make some kind of package with these and other nice free fonts?
>>
>>  mojca will look into it (out of reach, mail etc now) since it came up
>>  last week
> 
> sounds great!
> 
>>  > 2) Will the problem from
>>  > http://archive.contextgarden.net/message/20070830.154143.005528b8.en.html
>>  > go away in the near future (of new versions)? From the answers to that
>>  > question I did not really get if the problem was a big one or not.
>>
>>  depends on who wants to fix it -)
>>
> 
> I don't know what to do (and I am not a programmer), but if there is
> some monkey-see-monkey-do work, I am happy to help.
> 
>>  > PS I am impressed by the speed of LuaTeX. It compiled my document in
>>  > ~20s instead of 1-2 minutes.
>>
>>  Due to mplib or in general? Some parts of mkiv can still be sped up,
>>  e.g. xml processing, but there's not that much more to gain in font
>>  handling (that is ... we're playing with runtime mp fonts and there we
>>  can gain a lot when the new img related features show up). Also, some
>>  mechanisms will be reimplemented and  as such be sped up.
> 
> Hm, I hoped you would tell me why ;)
> The document is a math document with a lot of references, 5 different
> bibliographies. But no MetaPost graphics, just plain text + formulas.
> It is about 100 pages at the moment. Could it maybe be the fact that I
> am changing font? With LuaTeX I was using the lm fonts. I have a
> feeling it takes a bit longer to load other fonts, but that might just
> be a feeling from what is written in the terminal?

mkiv needs less fonts but they may be bigger (more glyphs)

at the end of a run you see the statistics, just write them down 
occasionally so that we can see the improvements

other reasons can be that some mem bugs have been removed over time adn 
that mkiv share more data, so that overall less memory is needed which 
in turn gives less garbage collection

try adding

\usemodule[timing]

to the top of the doc and one or more


\ShowUsage      {}
\ShowMemoryUsage{}
\ShowNodeUsage  {}

at the end ... it generates some pictures that show what takes most time


-----------------------------------------------------------------
                                           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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: \indenting[next] and math => no vertical space before the formula
  2008-04-24 11:29 ` Wolfgang Schuster
  2008-04-24 14:27   ` Aditya Mahajan
@ 2008-04-28 18:17   ` Mikael Persson
  2008-04-29  4:49     ` Aditya Mahajan
  1 sibling, 1 reply; 16+ messages in thread
From: Mikael Persson @ 2008-04-28 18:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello again,

* snip *
>
>  I could reproduce the result and have also a fix but I don't know what
>  the correct
>  reults should be and other people like Aditya should decide if it makes sense
>  to change the current behaviour.
>
>  \def\startdisplaymath
>   {\ifgridsnapping
>      \beforedisplayspace
>      \snapmathtogrid\vbox
* snip *
>  Wolfgang

This fix seems not to solve the problem entirely. With this fix
applied, If one now put a formula inside an enumeration one gets
"double" space before the formula. This is a test file that shows the
problem:

%%% Test file
\setupindenting[yes,small]
\indenting[next]

\def\testtext{This is just some text so we see better what happens.}

\def\testexpr{%
\par
\testtext
\startformula
f(x)= \sin(x)
\stopformula
\testtext
\par
}

\defineenumeration[example]
        [text=Example,
        location=serried,
        width=fit,
        distance=0.5em,
	way=bysection,
        ]

\starttext
\testexpr % OK if fix is applied, otherwise to little space before the formula
\startexample
\testexpr % Too much space before the formula if the fix is applied,
otherwise OK.
\stopexample

\stoptext

%%% Stop testfile

Best regards, Micke P

PS Hans, I save the timing testing for next time I try LuaTeX.
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: \indenting[next] and math => no vertical space before the formula
  2008-04-28 18:17   ` Mikael Persson
@ 2008-04-29  4:49     ` Aditya Mahajan
  2008-04-30  7:24       ` Mikael Persson
  0 siblings, 1 reply; 16+ messages in thread
From: Aditya Mahajan @ 2008-04-29  4:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 28 Apr 2008, Mikael Persson wrote:

> Hello again,
>
> * snip *
>>
>>  I could reproduce the result and have also a fix but I don't know what
>>  the correct
>>  reults should be and other people like Aditya should decide if it makes sense
>>  to change the current behaviour.
>>
>>  \def\startdisplaymath
>>   {\ifgridsnapping
>>      \beforedisplayspace
>>      \snapmathtogrid\vbox
> * snip *
>>  Wolfgang
>
> This fix seems not to solve the problem entirely. With this fix
> applied, If one now put a formula inside an enumeration one gets
> "double" space before the formula. This is a test file that shows the
> problem:

This is basically because in enumerations indenting is set to never.

You can see the same affect with

\setupindenting[no]
\testtext

One possible fix is to add

indenting=(reset|next|first) %default is never

to the \setupenumeration command. For example

> \defineenumeration[example]
>        [text=Example,
>        location=serried,
>        width=fit,
          indenting=reset, %%<<<---- Add This
>        distance=0.5em,
> 	way=bysection,
>        ]

Another is to change \startdisplaymath to

\def\startdisplaymath
   {\ifgridsnapping
      \beforedisplayspace
      \snapmathtogrid\vbox
      \bgroup
      \informulatrue
     %\forgetall % breaks side floats
    \else
      \bgroup
      \parskip\formulaparskip % ! !
      \informulatrue
     %\forgetall % otherwise backgrounds fail
      \ifdim\lastskip<\zeropoint\else
        \par
        \ifvmode \ifdim\parskip>\zeropoint\relax
          \whitespace \vskip-\parskip % kind of forces and cancels again
        \fi \fi
      \fi
      \doif\displaygridcorrection{-\v!top}{\kern-\strutht}% new, currently only option/default
      \beforedisplayspace
      \par
      \ifvmode \ifdim\parskip>\zeropoint\relax \else
       \ifindentfirstparagraph
          \verticalstrut
          \vskip-\struttotal
          \vskip-\baselineskip
        \fi\fi
      \fi
    \fi
    $$\setdisplaydimensions
    \setpredisplaysize\lastlinewidth
    \startinnermath}

But this is getting ugly.

Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: \indenting[next] and math => no vertical space before the formula
  2008-04-29  4:49     ` Aditya Mahajan
@ 2008-04-30  7:24       ` Mikael Persson
  2008-04-30  7:33         ` Wolfgang Schuster
  2008-04-30 17:02         ` Aditya Mahajan
  0 siblings, 2 replies; 16+ messages in thread
From: Mikael Persson @ 2008-04-30  7:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, Apr 29, 2008 at 6:49 AM, Aditya Mahajan <adityam@umich.edu> wrote:
> On Mon, 28 Apr 2008, Mikael Persson wrote:
>
>  > Hello again,
>  >
>  > * snip *
>  >>
>  >>  I could reproduce the result and have also a fix but I don't know what
>  >>  the correct
>  >>  reults should be and other people like Aditya should decide if it makes sense
>  >>  to change the current behaviour.
>  >>
>  >>  \def\startdisplaymath
>  >>   {\ifgridsnapping
>  >>      \beforedisplayspace
>  >>      \snapmathtogrid\vbox
>  > * snip *
>  >>  Wolfgang
>  >
>  > This fix seems not to solve the problem entirely. With this fix
>  > applied, If one now put a formula inside an enumeration one gets
>  > "double" space before the formula. This is a test file that shows the
>  > problem:
>
>  This is basically because in enumerations indenting is set to never.
>
>  You can see the same affect with
>
>  \setupindenting[no]
>  \testtext
>
>  One possible fix is to add
>
>  indenting=(reset|next|first) %default is never
>
>  to the \setupenumeration command. For example
>
>
>  > \defineenumeration[example]
>  >        [text=Example,
>  >        location=serried,
>  >        width=fit,
>           indenting=reset, %%<<<---- Add This
>
> >        distance=0.5em,
>  >       way=bysection,
>  >        ]
>
>  Another is to change \startdisplaymath to
>
>
>  \def\startdisplaymath
>    {\ifgridsnapping
>       \beforedisplayspace
>       \snapmathtogrid\vbox
>
>       \bgroup
>       \informulatrue
>      %\forgetall % breaks side floats
>     \else
>       \bgroup
>       \parskip\formulaparskip % ! !
>       \informulatrue
>      %\forgetall % otherwise backgrounds fail
>       \ifdim\lastskip<\zeropoint\else
>         \par
>         \ifvmode \ifdim\parskip>\zeropoint\relax
>           \whitespace \vskip-\parskip % kind of forces and cancels again
>         \fi \fi
>       \fi
>       \doif\displaygridcorrection{-\v!top}{\kern-\strutht}% new, currently only option/default
>       \beforedisplayspace
>       \par
>       \ifvmode \ifdim\parskip>\zeropoint\relax \else
>
>        \ifindentfirstparagraph
>           \verticalstrut
>           \vskip-\struttotal
>           \vskip-\baselineskip
>         \fi\fi
>       \fi
>     \fi
>     $$\setdisplaydimensions
>     \setpredisplaysize\lastlinewidth
>     \startinnermath}
>
>  But this is getting ugly.
>
>  Aditya
>

Thank you Aditya, but I don't get that to work. Both with

ConTeXt  ver: 2007.04.03 13:01 MKII  fmt: 2008.4.24  int:
english/english (with the fix earlier in this thread)
and
ConTeXt  ver: 2007.09.28 16:52 MKII  fmt: 2008.4.24  int:
english/english (which is the one from new ubuntu, without the fix)

this fails with the following error msg:

%% Start error msg
! Illegal unit of measure (pt inserted).
<to be read again>
                   \chardef
\@@in:reset ...rue \parindent \zerocount \chardef
                                                  \indentingtoggle \zerocount
\next1 #1,->\docomplexsetupindentingB {#1}
                                          \doprocesscommaitem
\doprocesscommalist ...item \gobbleoneargument #1,
                                                  ]\relax \global \advance \...
<argument> ...ndenting ]\docomplexsetupindentingB
                                                  \checkeverypar \ifindentfi...

\firstofoneargument #1->#1

...
l.29 \testexpr
               % Too much space before the formula if the fix is applied,
?
%% Stop error msg

The file that gives that error is:

%% Begin file
\setupindenting[yes,small]
\indenting[next]

\def\testtext{This is just some text so we see better what happens.}

\def\testexpr{%
\par
\testtext
\startformula
f(x)= \sin(x)
\stopformula
\testtext
\par
}

\defineenumeration[example]
       [text=Example,
       location=serried,
       width=fit,
       indenting=reset,
       distance=0.5em,
       way=bysection,
       ]

\starttext
\testexpr % OK if fix is applied, otherwise to little space before the
formula
\startexample
\testexpr % Too much space before the formula if the fix is applied,
otherwise OK.
\stopexample

\stoptext
%% End file

Best regards, Micke P
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: \indenting[next] and math => no vertical space before the formula
  2008-04-30  7:24       ` Mikael Persson
@ 2008-04-30  7:33         ` Wolfgang Schuster
  2008-04-30  7:45           ` Mikael Persson
  2008-04-30 17:02         ` Aditya Mahajan
  1 sibling, 1 reply; 16+ messages in thread
From: Wolfgang Schuster @ 2008-04-30  7:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> Thank you Aditya, but I don't get that to work. Both with
>
> ConTeXt  ver: 2007.04.03 13:01 MKII  fmt: 2008.4.24  int:
> english/english (with the fix earlier in this thread)
> and
> ConTeXt  ver: 2007.09.28 16:52 MKII  fmt: 2008.4.24  int:
> english/english (which is the one from new ubuntu, without the fix)

Update your ConTeXt istallation, both systems use old versions.

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
___________________________________________________________________________________


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

* Re: \indenting[next] and math => no vertical space before the formula
  2008-04-30  7:33         ` Wolfgang Schuster
@ 2008-04-30  7:45           ` Mikael Persson
  2008-04-30  8:54             ` Wolfgang Schuster
  0 siblings, 1 reply; 16+ messages in thread
From: Mikael Persson @ 2008-04-30  7:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, Apr 30, 2008 at 9:33 AM, Wolfgang Schuster
<schuster.wolfgang@googlemail.com> wrote:
> > Thank you Aditya, but I don't get that to work. Both with
>  >
>  > ConTeXt  ver: 2007.04.03 13:01 MKII  fmt: 2008.4.24  int:
>  > english/english (with the fix earlier in this thread)
>  > and
>  > ConTeXt  ver: 2007.09.28 16:52 MKII  fmt: 2008.4.24  int:
>  > english/english (which is the one from new ubuntu, without the fix)
>
>  Update your ConTeXt istallation, both systems use old versions.
>
>  Wolfgang

I wish I could. I cant even run the new version from ubuntu, since
there is some problem with the fourier fonts, explained in an earlier
mail in this thread (and also in an earlier post:
http://archive.contextgarden.net/message/20070830.154143.005528b8.en.html
)

And new minimals seem not to include the fourier fonts.

If I set indenting=next (or first) in the enumeration, the file compiles...

Sorry for "complaining" about old versions of ConTeXt. I am finishing
my PhD thesis, and have not found any nice combinations of text and
math fonts in the new minimals. (I am not too fond of the lm fonts).
If you have a tip about such fonts, please tell me :)

Micke P
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: \indenting[next] and math => no vertical space before the formula
  2008-04-30  7:45           ` Mikael Persson
@ 2008-04-30  8:54             ` Wolfgang Schuster
  0 siblings, 0 replies; 16+ messages in thread
From: Wolfgang Schuster @ 2008-04-30  8:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, Apr 30, 2008 at 9:45 AM, Mikael Persson <mickep@gmail.com> wrote:
>
> On Wed, Apr 30, 2008 at 9:33 AM, Wolfgang Schuster
> <schuster.wolfgang@googlemail.com> wrote:
> > > Thank you Aditya, but I don't get that to work. Both with
> >  >
> >  > ConTeXt  ver: 2007.04.03 13:01 MKII  fmt: 2008.4.24  int:
> >  > english/english (with the fix earlier in this thread)
> >  > and
> >  > ConTeXt  ver: 2007.09.28 16:52 MKII  fmt: 2008.4.24  int:
> >  > english/english (which is the one from new ubuntu, without the fix)
> >
> >  Update your ConTeXt istallation, both systems use old versions.
> >
> >  Wolfgang
>
> I wish I could. I cant even run the new version from ubuntu, since
> there is some problem with the fourier fonts, explained in an earlier
> mail in this thread (and also in an earlier post:
> http://archive.contextgarden.net/message/20070830.154143.005528b8.en.html)

No solution for this problem.

> And new minimals seem not to include the fourier fonts.
>
> If I set indenting=next (or first) in the enumeration, the file compiles...
>
> Sorry for "complaining" about old versions of ConTeXt. I am finishing
> my PhD thesis, and have not found any nice combinations of text and
> math fonts in the new minimals. (I am not too fond of the lm fonts).
> If you have a tip about such fonts, please tell me :)

You don't have update your complete installation, cont-tmf.zip is enough
for a new version but you also need the latest version of the latin
modern fonts.

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
___________________________________________________________________________________


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

* Re: \indenting[next] and math => no vertical space before the formula
  2008-04-30  7:24       ` Mikael Persson
  2008-04-30  7:33         ` Wolfgang Schuster
@ 2008-04-30 17:02         ` Aditya Mahajan
  2008-04-30 18:14           ` Mikael Persson
  1 sibling, 1 reply; 16+ messages in thread
From: Aditya Mahajan @ 2008-04-30 17:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 30 Apr 2008, Mikael Persson wrote:

> On Tue, Apr 29, 2008 at 6:49 AM, Aditya Mahajan <adityam@umich.edu> wrote:
>> On Mon, 28 Apr 2008, Mikael Persson wrote:
>>
>> > Hello again,
>> >
>> > * snip *
>> >>
>> >>  I could reproduce the result and have also a fix but I don't know what
>> >>  the correct
>> >>  reults should be and other people like Aditya should decide if it makes sense
>> >>  to change the current behaviour.
>> >>
>> >>  \def\startdisplaymath
>> >>   {\ifgridsnapping
>> >>      \beforedisplayspace
>> >>      \snapmathtogrid\vbox
>> > * snip *
>> >>  Wolfgang
>> >
>> > This fix seems not to solve the problem entirely. With this fix
>> > applied, If one now put a formula inside an enumeration one gets
>> > "double" space before the formula. This is a test file that shows the
>> > problem:
>>
>>  This is basically because in enumerations indenting is set to never.
>>
>>  You can see the same affect with
>>
>>  \setupindenting[no]
>>  \testtext
>>
>>  One possible fix is to add
>>
>>  indenting=(reset|next|first) %default is never
>>
>>  to the \setupenumeration command. For example
>>
>>
>> > \defineenumeration[example]
>> >        [text=Example,
>> >        location=serried,
>> >        width=fit,
>>           indenting=reset, %%<<<---- Add This
>>
>>>        distance=0.5em,
>> >       way=bysection,
>> >        ]
>>
>>  Another is to change \startdisplaymath to
>>
>>
>>  \def\startdisplaymath
>>    {\ifgridsnapping
>>       \beforedisplayspace
>>       \snapmathtogrid\vbox
>>
>>       \bgroup
>>       \informulatrue
>>      %\forgetall % breaks side floats
>>     \else
>>       \bgroup
>>       \parskip\formulaparskip % ! !
>>       \informulatrue
>>      %\forgetall % otherwise backgrounds fail
>>       \ifdim\lastskip<\zeropoint\else
>>         \par
>>         \ifvmode \ifdim\parskip>\zeropoint\relax
>>           \whitespace \vskip-\parskip % kind of forces and cancels again
>>         \fi \fi
>>       \fi
>>       \doif\displaygridcorrection{-\v!top}{\kern-\strutht}% new, currently only option/default
>>       \beforedisplayspace
>>       \par
>>       \ifvmode \ifdim\parskip>\zeropoint\relax \else
>>
>>        \ifindentfirstparagraph
>>           \verticalstrut
>>           \vskip-\struttotal
>>           \vskip-\baselineskip
>>         \fi\fi
>>       \fi
>>     \fi
>>     $$\setdisplaydimensions
>>     \setpredisplaysize\lastlinewidth
>>     \startinnermath}
>>
>>  But this is getting ugly.
>>
>>  Aditya
>>
>
> Thank you Aditya, but I don't get that to work. Both with
>
> ConTeXt  ver: 2007.04.03 13:01 MKII  fmt: 2008.4.24  int:
> english/english (with the fix earlier in this thread)
> and
> ConTeXt  ver: 2007.09.28 16:52 MKII  fmt: 2008.4.24  int:
> english/english (which is the one from new ubuntu, without the fix)
>
> this fails with the following error msg:
>
> %% Start error msg
> ! Illegal unit of measure (pt inserted).
> <to be read again>
>                   \chardef
> \@@in:reset ...rue \parindent \zerocount \chardef
>                                                  \indentingtoggle \zerocount
> \next1 #1,->\docomplexsetupindentingB {#1}
>                                          \doprocesscommaitem
> \doprocesscommalist ...item \gobbleoneargument #1,
>                                                  ]\relax \global \advance \...
> <argument> ...ndenting ]\docomplexsetupindentingB
>                                                  \checkeverypar \ifindentfi...
>
> \firstofoneargument #1->#1
>

An old bug (more than two month old :)

Also add this

\unprotect
\defineindentingmethod [\v!reset] {\indentfirstparagraphtrue
                                    \parindent\zeropoint%AM was \zerocount
                                    \chardef\indentingtoggle\zerocount}
\protect


Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: \indenting[next] and math => no vertical space before the formula
  2008-04-30 17:02         ` Aditya Mahajan
@ 2008-04-30 18:14           ` Mikael Persson
  0 siblings, 0 replies; 16+ messages in thread
From: Mikael Persson @ 2008-04-30 18:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, Apr 30, 2008 at 7:02 PM, Aditya Mahajan <adityam@umich.edu> wrote:
>
> On Wed, 30 Apr 2008, Mikael Persson wrote:
>
>  > On Tue, Apr 29, 2008 at 6:49 AM, Aditya Mahajan <adityam@umich.edu> wrote:
>  >> On Mon, 28 Apr 2008, Mikael Persson wrote:
>  >>
>  >> > Hello again,
>  >> >
>  >> > * snip *
>  >> >>
>  >> >>  I could reproduce the result and have also a fix but I don't know what
>  >> >>  the correct
>  >> >>  reults should be and other people like Aditya should decide if it makes sense
>  >> >>  to change the current behaviour.
>  >> >>
>  >> >>  \def\startdisplaymath
>  >> >>   {\ifgridsnapping
>  >> >>      \beforedisplayspace
>  >> >>      \snapmathtogrid\vbox
>  >> > * snip *
>  >> >>  Wolfgang
>  >> >
>  >> > This fix seems not to solve the problem entirely. With this fix
>  >> > applied, If one now put a formula inside an enumeration one gets
>  >> > "double" space before the formula. This is a test file that shows the
>  >> > problem:
>  >>
>  >>  This is basically because in enumerations indenting is set to never.
>  >>
>  >>  You can see the same affect with
>  >>
>  >>  \setupindenting[no]
>  >>  \testtext
>  >>
>  >>  One possible fix is to add
>  >>
>  >>  indenting=(reset|next|first) %default is never
>  >>
>  >>  to the \setupenumeration command. For example
>  >>
>  >>
>  >> > \defineenumeration[example]
>  >> >        [text=Example,
>  >> >        location=serried,
>  >> >        width=fit,
>  >>           indenting=reset, %%<<<---- Add This
>  >>
>  >>>        distance=0.5em,
>  >> >       way=bysection,
>  >> >        ]
>  >>
>  >>  Another is to change \startdisplaymath to
>  >>
>  >>
>  >>  \def\startdisplaymath
>  >>    {\ifgridsnapping
>  >>       \beforedisplayspace
>  >>       \snapmathtogrid\vbox
>  >>
>  >>       \bgroup
>  >>       \informulatrue
>  >>      %\forgetall % breaks side floats
>  >>     \else
>  >>       \bgroup
>  >>       \parskip\formulaparskip % ! !
>  >>       \informulatrue
>  >>      %\forgetall % otherwise backgrounds fail
>  >>       \ifdim\lastskip<\zeropoint\else
>  >>         \par
>  >>         \ifvmode \ifdim\parskip>\zeropoint\relax
>  >>           \whitespace \vskip-\parskip % kind of forces and cancels again
>  >>         \fi \fi
>  >>       \fi
>  >>       \doif\displaygridcorrection{-\v!top}{\kern-\strutht}% new, currently only option/default
>  >>       \beforedisplayspace
>  >>       \par
>  >>       \ifvmode \ifdim\parskip>\zeropoint\relax \else
>  >>
>  >>        \ifindentfirstparagraph
>  >>           \verticalstrut
>  >>           \vskip-\struttotal
>  >>           \vskip-\baselineskip
>  >>         \fi\fi
>  >>       \fi
>  >>     \fi
>  >>     $$\setdisplaydimensions
>  >>     \setpredisplaysize\lastlinewidth
>  >>     \startinnermath}
>  >>
>  >>  But this is getting ugly.
>  >>
>  >>  Aditya
>  >>
>  >
>  > Thank you Aditya, but I don't get that to work. Both with
>  >
>  > ConTeXt  ver: 2007.04.03 13:01 MKII  fmt: 2008.4.24  int:
>  > english/english (with the fix earlier in this thread)
>  > and
>  > ConTeXt  ver: 2007.09.28 16:52 MKII  fmt: 2008.4.24  int:
>  > english/english (which is the one from new ubuntu, without the fix)
>  >
>  > this fails with the following error msg:
>  >
>  > %% Start error msg
>  > ! Illegal unit of measure (pt inserted).
>  > <to be read again>
>  >                   \chardef
>  > \@@in:reset ...rue \parindent \zerocount \chardef
>  >                                                  \indentingtoggle \zerocount
>  > \next1 #1,->\docomplexsetupindentingB {#1}
>  >                                          \doprocesscommaitem
>  > \doprocesscommalist ...item \gobbleoneargument #1,
>  >                                                  ]\relax \global \advance \...
>  > <argument> ...ndenting ]\docomplexsetupindentingB
>  >                                                  \checkeverypar \ifindentfi...
>  >
>  > \firstofoneargument #1->#1
>  >
>
>  An old bug (more than two month old :)
>
>  Also add this
>
>  \unprotect
>  \defineindentingmethod [\v!reset] {\indentfirstparagraphtrue
>                                     \parindent\zeropoint%AM was \zerocount
>                                     \chardef\indentingtoggle\zerocount}
>  \protect
>  Aditya

Thank you Aditya (and also thank you Wolfgang!) Your help is really appreciated!

Micke P
___________________________________________________________________________________
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
___________________________________________________________________________________


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

end of thread, other threads:[~2008-04-30 18:14 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-24 10:15 \indenting[next] and math => no vertical space before the formula Mikael Persson
2008-04-24 11:29 ` Wolfgang Schuster
2008-04-24 14:27   ` Aditya Mahajan
2008-04-24 17:28     ` Hans Hagen
2008-04-24 18:37       ` Mikael Persson
2008-04-24 18:43         ` Hans Hagen
2008-04-24 19:14           ` Mikael Persson
2008-04-24 19:34             ` Hans Hagen
2008-04-28 18:17   ` Mikael Persson
2008-04-29  4:49     ` Aditya Mahajan
2008-04-30  7:24       ` Mikael Persson
2008-04-30  7:33         ` Wolfgang Schuster
2008-04-30  7:45           ` Mikael Persson
2008-04-30  8:54             ` Wolfgang Schuster
2008-04-30 17:02         ` Aditya Mahajan
2008-04-30 18:14           ` Mikael Persson

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