From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/101126 Path: news.gmane.org!.POSTED!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Table generator : Issues with borders and rotated cells Date: Wed, 27 Jun 2018 10:50:47 +0200 Message-ID: <5B334FE7.40106@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020505000805080402040503" X-Trace: blaine.gmane.org 1530089366 23635 195.159.176.226 (27 Jun 2018 08:49:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 27 Jun 2018 08:49:26 +0000 (UTC) User-Agent: Postbox 5.0.25 (Macintosh/20180328) Cc: Xavier Dionne To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jun 27 10:49:22 2018 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fY68g-000627-B7 for gctc-ntg-context-518@m.gmane.org; Wed, 27 Jun 2018 10:49:22 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 23DFA3AC99; Wed, 27 Jun 2018 10:51:11 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id P92XjjC5UU9w; Wed, 27 Jun 2018 10:51:10 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 442263AC9B; Wed, 27 Jun 2018 10:51:10 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 9AC7D3AC93 for ; Wed, 27 Jun 2018 10:51:08 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8_uTMSOHllX1 for ; Wed, 27 Jun 2018 10:51:03 +0200 (CEST) Original-Received: from mail-wr0-f180.google.com (mail-wr0-f180.google.com [209.85.128.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 27F2E3AC91 for ; Wed, 27 Jun 2018 10:50:53 +0200 (CEST) Original-Received: by mail-wr0-f180.google.com with SMTP id a12-v6so1169870wro.1 for ; Wed, 27 Jun 2018 01:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to; bh=p97lyXz+lwOjPHA1DD9LNyWd5/gFP9L7e8ig5rn/UpA=; b=ngsfC4/Yz9RZcECuWgrTZGAyfCWdNbaGLYNXPHm/g8nxWogkezBzKPLPUN9YU2G17/ c3GPlzLms/xzkdulUKu+rpcUH1Ocgp+A6wr1ge9O1VNTwdzCrpfiOWRSGwf/OfF9tEJb AfNFo+qERZA5Sw3NoEVPO3P9/VoiKMoQzO5qV2VztGx6IQtGB5cEy8VgYXsT1QNerNWb L144P1PbEOywjNG9m/0802WwI0x1ve/koCGJStzlGd/Hyn8B1pCbCRTFLE0LKzpEYYDk c3lyxxZpM6dnBk1D63UhBELyMd/tafk50agfqJyOA4NDNeF9uLuCPGE+HX5JMiE8OmoK 4o8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to; bh=p97lyXz+lwOjPHA1DD9LNyWd5/gFP9L7e8ig5rn/UpA=; b=pM70LjXvALQBQ/wLC7XwxFyFAKhk+LMFbOl9gP7kQ0F55tZ9XHipe7mS7nskH93GGm Jea4hsUiJCzbQfDntX3bZON8HVREb/KdRv21HwlyTMongoasho30eoGuOuQFSqN9dCrZ w+DixIG+RNOOpcPklaCzKW/a4UOPER9aL55du0CEvYLGyc2uzjuaf0GYmrYK3vylTMnN lNSSa1p4Wh1vUj+XtVO0gAY7CD01Ftj93D3LHHtoSCGg74vvivZ8SUKAGwFZR3gCE2Ly SLGN4oZuMRCRJDkfFcdpl+kN0I22QRcmV9zdqrkskj42rDtxx9JyxMtQ5CH5NM03ZN1g KuaA== X-Gm-Message-State: APt69E28ZW30BfXlgYtDz79aGc4JlbP1A+RHZCYfa+uNhwckOILTUx8a kZu/8AN8WEo3sCqSOLiMzMD9pAKM X-Google-Smtp-Source: AAOMgpfuAC1Yq30/mzzt8x1YdS0HwN6DFK4Qm0RGcBea0fzlPgdqmbygrPd8c8O5oc43s1+ZEvFM9w== X-Received: by 2002:adf:aec7:: with SMTP id y65-v6mr4259533wrc.140.1530089452284; Wed, 27 Jun 2018 01:50:52 -0700 (PDT) Original-Received: from [192.168.1.12] (x4dbd167a.dyn.telefonica.de. [77.189.22.122]) by smtp.gmail.com with ESMTPSA id v2-v6sm4617777wrm.84.2018.06.27.01.50.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 01:50:51 -0700 (PDT) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:101126 Archived-At: This is a multi-part message in MIME format. --------------020505000805080402040503 Content-Type: multipart/alternative; boundary="------------070701050300010705020602" --------------070701050300010705020602 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > Xavier Dionne > 19. Juni 2018 um 03:26 > > Hi everyone, > > Excuse my poor English. I recently updated my online table generator > (http://latex-tables.com) to support ConTeXt. It also supports many > languages, like LaTeX, Plain TeX, Markdown, HTML and more. It uses the > eXtreme table format and supports many features including : > > - Borders, border width and border color > > - Merged cells > > - Background color > > - Alignment (flushleft, center, flushright) > > - Splitted tables > > - Rotated tables > > - Caption > > - More... > > However, I have many issues that I have trouble to fix. > > 1/ I have many troubles with borders, because I can't set the color > and the width of each border. Instead, I use "fake rows" and "fake > cells" when it is necessary. However, I can't figure out how to set > the height of a row to 0.4pt. It's always bigger. So, instead I use > "location=hanging" on this row but, because of this, borders are > hidden behind the next row's background. What can I do about this ? > Frames accept only a single color and line thickness for all borders but there are two ways to set different values for each side The first method is to disable the frame and apply a background graphic where you draw different lines for each side. The other method is to create a custom renderer for each frame (top, bottom etc.) where you can than apply a different color or linewidth for each side, below (and also attached) is a example where I show how this can be done. Wolfgang %%%% begin meta-imp-mpframe.mkiv \startuseMPgraphic{mp_frame_left} draw leftboundary OverlayBox withpen pensquare scaled \frameddimension{leftrulethickness} withcolor \MPcolor{\framedparameter{leftframecolor}} ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \startuseMPgraphic{mp_frame_right} draw rightboundary OverlayBox withpen pensquare scaled \frameddimension{rightrulethickness} withcolor \MPcolor{\framedparameter{rightframecolor}} ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \startuseMPgraphic{mp_frame_top} draw topboundary OverlayBox withpen pensquare scaled \frameddimension{toprulethickness} withcolor \MPcolor{\framedparameter{topframecolor}} ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \startuseMPgraphic{mp_frame_bottom} draw bottomboundary OverlayBox withpen pensquare scaled \frameddimension{bottomrulethickness} withcolor \MPcolor{\framedparameter{bottomframecolor}} ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \installleftframerenderer {mp} {\useMPgraphic{mp_frame_left}} \installrightframerenderer {mp} {\useMPgraphic{mp_frame_right}} \installtopframerenderer {mp} {\useMPgraphic{mp_frame_top}} \installbottomframerenderer {mp} {\useMPgraphic{mp_frame_bottom}} \setupframed [ leftframecolor=\framedparameter{framecolor}, rightframecolor=\framedparameter{framecolor}, topframecolor=\framedparameter{framecolor}, bottomframecolor=\framedparameter{framecolor}, leftrulethickness=\framedparameter{rulethickness}, rightrulethickness=\framedparameter{rulethickness}, toprulethickness=\framedparameter{rulethickness}, bottomrulethickness=\framedparameter{rulethickness}] \endinput %%%% end meta-imp-mpframe.mkiv %%%% begin mpframe.tex \useMPlibrary[mpframe] \definextable [mp] [width=2cm, height=2cm, align={middle,lohi}, foregroundstyle=\ssd, framecolor=red, % use the custom frame renderer for all four sides: leftframe=mp, rightframe=mp, topframe=mp, bottomframe=mp] \starttext \startxtable[mp] \startxrow[bottomrulethickness=2pt] \startxcell[rightframecolor=blue] A \stopxcell \startxcell[leftframe=off] B \stopxcell \stopxrow \startxrow \startxcell[leftframecolor=green,leftrulethickness=2pt] C \stopxcell \startxcell[rightframecolor=orange,rightrulethickness=2pt] D \stopxcell \stopxrow \stopxtable \stoptext %%%% end mpframe.tex --------------070701050300010705020602 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit
19. Juni 2018 um 03:26

