ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* MKII & MKIV difference between \textrule
@ 2012-09-13 22:08 Alessandro Perucchi
  2012-09-14 11:26 ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Alessandro Perucchi @ 2012-09-13 22:08 UTC (permalink / raw)
  To: ntg-context

Hello,

In my experimentation, I've found that in mkii and mkiv the behavior of 
\textrule and \setuptextrule are different...

What I did was quite simple:

\textrule{Testing head}
blah blah blah
\textrule

in mkii the text in well centered between the lines.
But in mkiv the bottom line is too near the text, and I need to add 
something like \blank[halfline] to have a similar behavior as mkii.

And apparently the command \starttextrule ... \stoptextrule doesn't work 
(this was explain in the cont-entp.pdf page 204) in either mkii & mkiv.

Am I missing something?

Sincerely yours,
Alessandro
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: MKII & MKIV difference between \textrule
  2012-09-13 22:08 MKII & MKIV difference between \textrule Alessandro Perucchi
@ 2012-09-14 11:26 ` Wolfgang Schuster
  2012-09-14 21:50   ` Alessandro Perucchi
  2012-09-16 10:39   ` Hans Hagen
  0 siblings, 2 replies; 9+ messages in thread
From: Wolfgang Schuster @ 2012-09-14 11:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 14.09.2012 um 00:08 schrieb Alessandro Perucchi <alessandro@perucchi.org>:

> Hello,
> 
> In my experimentation, I've found that in mkii and mkiv the behavior of \textrule and \setuptextrule are different...
> 
> What I did was quite simple:
> 
> \textrule{Testing head}
> blah blah blah
> \textrule
> 
> in mkii the text in well centered between the lines.
> But in mkiv the bottom line is too near the text, and I need to add something like \blank[halfline] to have a similar behavior as mkii.

There is a vertical skip missing in the MkIV version of the macros.

pack-mrl.mkiv

\def\pack_textrule_following#1%
  {\doifelsenothing{#1}
-    {\nointerlineskip
+    {\vskip\dimexpr\strutdp+.5ex\ifdim\prevdepth>\strutdp\else\ifdim\prevdepth>\zeropoint-\prevdepth\fi\fi\relax
+     \nointerlineskip
      \dontleavehmode\vbox
        {\color[\directtextrulesparameter\c!rulecolor]
           {\hrule\s!depth\directtextrulesparameter\c!rulethickness\s!height\zeropoint\s!width\availablehsize}}}
     {\pack_textrule_with_text{#1}}%
   \ifvmode
     \prevdepth\zeropoint
   \fi}


> And apparently the command \starttextrule ... \stoptextrule doesn't work (this was explain in the cont-entp.pdf page 204) in either mkii & mliv.

This does work for me:

\starttext

blah blah blah

\starttextrule{Testing head}
blah blah blah
\stoptextrule

blah blah blah

\stoptext

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


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

* Re: MKII & MKIV difference between \textrule
  2012-09-14 11:26 ` Wolfgang Schuster
@ 2012-09-14 21:50   ` Alessandro Perucchi
  2012-09-14 22:12     ` luigi scarso
  2012-09-15  7:28     ` Wolfgang Schuster
  2012-09-16 10:39   ` Hans Hagen
  1 sibling, 2 replies; 9+ messages in thread
From: Alessandro Perucchi @ 2012-09-14 21:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On 14 Sep 2012, at 13:26, Wolfgang Schuster <wolfgang.schuster@gmail.com> wrote:

