ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* TABLE: header with a thick bottom line
@ 2012-10-22 14:27 Procházka Lukáš Ing. - Pontex s. r. o.
  2012-10-22 14:41 ` Aditya Mahajan
  0 siblings, 1 reply; 6+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2012-10-22 14:27 UTC (permalink / raw)
  To: ConTeXt

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

Hello,

how to achieve the table header to have a thick bottom line?

Here are my two attempts:

----
\starttext
   \bTABLE
     \setupTABLE[width=broad]
     \setupTABLE[header][align=middle]
     \bTABLEhead
       \bTR[bottomframe=on,rulethickness=2mm]\bTH a\eTH\bTH b\eTH\eTR
     \eTABLEhead
     \bTABLEbody
       \bTR\bTD 1\eTD\bTD 2\eTD\eTR
       \bTR\bTD 3\eTD\bTD 4\eTD\eTR
     \eTABLEbody
   \eTABLE

   Or even better:

   \bTABLE
     \setupTABLE[width=broad]
     \setupTABLE[header][bottomframe=on,rulethickness=2mm,align=middle]
     \bTABLEhead
       \bTR\bTH a\eTH\bTH b\eTH\eTR
     \eTABLEhead
     \bTABLEbody
       \bTR\bTD 1\eTD\bTD 2\eTD\eTR
       \bTR\bTD 3\eTD\bTD 4\eTD\eTR
     \eTABLEbody
   \eTABLE
\stoptext
----

As you can see, in both cases all header cells are surrounded by a thick border; but only the bottom border should be.

How to achieve it?

TIA.

Best regards,

Lukas


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

[-- Attachment #2: t-TabHdr.mkiv --]
[-- Type: application/octet-stream, Size: 647 bytes --]

\starttext
  \bTABLE
    \setupTABLE[width=broad]
    \setupTABLE[header][align=middle]
    \bTABLEhead
      \bTR[bottomframe=on,rulethickness=2mm]\bTH a\eTH\bTH b\eTH\eTR
    \eTABLEhead
    \bTABLEbody
      \bTR\bTD 1\eTD\bTD 2\eTD\eTR
      \bTR\bTD 3\eTD\bTD 4\eTD\eTR
    \eTABLEbody
  \eTABLE

  Or even better:

  \bTABLE
    \setupTABLE[width=broad]
    \setupTABLE[header][bottomframe=on,rulethickness=2mm,align=middle]
    \bTABLEhead
      \bTR\bTH a\eTH\bTH b\eTH\eTR
    \eTABLEhead
    \bTABLEbody
      \bTR\bTD 1\eTD\bTD 2\eTD\eTR
      \bTR\bTD 3\eTD\bTD 4\eTD\eTR
    \eTABLEbody
  \eTABLE
\stoptext

[-- Attachment #3: t-TabHdr.pdf --]
[-- Type: application/pdf, Size: 7801 bytes --]

[-- Attachment #4: 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

* Re: TABLE: header with a thick bottom line
  2012-10-22 14:27 TABLE: header with a thick bottom line Procházka Lukáš Ing. - Pontex s. r. o.
@ 2012-10-22 14:41 ` Aditya Mahajan
  2012-10-22 15:02   ` Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 1 reply; 6+ messages in thread
From: Aditya Mahajan @ 2012-10-22 14:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1266 bytes --]

On Mon, 22 Oct 2012, Procházka Lukáš Ing. - Pontex s. r. o. wrote:

> Hello,
>
> how to achieve the table header to have a thick bottom line?
>
> Here are my two attempts:
>
> ----
> \starttext
> \bTABLE
>   \setupTABLE[width=broad]
>   \setupTABLE[header][align=middle]
>   \bTABLEhead
>     \bTR[bottomframe=on,rulethickness=2mm]\bTH a\eTH\bTH b\eTH\eTR
>   \eTABLEhead
>   \bTABLEbody
>     \bTR\bTD 1\eTD\bTD 2\eTD\eTR
>     \bTR\bTD 3\eTD\bTD 4\eTD\eTR
>   \eTABLEbody
> \eTABLE
>
> Or even better:
>
> \bTABLE
>   \setupTABLE[width=broad]
>   \setupTABLE[header][bottomframe=on,rulethickness=2mm,align=middle]
>   \bTABLEhead
>     \bTR\bTH a\eTH\bTH b\eTH\eTR
>   \eTABLEhead
>   \bTABLEbody
>     \bTR\bTD 1\eTD\bTD 2\eTD\eTR
>     \bTR\bTD 3\eTD\bTD 4\eTD\eTR
>   \eTABLEbody
> \eTABLE
> \stoptext
> ----
>
> As you can see, in both cases all header cells are surrounded by a thick 
> border; but only the bottom border should be.

If you want only the bottom border (and no other border), use

....[frame=off, bottomframe=on, ...]

> How to achieve it?

If you want to have all borders, but only draw the bottom border with a 
different thickness, you will have to use a custom metapost background.

Aditya

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

* Re: TABLE: header with a thick bottom line
  2012-10-22 14:41 ` Aditya Mahajan
