ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* rules with different thickness
@ 2011-04-19  1:18 Reviczky, Adam
  2011-04-19  4:32 ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Reviczky, Adam @ 2011-04-19  1:18 UTC (permalink / raw)
  To: ntg-context

Hi

I stumbled upon this while making a table with rules, where I wanted to have a particular row highlighted with a thicker border:
http://www.mail-archive.com/ntg-context@ntg.nl/msg33678.html

Since this was posted more then two years ago, I just wanted to know if anything changed on this front?
Having r|l|t|b-offsets I thought I could use the same for rulethickness, but according to this, not yet.

The metapost workaround works still fine, so for now I'm using that, just want to know what's the status on this.

Adam
___________________________________________________________________________________
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] 6+ messages in thread

* Re: rules with different thickness
  2011-04-19  1:18 rules with different thickness Reviczky, Adam
@ 2011-04-19  4:32 ` Wolfgang Schuster
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2011-04-19  4:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 19.04.2011 um 03:18 schrieb Reviczky, Adam:

> Hi
> 
> I stumbled upon this while making a table with rules, where I wanted to have a particular row highlighted with a thicker border:
> http://www.mail-archive.com/ntg-context@ntg.nl/msg33678.html
> 
> Since this was posted more then two years ago, I just wanted to know if anything changed on this front?
> Having r|l|t|b-offsets I thought I could use the same for rulethickness, but according to this, not yet.

No, there is only one value for all four borders.

> The metapost workaround works still fine, so for now I'm using that, just want to know what's the status on this.

It’s the same as in the past, use MetaPost but there are better ways to change values of certain borders:

\startuseMPgraphic{tableborders}
draw leftboundary   OverlayBox withpen pensquare scaled \frameddimension{leftrulethickness}   ;
draw rightboundary  OverlayBox withpen pensquare scaled \frameddimension{rightrulethickness}  ;
draw topboundary    OverlayBox withpen pensquare scaled \frameddimension{toprulethickness}    ;
draw bottomboundary OverlayBox withpen pensquare scaled \frameddimension{bottomrulethickness} ;
setbounds currentpicture to OverlayBox ;
\stopuseMPgraphic

\defineoverlay[tableborders][\useMPgraphic{tableborders}]

\setupTABLE
  [         background=tableborders,
     leftrulethickness=\framedparameter{rulethickness},
    rightrulethickness=\framedparameter{rulethickness},
      toprulethickness=\framedparameter{rulethickness},
   bottomrulethickness=\framedparameter{rulethickness}]

\starttext
\bTABLE\bTR
\bTD One \eTD
\bTD[toprulethickness=3pt] Two \eTD
\bTD[rightrulethickness=2pt] Three \eTD
\eTR
\eTABLE
\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] 6+ messages in thread

* Re: rules with different thickness
  2011-04-20  8:36 Reviczky, Adam
@ 2011-04-20 13:17 ` Wolfgang Schuster
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2011-04-20 13:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 20.04.2011 um 10:36 schrieb Reviczky, Adam:

> Thanks so much for this, it looks really nice (booth the implementation and the output).
> I've added this to the TABLE wiki since this example above is a table, however I suspect this would work for any "frame".

Yes because each table cell is a frame.

> Is there a reason why this doesn't work with mkii? I'm not using mkii for a long time now, just the wiki didn't rendered this example properly and also on my local machine it didn't show the thick rules, works perfectly with mkiv though.

The problem with mkii is that pictures are reduced to the size of the bounding box.

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] 6+ messages in thread

* Re: rules with different thickness
@ 2011-04-20  8:36 Reviczky, Adam
  2011-04-20 13:17 ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Reviczky, Adam @ 2011-04-20  8:36 UTC (permalink / raw)
  To: ntg-context