> 
> Am 14.09.2012 um 00:08 schrieb Alessandro Perucchi <alessandro@perucchi.org>:
> 
>> Hello,
>> 
>> In my experimentation, I've found that in mkii and mkiv the behavior of \textrule and \setuptextrule are different...
>> 
>> What I did was quite simple:
>> 
>> \textrule{Testing head}
>> blah blah blah
>> \textrule
>> 
>> in mkii the text in well centered between the lines.
>> But in mkiv the bottom line is too near the text, and I need to add something like \blank[halfline] to have a similar behavior as mkii.
> 
> There is a vertical skip missing in the MkIV version of the macros.
> 
> pack-mrl.mkiv
> 
> \def\pack_textrule_following#1%
>  {\doifelsenothing{#1}
> -    {\nointerlineskip
> +    {\vskip\dimexpr\strutdp+.5ex\ifdim\prevdepth>\strutdp\else\ifdim\prevdepth>\zeropoint-\prevdepth\fi\fi\relax
> +     \nointerlineskip
>      \dontleavehmode\vbox
>        {\color[\directtextrulesparameter\c!rulecolor]
>           {\hrule\s!depth\directtextrulesparameter\c!rulethickness\s!height\zeropoint\s!width\availablehsize}}}
>     {\pack_textrule_with_text{#1}}%
>   \ifvmode
>     \prevdepth\zeropoint
>   \fi}


I've tried to patch pack-mrl.mkiv and I still get the error of spacing before the second \textrule.

My version of context is

mtx-context     | ConTeXt Process Management 0.60
mtx-context     |
mtx-context     | main context file: /Users/ptitvert/context/tex/texmf-context/tex/context/base/context.mkiv
mtx-context     | current version: 2012.09.11 20:36


> 
>> And apparently the command \starttextrule ... \stoptextrule doesn't work (this was explain in the cont-entp.pdf page 204) in either mkii & mliv.
> 
> This does work for me:
> 
> \starttext
> 
> blah blah blah
> 
> \starttextrule{Testing head}
> blah blah blah
> \stoptextrule
> 
> blah blah blah
> 
> \stoptext

But 

\starttext

blah blah blah

\starttextrule[top]{Testing head}
blah blah blah
\stoptextrule

blah blah blah

\stoptext

doesn't, and this possibility is explain in the doc, but apparently it doesn't work.
So either the doc is wrong, the command is wrong or I'm doing something wrong :-D

Sincerely yours,
Alessandro
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: MKII & MKIV difference between \textrule
  2012-09-14 21:50   ` Alessandro Perucchi
@ 2012-09-14 22:12     ` luigi scarso
  2012-09-15  6:31       ` Alessandro Perucchi
  2012-09-15  7:28     ` Wolfgang Schuster
  1 sibling, 1 reply; 9+ messages in thread
From: luigi scarso @ 2012-09-14 22:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1512 bytes --]

On Fri, Sep 14, 2012 at 11:50 PM, Alessandro Perucchi <
alessandro@perucchi.org> wrote:

>
> On 14 Sep 2012, at 13:26, Wolfgang Schuster <wolfgang.schuster@gmail.com>
> wrote:
>
> >
> > Am 14.09.2012 um 00:08 schrieb Alessandro Perucchi <
> alessandro@perucchi.org>:
> >
> >> Hello,
> >>
> >> In my experimentation, I've found that in mkii and mkiv the behavior of
> \textrule and \setuptextrule are different...
> >>
> >> What I did was quite simple:
> >>
> >> \textrule{Testing head}
> >> blah blah blah
> >> \textrule
> >>
> >> in mkii the text in well centered between the lines.
> >> But in mkiv the bottom line is too near the text, and I need to add
> something like \blank[halfline] to have a similar behavior as mkii.
> >
> > There is a vertical skip missing in the MkIV version of the macros.
> >
> > pack-mrl.mkiv
> >
> > \def\pack_textrule_following#1%
> >  {\doifelsenothing{#1}
> > -    {\nointerlineskip
> > +
>  {\vskip\dimexpr\strutdp+.5ex\ifdim\prevdepth>\strutdp\else\ifdim\prevdepth>\zeropoint-\prevdepth\fi\fi\relax
> > +     \nointerlineskip
> >      \dontleavehmode\vbox
> >        {\color[\directtextrulesparameter\c!rulecolor]
> >
> {\hrule\s!depth\directtextrulesparameter\c!rulethickness\s!height\zeropoint\s!width\availablehsize}}}
> >     {\pack_textrule_with_text{#1}}%
> >   \ifvmode
> >     \prevdepth\zeropoint
> >   \fi}
>
>
> I've tried to patch pack-mrl.mkiv and I still get the error of spacing
> before the second \textrule.
>
> have you regenerated the format ?

-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 2207 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

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

* Re: MKII & MKIV difference between \textrule
  2012-09-14 22:12     ` luigi scarso
@ 2012-09-15  6:31       ` Alessandro Perucchi
  0 siblings, 0 replies; 9+ messages in thread
From: Alessandro Perucchi @ 2012-09-15  6:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1207 bytes --]

On 15 sept. 2012, at 00:12, luigi scarso <luigi.scarso@gmail.com> wrote:

> 
> 
> On Fri, Sep 14, 2012 at 11:50 PM, Alessandro Perucchi <alessandro@perucchi.org> wrote:
> 
> On 14 Sep 2012, at 13:26, Wolfgang Schuster <wolfgang.schuster@gmail.com> wrote:
> 
> 
> > There is a vertical skip missing in the MkIV version of the macros.
> >
> > pack-mrl.mkiv
> >
> > \def\pack_textrule_following#1%
> >  {\doifelsenothing{#1}
> > -    {\nointerlineskip
> > +    {\vskip\dimexpr\strutdp+.5ex\ifdim\prevdepth>\strutdp\else\ifdim\prevdepth>\zeropoint-\prevdepth\fi\fi\relax
> > +     \nointerlineskip
> >      \dontleavehmode\vbox
> >        {\color[\directtextrulesparameter\c!rulecolor]
> >           {\hrule\s!depth\directtextrulesparameter\c!rulethickness\s!height\zeropoint\s!width\availablehsize}}}
> >     {\pack_textrule_with_text{#1}}%
> >   \ifvmode
> >     \prevdepth\zeropoint
> >   \fi}
> 
> 
> I've tried to patch pack-mrl.mkiv and I still get the error of spacing before the second \textrule.
> 
> have you regenerated the format ?

Well no.... I didn't know!!! and after searching how to do it, I found and yes it works :-)

Thanks!!

Sincerely yours,
Alessandro

[-- Attachment #1.2: Type: text/html, Size: 2228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

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

* Re: MKII & MKIV difference between \textrule
  2012-09-14 21:50   ` Alessandro Perucchi
  2012-09-14 22:12     ` luigi scarso
@ 2012-09-15  7:28     ` Wolfgang Schuster
  2012-09-15 10:00       ` Alessandro Perucchi
  1 sibling, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2012-09-15  7:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 14.09.2012 um 23:50 schrieb Alessandro Perucchi <alessandro@perucchi.org>:

>>> And apparently the command \starttextrule ... \stoptextrule doesn't work (this was explain in the cont-entp.pdf page 204) in either mkii & mliv.
>> 
>> This does work for me:
>> 
>> \starttext
>> 
>> blah blah blah
>> 
>> \starttextrule{Testing head}
>> blah blah blah
>> \stoptextrule
>> 
>> blah blah blah
>> 
>> \stoptext
> 
> But 
> 
> \starttext
> 
> blah blah blah
> 
> \starttextrule[top]{Testing head}
> blah blah blah
> \stoptextrule
> 
> blah blah blah
> 
> \stoptext
> 
> doesn't, and this possibility is explain in the doc, but apparently it doesn't work.
> So either the doc is wrong, the command is wrong or I'm doing something wrong :-D

Remove "[top]" from \starttextrule. All possible combinations are:

\starttext

blah blah blah

\textrule{Top}
blah blah blah
\textrule

blah blah blah

\textrule[top]{Top}
blah blah blah
\textrule

blah blah blah

\textrule[top]{Top}
blah blah blah
\textrule[bottom]{Bottom}

blah blah blah

\textrule[top]{Top}
blah blah blah
\textrule[middle]{Middle}
blah blah blah
\textrule[bottom]{Bottom}

blah blah blah

\starttextrule{Top}
blah blah blah
\stoptextrule

blah blah blah

\stoptext

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


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

* Re: MKII & MKIV difference between \textrule
  2012-09-15  7:28     ` Wolfgang Schuster
@ 2012-09-15 10:00       ` Alessandro Perucchi
  2012-09-15 10:23         ` Sietse Brouwer
  0 siblings, 1 reply; 9+ messages in thread
From: Alessandro Perucchi @ 2012-09-15 10:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 15 sept. 2012, at 09:28, Wolfgang Schuster <wolfgang.schuster@gmail.com> wrote:

> 
> Remove "[top]" from \starttextrule. All possible combinations are:
> 
> (...)

Hello Wolfgang,

Thanks, now I understand how this command works.
So probably it would be good to correct the documentation accordingly ( even if all coders hate that part :-D ) Or maybe update the wiki... Is anybody able to modify the wiki? if yes then I would be more than happy to do it.

Sincerely yours,
Alessandro
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: MKII & MKIV difference between \textrule
  2012-09-15 10:00       ` Alessandro Perucchi
@ 2012-09-15 10:23         ` Sietse Brouwer
  0 siblings, 0 replies; 9+ messages in thread
From: Sietse Brouwer @ 2012-09-15 10:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Alessandro,

On Sat, Sep 15, 2012 at 12:00 PM, Alessandro Perucchi
<alessandro@perucchi.org> wrote:
> So probably it would be good to correct the documentation
> accordingly ( even if all coders hate that part :-D ) Or maybe
> update the > wiki... Is anybody able to modify the wiki? if
> yes then I would be more than happy to do it.

Yes, anybody can edit the wiki once the make an account. You're more
than welcome to! Here is the page on textrule:
http://wiki.contextgarden.net/Command/textrule

Cheers,
Sietse
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: MKII & MKIV difference between \textrule
  2012-09-14 11:26 ` Wolfgang Schuster
  2012-09-14 21:50   ` Alessandro Perucchi
@ 2012-09-16 10:39   ` Hans Hagen
  1 sibling, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2012-09-16 10:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Wolfgang Schuster

On 14-9-2012 13:26, Wolfgang Schuster wrote:
>
> Am 14.09.2012 um 00:08 schrieb Alessandro Perucchi <alessandro@perucchi.org>:
>
>> Hello,
>>
>> In my experimentation, I've found that in mkii and mkiv the behavior of \textrule and \setuptextrule are different...
>>
>> What I did was quite simple:
>>
>> \textrule{Testing head}
>> blah blah blah
>> \textrule
>>
>> in mkii the text in well centered between the lines.
>> But in mkiv the bottom line is too near the text, and I need to add something like \blank[halfline] to have a similar behavior as mkii.
>
> There is a vertical skip missing in the MkIV version of the macros.
>
> pack-mrl.mkiv
>
> \def\pack_textrule_following#1%
>    {\doifelsenothing{#1}
> -    {\nointerlineskip
> +    {\vskip\dimexpr\strutdp+.5ex\ifdim\prevdepth>\strutdp\else\ifdim\prevdepth>\zeropoint-\prevdepth\fi\fi\relax
> +     \nointerlineskip
>        \dontleavehmode\vbox
>          {\color[\directtextrulesparameter\c!rulecolor]
>             {\hrule\s!depth\directtextrulesparameter\c!rulethickness\s!height\zeropoint\s!width\availablehsize}}}
>       {\pack_textrule_with_text{#1}}%
>     \ifvmode
>       \prevdepth\zeropoint
>     \fi}

actually that's the commented code ...

\pack_textrule_correct_depth

... i'm still not that convinced if that correction always looks right 
(i've reenabled it but it might become an option)

>
>> And apparently the command \starttextrule ... \stoptextrule doesn't work (this was explain in the cont-entp.pdf page 204) in either mkii & mliv.
>
> This does work for me:
>
> \starttext
>
> blah blah blah
>
> \starttextrule{Testing head}
> blah blah blah
> \stoptextrule
>
> blah blah blah
>
> \stoptext
>
> 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  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
>


-- 

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


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

end of thread, other threads:[~2012-09-16 10:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-13 22:08 MKII & MKIV difference between \textrule Alessandro Perucchi
2012-09-14 11:26 ` Wolfgang Schuster
2012-09-14 21:50   ` Alessandro Perucchi
2012-09-14 22:12     ` luigi scarso
2012-09-15  6:31       ` Alessandro Perucchi
2012-09-15  7:28     ` Wolfgang Schuster
2012-09-15 10:00       ` Alessandro Perucchi
2012-09-15 10:23         ` Sietse Brouwer
2012-09-16 10:39   ` 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).