ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* minor remarks on core-tab.tex
@ 2000-12-16 23:22 Uwe Koloska
  2000-12-17 20:16 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Uwe Koloska @ 2000-12-16 23:22 UTC (permalink / raw)


Hello,

yesterday I was in need for a sophisticated table and since the manual only 
has tabulation and the natural tables seemed to complicated, I studied the 
source for table (core-tab.tex and thrd-tab.tex).  There I found something 
that might be remarkable ;-)

Near the beginning is a line:
    \doifundefined{BeginTable}{\doinputonce{table.tex}}
This only works, because thrd-tab.tex (a renamed version of table.tex) is 
loaded before ...
So this has to be changed to "\doinputonce(thrd-tab.tex}"

Where can I find some docu about table.tex???  I wanted to make a table 
with two columns.  The first one as wide as the widest entry, and the 
second one a paragraph that fills the rest of the line.  I couldn't figure 
out how to do (neither with tabulate, nor tables and natural tables) ...

There are two lines with something like:
    \doifnumberelse{#1x}             % x ???????????????

I am no TeX expert -- so I am very proud that I can say: It's possible that 
I know what this means (Tusch!) ;-))))

\doifnumberelse test it's argument and if there are numbers in the first 
positions it's true otherwise false.
    \doifnumberelse{1234x} -> true
    \doifnumberelse{ab12x} -> false
and if #1 is an empty argument:
    \doifnumberelse{x}     -> false

The 'x' is there to prevent the expression inside {} expanding to nothing.

Hey that are no bugs and nothing great, but ...

Uwe

-- 
mailto:koloska@rcs.urz.tu-dresden.de
http://rcswww.urz.tu-dresden.de/~koloska/
--                                    --
right now the web page is in german only
but this will change as time goes by ;-)


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

* Re: minor remarks on core-tab.tex
  2000-12-16 23:22 minor remarks on core-tab.tex Uwe Koloska
@ 2000-12-17 20:16 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2000-12-17 20:16 UTC (permalink / raw)
  Cc: ntg-context

At 12:22 AM 12/17/00 +0100, Uwe Koloska wrote:

>yesterday I was in need for a sophisticated table and since the manual only 
>has tabulation and the natural tables seemed to complicated, I studied the 
>source for table (core-tab.tex and thrd-tab.tex).  There I found something 

you can find examples in the dutch version [same commands so usable] since
i still have to correct the english chapter

>that might be remarkable ;-)

Ah! 

>Near the beginning is a line:
>    \doifundefined{BeginTable}{\doinputonce{table.tex}}
>This only works, because thrd-tab.tex (a renamed version of table.tex) is 
>loaded before ...
>So this has to be changed to "\doinputonce(thrd-tab.tex}"

When you look in context.tex, the main context file, you will see that
thrd-tab.tex is loaded there. The loading of table.tex in the module itself
is only there for historic reasons: (1) one could use this module in plain
and (2) this is the fall back. So, it's ok. 

>Where can I find some docu about table.tex???  I wanted to make a table 
>with two columns.  The first one as wide as the widest entry, and the 
>second one a paragraph that fills the rest of the line.  I couldn't figure 
>out how to do (neither with tabulate, nor tables and natural tables) ...

That's something built in tabulate: 

\starttabulate[|l|p|]
\NC entry \NC paragraph \NC \NR 
\stoptabulate

does exactly that, while [|l|p|p|] gives both pars the same width. You can
specify the width too (see manual). 

Paragraphs are split between lines when crossing pages. 

>There are two lines with something like:
>    \doifnumberelse{#1x}             % x ???????????????
>
>I am no TeX expert -- so I am very proud that I can say: It's possible that 
>I know what this means (Tusch!) ;-))))
>
>\doifnumberelse test it's argument and if there are numbers in the first 
>positions it's true otherwise false.
>    \doifnumberelse{1234x} -> true

right 

>    \doifnumberelse{ab12x} -> false

right 

>and if #1 is an empty argument:
>    \doifnumberelse{x}     -> false

right 

>The 'x' is there to prevent the expression inside {} expanding to nothing.

right, dirty eh? 

>Hey that are no bugs and nothing great, but ...

Well, since there is no real good way to test numbers in tex (apart from an
assignment in batchmode, which spoils the log and is slow) i need this
trick. The definition of \doifnumberelse (in syst module) in itself is kind
of interesting, and it took me some tome and a brainwave too cook it up. 

Hans
-------------------------------------------------------------------------
                                                  Hans Hagen | PRAGMA ADE
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

end of thread, other threads:[~2000-12-17 20:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-16 23:22 minor remarks on core-tab.tex Uwe Koloska
2000-12-17 20:16 ` 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).