Hi everyone,

 

Excuse my poor English. I recently updated my online table generator (http://latex-tables.com) to support ConTeXt. It also supports many languages, like LaTeX, Plain TeX, Markdown, HTML and more. It uses the eXtreme table format and supports many features including :

- Borders, border width and border color

- Merged cells

- Background color

- Alignment (flushleft, center, flushright)

- Splitted tables

- Rotated tables

- Caption

- More...

 

However, I have many issues that I have trouble to fix.

 

1/ I have many troubles with borders, because I can't set the color and the width of each border. Instead, I use "fake rows" and "fake cells" when it is necessary. However, I can't figure out how to set the height of a row to 0.4pt. It's always bigger. So, instead I use "location=hanging" on this row but, because of this, borders are hidden behind the next row's background. What can I do about this ?


Frames accept only a single color and line thickness for all borders but there are two ways to set different values for each side The first method is to disable the frame and apply a background graphic where you draw different lines for each side. The other method is to create a custom renderer for each frame (top, bottom etc.) where you can than apply a different color or linewidth for each side, below (and also attached) is a example where I show how this can be done.

Wolfgang


%%%% begin meta-imp-mpframe.mkiv
\startuseMPgraphic{mp_frame_left}
  draw leftboundary OverlayBox
    withpen pensquare scaled \frameddimension{leftrulethickness}
    withcolor \MPcolor{\framedparameter{leftframecolor}} ;
  setbounds currentpicture to OverlayBox ;
\stopuseMPgraphic

\startuseMPgraphic{mp_frame_right}
  draw rightboundary OverlayBox
    withpen pensquare scaled \frameddimension{rightrulethickness}
    withcolor \MPcolor{\framedparameter{rightframecolor}} ;
  setbounds currentpicture to OverlayBox ;
\stopuseMPgraphic

\startuseMPgraphic{mp_frame_top}
  draw topboundary OverlayBox
    withpen pensquare scaled \frameddimension{toprulethickness}
    withcolor \MPcolor{\framedparameter{topframecolor}} ;
  setbounds currentpicture to OverlayBox ;
\stopuseMPgraphic

\startuseMPgraphic{mp_frame_bottom}
  draw bottomboundary OverlayBox
    withpen pensquare scaled \frameddimension{bottomrulethickness}
    withcolor \MPcolor{\framedparameter{bottomframecolor}} ;
  setbounds currentpicture to OverlayBox ;
\stopuseMPgraphic

\installleftframerenderer   {mp} {\useMPgraphic{mp_frame_left}}
\installrightframerenderer  {mp} {\useMPgraphic{mp_frame_right}}
\installtopframerenderer    {mp} {\useMPgraphic{mp_frame_top}}
\installbottomframerenderer {mp} {\useMPgraphic{mp_frame_bottom}}

\setupframed
  [     leftframecolor=\framedparameter{framecolor},
       rightframecolor=\framedparameter{framecolor},
         topframecolor=\framedparameter{framecolor},
      bottomframecolor=\framedparameter{framecolor},
     leftrulethickness=\framedparameter{rulethickness},
    rightrulethickness=\framedparameter{rulethickness},
      toprulethickness=\framedparameter{rulethickness},
   bottomrulethickness=\framedparameter{rulethickness}]

\endinput
%%%% end meta-imp-mpframe.mkiv


%%%% begin mpframe.tex
\useMPlibrary[mpframe]

\definextable
  [mp]
  [width=2cm,
   height=2cm,
   align={middle,lohi},
   foregroundstyle=\ssd,
   framecolor=red,
   % use the custom frame renderer for all four sides:
   leftframe=mp,
   rightframe=mp,
   topframe=mp,
   bottomframe=mp]

\starttext

\startxtable[mp]
    \startxrow[bottomrulethickness=2pt]
        \startxcell[rightframecolor=blue]
            A
        \stopxcell
        \startxcell[leftframe=off]
            B
        \stopxcell
    \stopxrow
    \startxrow
        \startxcell[leftframecolor=green,leftrulethickness=2pt]
            C
        \stopxcell
        \startxcell[rightframecolor=orange,rightrulethickness=2pt]
            D
        \stopxcell
    \stopxrow
\stopxtable

\stoptext
%%%% end mpframe.tex

--------------070701050300010705020602-- --------------020505000805080402040503 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="meta-imp-mpframe.mkiv" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="meta-imp-mpframe.mkiv" \startuseMPgraphic{mp_frame_left} draw leftboundary OverlayBox withpen pensquare scaled \frameddimension{leftrulethickness} withcolor \MPcolor{\framedparameter{leftframecolor}} ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \startuseMPgraphic{mp_frame_right} draw rightboundary OverlayBox withpen pensquare scaled \frameddimension{rightrulethickness} withcolor \MPcolor{\framedparameter{rightframecolor}} ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \startuseMPgraphic{mp_frame_top} draw topboundary OverlayBox withpen pensquare scaled \frameddimension{toprulethickness} withcolor \MPcolor{\framedparameter{topframecolor}} ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \startuseMPgraphic{mp_frame_bottom} draw bottomboundary OverlayBox withpen pensquare scaled \frameddimension{bottomrulethickness} withcolor \MPcolor{\framedparameter{bottomframecolor}} ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \installleftframerenderer {mp} {\useMPgraphic{mp_frame_left}} \installrightframerenderer {mp} {\useMPgraphic{mp_frame_right}} \installtopframerenderer {mp} {\useMPgraphic{mp_frame_top}} \installbottomframerenderer {mp} {\useMPgraphic{mp_frame_bottom}} \setupframed [ leftframecolor=\framedparameter{framecolor}, rightframecolor=\framedparameter{framecolor}, topframecolor=\framedparameter{framecolor}, bottomframecolor=\framedparameter{framecolor}, leftrulethickness=\framedparameter{rulethickness}, rightrulethickness=\framedparameter{rulethickness}, toprulethickness=\framedparameter{rulethickness}, bottomrulethickness=\framedparameter{rulethickness}] \endinput --------------020505000805080402040503 Content-Type: application/x-tex; name="mpframe.tex" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="mpframe.tex" \useMPlibrary[mpframe] \definextable [mp] [width=2cm, height=2cm, align={middle,lohi}, foregroundstyle=\ssd, framecolor=red, % use the custom frame renderer for all four sides: leftframe=mp, rightframe=mp, topframe=mp, bottomframe=mp] \starttext \startxtable[mp] \startxrow[bottomrulethickness=2pt] \startxcell[rightframecolor=blue] A \stopxcell \startxcell[leftframe=off] B \stopxcell \stopxrow \startxrow \startxcell[leftframecolor=green,leftrulethickness=2pt] C \stopxcell \startxcell[rightframecolor=orange,rightrulethickness=2pt] D \stopxcell \stopxrow \stopxtable \stoptext --------------020505000805080402040503 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --------------020505000805080402040503--