> I slightly modified the code and the output is now better than before, please add it to the wiki.
> 
> \startuseMPgraphic{tableborders}
> 
> draw leftboundary   OverlayBox withpen pensquare scaled \frameddimension  {leftrulethickness} ;
> draw rightboundary  OverlayBox withpen pensquare scaled \frameddimension {rightrulethickness} ;
> draw topboundary    OverlayBox withpen pensquare scaled \frameddimension   {toprulethickness} ;
> draw bottomboundary OverlayBox withpen pensquare scaled \frameddimension{bottomrulethickness} ;
> 
> clip currentpicture to OverlayBox
> 	leftenlarged   (\frameddimension  {leftrulethickness}/2)
> 	rightenlarged  (\frameddimension {rightrulethickness}/2)
> 	topenlarged    (\frameddimension   {toprulethickness}/2)
> 	bottomenlarged (\frameddimension{bottomrulethickness}/2) ;
> 
> setbounds currentpicture to OverlayBox ;
> 
> \stopuseMPgraphic
> 
> \defineoverlay[tableborders][\useMPgraphic{tableborders}]
> 
> \startsetups tableborders
> 
> \setupTABLE
>   [         background={color,tableborders},
>                  frame=off,
>       backgroundoffset=0pt,
>      leftrulethickness=\framedparameter{rulethickness},
>     rightrulethickness=\framedparameter{rulethickness},
>       toprulethickness=\framedparameter{rulethickness},
>    bottomrulethickness=\framedparameter{rulethickness}]
> 
> \setupTABLE[row]  [odd]  [backgroundcolor=lightgray]
> \setupTABLE[row]  [first][backgroundcolor=gray,bottomrulethickness=2pt]
> \setupTABLE[row]  [last] [toprulethickness=2pt,bottomrulethickness=2pt]
> \setupTABLE[first][last] [leftrulethickness=2pt]
> \setupTABLE[last] [last] [rightrulethickness=2pt]
> 
> \stopsetups
> 
> \starttext
> 
> \bTABLE
> \dorecurse{7}{\bTR\dorecurse{3}{\bTD#1-##1\eTD}\eTR}
> \eTABLE
> 
> \blank
> 
> \bTABLE[setups=tableborders]
> \dorecurse{7}{\bTR\dorecurse{3}{\bTD#1-##1\eTD}\eTR}
> \eTABLE
> 
> \stoptext
> 
> Wolfgang

Thanks so much for this, it looks really nice (booth the implementation and the output).
I've added this to the TABLE wiki since this example above is a table, however I suspect this would work for any "frame".

Is there a reason why this doesn't work with mkii? I'm not using mkii for a long time now, just the wiki didn't rendered this example properly and also on my local machine it didn't show the thick rules, works perfectly with mkiv though.

Cheers
Adam
___________________________________________________________________________________
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] 6+ messages in thread

* Re: rules with different thickness
  2011-04-19  7:30 Reviczky, Adam
@ 2011-04-19 17:46 ` Wolfgang Schuster
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2011-04-19 17:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 19.04.2011 um 09:30 schrieb Reviczky, Adam:

>> It’s the same as in the past, use MetaPost but there are better ways to change values of certain borders:
> As much as I like and prefer this solution, I can't get it to work as the old one.
> 
> With the old one I had a frame 1pt, and just made a 2pt metapost frame around the last row.
> 
> With the new example of yours I've came up with a minimal example that I've attached.
> I have to do the table setups, since I'm making the table via a macro, but for the simplicity I left that out from the minimal example.
> The problem is, that every even row seems to have thicker right/left and top borders, why is that?
> 
> With both solution if I just draw a thicker bottom line it goes off on the right and left side. Can this be solved somehow?


I slightly modified the code and the output is now better than before, please add it to the wiki.

\startuseMPgraphic{tableborders}

draw leftboundary   OverlayBox withpen pensquare scaled \frameddimension  {leftrulethickness} ;
draw rightboundary  OverlayBox withpen pensquare scaled \frameddimension {rightrulethickness} ;
draw topboundary    OverlayBox withpen pensquare scaled \frameddimension   {toprulethickness} ;
draw bottomboundary OverlayBox withpen pensquare scaled \frameddimension{bottomrulethickness} ;

clip currentpicture to OverlayBox
	leftenlarged   (\frameddimension  {leftrulethickness}/2)
	rightenlarged  (\frameddimension {rightrulethickness}/2)
	topenlarged    (\frameddimension   {toprulethickness}/2)
	bottomenlarged (\frameddimension{bottomrulethickness}/2) ;

setbounds currentpicture to OverlayBox ;

\stopuseMPgraphic

\defineoverlay[tableborders][\useMPgraphic{tableborders}]

\startsetups tableborders

\setupTABLE
  [         background={color,tableborders},
                 frame=off,
      backgroundoffset=0pt,
     leftrulethickness=\framedparameter{rulethickness},
    rightrulethickness=\framedparameter{rulethickness},
      toprulethickness=\framedparameter{rulethickness},
   bottomrulethickness=\framedparameter{rulethickness}]

\setupTABLE[row]  [odd]  [backgroundcolor=lightgray]
\setupTABLE[row]  [first][backgroundcolor=gray,bottomrulethickness=2pt]
\setupTABLE[row]  [last] [toprulethickness=2pt,bottomrulethickness=2pt]
\setupTABLE[first][last] [leftrulethickness=2pt]
\setupTABLE[last] [last] [rightrulethickness=2pt]

\stopsetups

\starttext

\bTABLE
\dorecurse{7}{\bTR\dorecurse{3}{\bTD#1-##1\eTD}\eTR}
\eTABLE

\blank

\bTABLE[setups=tableborders]
\dorecurse{7}{\bTR\dorecurse{3}{\bTD#1-##1\eTD}\eTR}
\eTABLE

\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] 6+ messages in thread

* Re: rules with different thickness
@ 2011-04-19  7:30 Reviczky, Adam
  2011-04-19 17:46 ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Reviczky, Adam @ 2011-04-19  7:30 UTC (permalink / raw)
  To: ntg-context

[-- Attachment #1: Type: text/plain, Size: 758 bytes --]

> It’s the same as in the past, use MetaPost but there are better ways to change values of certain borders:
As much as I like and prefer this solution, I can't get it to work as the old one.

With the old one I had a frame 1pt, and just made a 2pt metapost frame around the last row.

With the new example of yours I've came up with a minimal example that I've attached.
I have to do the table setups, since I'm making the table via a macro, but for the simplicity I left that out from the minimal example.
The problem is, that every even row seems to have thicker right/left and top borders, why is that?

With both solution if I just draw a thicker bottom line it goes off on the right and left side. Can this be solved somehow?

Thanks,
Adam

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: minimal.tex --]
[-- Type: text/x-tex; name="minimal.tex", Size: 1738 bytes --]

\startuseMPgraphic{tableborders}
draw leftboundary OverlayBox withpen pensquare scaled \frameddimension{leftrulethickness};
draw rightboundary OverlayBox withpen pensquare scaled \frameddimension{rightrulethickness};
draw topboundary OverlayBox withpen pensquare scaled \frameddimension{toprulethickness};
draw bottomboundary OverlayBox withpen pensquare scaled \frameddimension{bottomrulethickness};
setbounds currentpicture to OverlayBox ;
\stopuseMPgraphic
\defineoverlay[tableborders][\useMPgraphic{tableborders}]

\setupTABLE
  [background={color,tableborders},
   frame=off,
   leftrulethickness=\framedparameter{rulethickness},
   rightrulethickness=\framedparameter{rulethickness},
   toprulethickness=\framedparameter{rulethickness},
   bottomrulethickness=\framedparameter{rulethickness}]

\starttext
\setupTABLE[row][odd][background={color,tableborders},backgroundcolor=lightgray]
\setupTABLE[row][first][background={color,tableborders},backgroundcolor=gray,bottomrulethickness=2pt]
\setupTABLE[row][last][background={color,tableborders},toprulethickness=2pt,bottomrulethickness=2pt]
\setupTABLE[first][last][background={color,tableborders},leftrulethickness=2pt]
\setupTABLE[last][last][background={color,tableborders},rightrulethickness=2pt]

\bTABLE
\bTR
\bTD 1One \eTD
\bTD 1Two \eTD
\bTD 1Three \eTD
\eTR
\bTR
\bTD 2One \eTD
\bTD 2Two \eTD
\bTD 2Three \eTD
\eTR
\bTR
\bTD 3One \eTD
\bTD 3Two \eTD
\bTD 3Three \eTD
\eTR
\bTR
\bTD 4One \eTD
\bTD 4Two \eTD
\bTD 4Three \eTD
\eTR
\bTR
\bTD 5One \eTD
\bTD 5Two \eTD
\bTD 5Three \eTD
\eTR
\bTR
\bTD 5One \eTD
\bTD 5Two \eTD
\bTD 5Three \eTD
\eTR
\bTR
\bTD 6One \eTD
\bTD 6Two \eTD
\bTD 6Three \eTD
\eTR
\bTR
\bTD 7One \eTD
\bTD 7Two \eTD
\bTD 7Three \eTD
\eTR
\eTABLE
\stoptext

[-- Attachment #3: 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] 6+ messages in thread

end of thread, other threads:[~2011-04-20 13:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-19  1:18 rules with different thickness Reviczky, Adam
2011-04-19  4:32 ` Wolfgang Schuster
2011-04-19  7:30 Reviczky, Adam
2011-04-19 17:46 ` Wolfgang Schuster
2011-04-20  8:36 Reviczky, Adam
2011-04-20 13:17 ` Wolfgang Schuster

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