@ 2012-10-22 15:02   ` Procházka Lukáš Ing. - Pontex s. r. o.
  2012-10-22 15:45     ` Marco Patzer
  0 siblings, 1 reply; 6+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2012-10-22 15:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 22 Oct 2012 16:41:46 +0200, Aditya Mahajan <adityam@umich.edu> wrote:

> If you want only the bottom border (and no other border),

... No, I want all borders with default thickness but head bottom border thicker;
this is most common look of my tables:

+---+---+
| a | b |  -> header
+===+===+
| 1 | 2 |  \
+---+---+   > body
| 3 | 4 |  /
+---+---+

> use
>
> ....[frame=off, bottomframe=on, ...]
>
>> How to achieve it?
>
> If you want to have all borders, but only draw the bottom border with a
> different thickness, you will have to use a custom metapost background.

... OK.

I believed there would be something like

   \setupTABLE[header][bottomframe=on,bottomrulethickness=2pt]

Lukas


> Aditya


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

___________________________________________________________________________________
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: TABLE: header with a thick bottom line
  2012-10-22 15:02   ` Procházka Lukáš Ing. - Pontex s. r. o.
@ 2012-10-22 15:45     ` Marco Patzer
  2012-10-23  7:35       ` Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 1 reply; 6+ messages in thread
From: Marco Patzer @ 2012-10-22 15:45 UTC (permalink / raw)
  To: ntg-context

2012-10-22 Procházka Lukáš Ing. - Pontex s. r. o.:

> On Mon, 22 Oct 2012 16:41:46 +0200, Aditya Mahajan <adityam@umich.edu> wrote:
> 
> > If you want only the bottom border (and no other border),
> 
> ... No, I want all borders with default thickness but head bottom border thicker;
> this is most common look of my tables:

http://wiki.contextgarden.net/TABLE#Rules_with_different_thickness


Marco

___________________________________________________________________________________
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: TABLE: header with a thick bottom line
  2012-10-22 15:45     ` Marco Patzer
@ 2012-10-23  7:35       ` Procházka Lukáš Ing. - Pontex s. r. o.
  2012-10-23 15:13         ` Rogers, Michael K
  0 siblings, 1 reply; 6+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2012-10-23  7:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

On Mon, 22 Oct 2012 17:45:21 +0200, Marco Patzer <homerow@lavabit.com> wrote:

> http://wiki.contextgarden.net/TABLE#Rules_with_different_thickness

... I knew this snippet; unfortunately, there were some bindings or relationships that I didn't understand fully.

> Marco

Anyway, after some experiments, based on Wolfgang's code on wiki, I reached the following minimal working example:

----
\startuseMPgraphic{MP:thickBtm}
   draw bottomboundary OverlayBox withpen pensquare scaled \frameddimension{bottomrulethickness};
   clip currentpicture to OverlayBox;
   setbounds currentpicture to OverlayBox;
\stopuseMPgraphic

\defineoverlay[OL:thickBtm][\useMPgraphic{MP:thickBtm}]

