ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "\"H. Özoguz\"" <h.oezoguz@mmnetz.de>
To: ntg-context@ntg.nl
Subject: Adjust font size to cell height in natural table
Date: Mon, 27 May 2013 13:54:58 +0200	[thread overview]
Message-ID: <51A34992.4090306@mmnetz.de> (raw)

Hello together,

I use this as a natural table

\def\esl[#1][#2][#3][#4][#5][#6][#7]{%
\page
\startframed[frame=off,width=fit,offset=overlay,align=middle,background=eslami]%
   \bTABLE[width=4.55cm,align={middle,lohi}]
     \bTR\bTD[height=2cm] ~\blank[-3.4mm]#1 \eTD\eTR
     \bTR\bTD[height=3cm] #2\\#3\\#4\\#5\\#6 \eTD\eTR
     \bTR\bTD[height=2.4cm] #7 \eTD\eTR
   \eTABLE
\stopframed}

Now it can happen, that the text of #7 is too long for the third cell, 
which is 4.55cm x 2.4cm. Is it possible to automatically adjust the fonz 
size (of this text in this sepcific cell only), s.t. it fits in the cell?

For testing:
%***********************************************************
\defineoverlay[eslami][{\externalfigure[eslamivorlage.pdf]}]
\def\esl[#1][#2][#3][#4][#5][#6][#7]{%
\page
\startframed[frame=off,width=fit,offset=overlay,align=middle]%
   \bTABLE[width=4.55cm,align={middle,lohi}]
     \bTR\bTD[height=2cm] ~\blank[-3.4mm]#1 \eTD\eTR
     \bTR\bTD[height=3cm] #2\\#3\\#4\\#5\\#6 \eTD\eTR
     \bTR\bTD[height=2.4cm] #7 \eTD\eTR
   \eTABLE
\stopframed}
\setuppagenumbering[location=]
\definepapersize[sheet][width=45.5mm,height=74mm]
\definepapersize[bigsheet][width=\dimexpr\paperwidth+2mm\relax,height=\dimexpr\paperheight+2mm\relax]
\setuplayout
   [location=middle,
    topspace=0mm,
    header=0mm,
    footer=0mm,
    bottomspace=0mm,
    width=middle,
    cutspace=0mm,
    backspace=0mm, %BCOR 5mm inkl.
    height=fit,
    grid=no]
\setuppapersize[sheet][bigsheet]
\setupbackgrounds[page][frame=off,frameoffset=0mm]
\starttext
\esl[Begriff][VB 1][VB 2][VB 3][VB 4][VB 5][Too small, too small, too 
small, too small, too small, too small, too small, too small. What to do?]
\stoptext
%***********************************************************

Thanks!
Huseyin

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


                 reply	other threads:[~2013-05-27 11:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51A34992.4090306@mmnetz.de \
    --to=h.oezoguz@mmnetz.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).