\starttext
   \bTABLE
     \setupTABLE[align=middle]
     \setupTABLE[header][background={OL:thickBtm},bottomrulethickness=3mm]
     \setupTABLE[row][4][background={OL:thickBtm},bottomrulethickness=1.5mm]
     %
     \bTABLEhead\bTR\dorecurse{3}{\bTH#1\eTH}\eTR\eTABLEhead
     \bTABLEbody\dorecurse{6}{\bTR\dorecurse{3}{\bTD#1-##1\eTD}\eTR}\eTABLEbody
   \eTABLE
\stoptext
----

Best regards,

Lukas


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

[-- Attachment #2: t-Tab-ThkBtm.mkiv --]
[-- Type: application/octet-stream, Size: 668 bytes --]

\startuseMPgraphic{MP:thickBtm}
  draw bottomboundary OverlayBox withpen pensquare scaled \frameddimension{bottomrulethickness};
  clip currentpicture to OverlayBox;
  setbounds currentpicture to OverlayBox;
\stopuseMPgraphic

\defineoverlay[OL:thickBtm][\useMPgraphic{MP:thickBtm}]

\starttext
  \bTABLE
    \setupTABLE[align=middle]
    \setupTABLE[header][background={OL:thickBtm},bottomrulethickness=3mm]
    \setupTABLE[row][4][background={OL:thickBtm},bottomrulethickness=1.5mm]
    %
    \bTABLEhead\bTR\dorecurse{3}{\bTH#1\eTH}\eTR\eTABLEhead
    \bTABLEbody\dorecurse{6}{\bTR\dorecurse{3}{\bTD#1-##1\eTD}\eTR}\eTABLEbody
  \eTABLE
\stoptext

[-- Attachment #3: t-Tab-ThkBtm.pdf --]
[-- Type: application/pdf, Size: 7974 bytes --]

[-- Attachment #4: 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

* Re: TABLE: header with a thick bottom line
  2012-10-23  7:35       ` Procházka Lukáš Ing. - Pontex s. r. o.
@ 2012-10-23 15:13         ` Rogers, Michael K
  0 siblings, 0 replies; 6+ messages in thread
From: Rogers, Michael K @ 2012-10-23 15:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

One issue is that the overlay overlaps the text space (reduces whitespace or potentially overlaps letters).  One could use a blank row with a black background, but a row seems to have a minimum height of about 2mm.  I discovered the "boffset" key, which can be used with the overlay, but it's kludgy.

Perhaps there is a better way...

Michael


\startuseMPgraphic{MP:thickBtm}
 draw bottomboundary OverlayBox withpen pensquare scaled \frameddimension{bottomrulethickness};
 clip currentpicture to OverlayBox;
 setbounds currentpicture to OverlayBox;
\stopuseMPgraphic

\defineoverlay[OL:thickBtm][\useMPgraphic{MP:thickBtm}]

\starttext
 \bTABLE % Overlay method
   \setupTABLE[align=middle]
   % By eye, by trial: boffset = bottomrulethickness/2 - 0.2mm
   \setupTABLE[header][background={OL:thickBtm},bottomrulethickness=3mm,boffset=1.3mm]
   \setupTABLE[row][4][background={OL:thickBtm},bottomrulethickness=1.5mm, boffset=.55mm]
   %
   \bTABLEhead\bTR\dorecurse{3}{\bTH#1\eTH}\eTR\eTABLEhead
   \bTABLEbody\dorecurse{6}{\bTR\dorecurse{3}{\bTD#1-##1\eTD}\eTR}\eTABLEbody
 \eTABLE
\stoptext


________________________________

This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).
___________________________________________________________________________________
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:[~2012-10-23 15:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-22 14:27 TABLE: header with a thick bottom line Procházka Lukáš Ing. - Pontex s. r. o.
2012-10-22 14:41 ` Aditya Mahajan
2012-10-22 15:02   ` Procházka Lukáš Ing. - Pontex s. r. o.
2012-10-22 15:45     ` Marco Patzer
2012-10-23  7:35       ` Procházka Lukáš Ing. - Pontex s. r. o.
2012-10-23 15:13         ` Rogers, Michael K

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