[NTG-context] Re: Table head/body via lua

2023-08-18 Thread Wolfgang Schuster

Alexey Kryukov schrieb am 18.08.2023 um 19:02:

Hi,

I am trying to generate a table representation for some xml source.
As the data structure doesn't directly correspond to the desired table
structure, some manipulations via lua are required. So far everything
works OK except table sectioning commands, like \bTABLEhead,
\eTABLEhead, bTABLEbody or \eTABLEbody: it seems impossible to
incapsulate them into lua functions. For example, the following is not
compiled:

\starttext
\bTABLE
\ctxlua{context.bTABLEbody()}
\bTR
\bTD Cell 1\eTD
\bTD Cell 2\eTD
\eTR
\ctxlua{context.eTABLEbody()}
\eTABLE
\stoptext

Can anybody suggest a workaround (except changing the source XML of
course)?


Do you create the whole table with Lua? When this is the case a small 
change to the table section
commands on the Lua side can fix your problems but otherwise a different 
approach is needed.


Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Table head/body via lua

2023-08-18 Thread Alexey Kryukov
Hi,

I am trying to generate a table representation for some xml source.
As the data structure doesn't directly correspond to the desired table
structure, some manipulations via lua are required. So far everything
works OK except table sectioning commands, like \bTABLEhead,
\eTABLEhead, bTABLEbody or \eTABLEbody: it seems impossible to
incapsulate them into lua functions. For example, the following is not
compiled:

\starttext
\bTABLE
\ctxlua{context.bTABLEbody()}
\bTR
\bTD Cell 1\eTD
\bTD Cell 2\eTD
\eTR
\ctxlua{context.eTABLEbody()}
\eTABLE
\stoptext

Can anybody suggest a workaround (except changing the source XML of
course)?

-- 
Regards,
Alexey Kryukov 

Moscow State University
Faculty of History
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] natural table oddities

2023-03-27 Thread Bruce Horrocks via ntg-context
If you're asking for comments with a view to making changes then...

> On 27 Mar 2023, at 15:03, Henning Hraban Ramm via ntg-context 
>  wrote:
> 
> I would be happy about some answers/comments.
> Hraban
> 
> Am 13.03.23 um 23:26 schrieb Henning Hraban Ramm:
>> Working on the documentation for “natural tables” in my book I stumbled upon 
>> a few oddities/problems:
>> ## Addressing cells:
>> * There’s \setupTABLE[header], but not "footer" (or "section"); since we 
>> have TABLEhead and TABLEfoot, IMO "head" and "foot" would make sense.

I'd be happy with that, especially as there is already headstyle and headcolor.

>> * Row 1 is the first row of TABLEbody. I couldn’t find how to address the 
>> first line of TABLEbody.
>> * If I format a column, e.g. \setupTABLE[c][-1][color=red], body and foot 
>> are formatted, but not the same column in header. I couldn’t find how to 
>> format columns in header.

If you disregard the Wiki page instructions to use \bTH...\eTH then you can 
format the header using:

  \bTABLEhead
\bTR \bTH Column 1 \eTH \bTD[color=blue] Column 2 \eTD \eTR
  \eTABLEhead

but I'm not sure what the consequences might be, if any. You lose the default 
bold heading so maybe that's all /bTH.../eTH is adding?

It would be nice to have a way of specifying the header explicitly. My 
suggestion would be to have:
- \setupTABLE[r][head][...] affect just the header
- \setupTABLE[r][next][...] affect the new page header
- \setupTABLE[r][first|last|body][...] affect the first, or last, or only the 
body rows (i.e. not the header or footer)
- \setupTABLE[r][foot][...] affect just the footer 

[r][last] (and [r][-1]) would represent the last body row (but not the footer 
row if one has been requested).

Extending to the formatting of header/footer/next etc columns is not quite so 
neat as an extra parameter is required, e.g. [c][][head][...] to reference 
column n in the header. For consistency the syntax [c][][body][...] could be 
an option.


>> * I don’t understand the addressing options "start" and "one".

Me neither. :)

>> ## Formatting
>> * maxwidth doesn’t seem to have an effect, neither on the whole table nor on 
>> a column.
>> * textwidth works only for the whole table.
>> * width gets stretched if option=stretch; i.e. I can’t fix the width of 
>> single cells or columns.

For me, \setupTABLE [c] [1] [width=3cm] fixes the width of column 1 and forces 
long text to wrap.

I'm not sure what your \textwidth comment relates to because \setupTABLE [c] 
[1] [width=.2\textwidth] works as expected for me.


>> ## Page breaking
>> * What’s the difference between split=repeat and header=repeat ?

\setupTABLE [split=repeat] % works as expected for me
\setupTABLE [header=repeat] % doesn't work for me


>> I’d like to know if there are misunderstandings / if the behavior is 
>> intentional.

—
Bruce Horrocks
Hampshire, UK

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] rotated headers in natural tables

2023-03-17 Thread Wolfgang Schuster via ntg-context

Henning Hraban Ramm via ntg-context schrieb am 15.03.2023 um 19:15:

Hi!

In my table, I want the header texts to be 90˚ rotated and aligned to 
the bottom of their cell. I couldn’t find an option to do that.

Tried \dontleavehmode or \hfill in my \RtH macro to no avail.
Is it possible?


\define[1]{\RtH}{\rotate{#1}}

\starttext

\setupTABLE[offset=3pt]
\setupTABLE[header][background=color,backgroundcolor=yellow,align=bottom]
\bTABLE
\bTABLEhead
\bTR \bTH\RtH{animal}\eTH \bTH\RtH{size}\eTH \bTH\RtH{weight}\eTH 
\bTH\RtH{average speed}\eTH \eTR


You can change the vertical alignment in a framed (and therefore also
natural tables and extreme tables) with align=high, align=low and 
align=lohi.


\bTR[align={middle,low},strut=no]
    \bTH \dontleavehmode\rotate{animal} \eTH
    \bTH \dontleavehmode\rotate{size} \eTH
    \bTH \dontleavehmode\rotate{weight} \eTH
    \bTH \dontleavehmode\rotate{average speed} \eTH
\eTR

\dontleavehmode is only needed when you set horizontal alignment
(align=middle) and strut=no ensures there is no extra space at the bottom
of the cells (remove the setting to see the difference).

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] rotated headers in natural tables

2023-03-15 Thread Bruce Horrocks via ntg-context
\setupTABLE inherits from \setupframed which has an orientation option.

So \bTR[orientation=90] on the header row should do it, with the content 
specified normally i.e. without using \RtH.

A quick test on one of my tables showed some issues with alignment so you may 
need to fix the 'width' (now the height) of the cells rather than let it be 
calculated by contents.

> On 15 Mar 2023, at 18:15, Henning Hraban Ramm via ntg-context 
>  wrote:
> 
> Hi!
> 
> In my table, I want the header texts to be 90˚ rotated and aligned to the 
> bottom of their cell. I couldn’t find an option to do that.
> Tried \dontleavehmode or \hfill in my \RtH macro to no avail.
> Is it possible?
> 
> 
> \define[1]{\RtH}{\rotate{#1}}
> 
> \starttext
> 
> \setupTABLE[offset=3pt]
> \setupTABLE[header][background=color,backgroundcolor=yellow,align=bottom]
> \bTABLE
> \bTABLEhead
> \bTR \bTH\RtH{animal}\eTH \bTH\RtH{size}\eTH \bTH\RtH{weight}\eTH 
> \bTH\RtH{average speed}\eTH \eTR
> \eTABLEhead
> \bTABLEbody
> \bTR \bTD sparrow \eTD \bTD small \eTD \bTD light \eTD \bTD high \eTD \eTR
> \bTR \bTD dog \eTD \bTD medium \eTD \bTD medium \eTD \bTD medium \eTD \eTR
> \bTR \bTD snail \eTD \bTD small \eTD \bTD light \eTD \bTD slow \eTD \eTR
> \bTR \bTD elephant \eTD \bTD big \eTD \bTD heavy \eTD \bTD medium \eTD \eTR
> \eTABLEbody
> \eTABLE
> 
> \stoptext
> 

—
Bruce Horrocks
Hampshire, UK

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] rotated headers in natural tables

2023-03-15 Thread fv leung via ntg-context
How about using \vfill ?

\define[1]{\RtH}{\vfill\rotate{#1}}

Henning Hraban Ramm via ntg-context  於 2023年3月16日 週四
上午2:16寫道:

> Hi!
>
> In my table, I want the header texts to be 90˚ rotated and aligned to
> the bottom of their cell. I couldn’t find an option to do that.
> Tried \dontleavehmode or \hfill in my \RtH macro to no avail.
> Is it possible?
>
>
> \define[1]{\RtH}{\rotate{#1}}
>
> \starttext
>
> \setupTABLE[offset=3pt]
> \setupTABLE[header][background=color,backgroundcolor=yellow,align=bottom]
> \bTABLE
> \bTABLEhead
> \bTR \bTH\RtH{animal}\eTH \bTH\RtH{size}\eTH \bTH\RtH{weight}\eTH
> \bTH\RtH{average speed}\eTH \eTR
> \eTABLEhead
> \bTABLEbody
> \bTR \bTD sparrow \eTD \bTD small \eTD \bTD light \eTD \bTD high \eTD \eTR
> \bTR \bTD dog \eTD \bTD medium \eTD \bTD medium \eTD \bTD medium \eTD \eTR
> \bTR \bTD snail \eTD \bTD small \eTD \bTD light \eTD \bTD slow \eTD \eTR
> \bTR \bTD elephant \eTD \bTD big \eTD \bTD heavy \eTD \bTD medium \eTD \eTR
> \eTABLEbody
> \eTABLE
>
> \stoptext
>
> Hraban
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] rotated headers in natural tables

2023-03-15 Thread Henning Hraban Ramm via ntg-context

Hi!

In my table, I want the header texts to be 90˚ rotated and aligned to 
the bottom of their cell. I couldn’t find an option to do that.

Tried \dontleavehmode or \hfill in my \RtH macro to no avail.
Is it possible?


\define[1]{\RtH}{\rotate{#1}}

\starttext

\setupTABLE[offset=3pt]
\setupTABLE[header][background=color,backgroundcolor=yellow,align=bottom]
\bTABLE
\bTABLEhead
\bTR \bTH\RtH{animal}\eTH \bTH\RtH{size}\eTH \bTH\RtH{weight}\eTH 
\bTH\RtH{average speed}\eTH \eTR

\eTABLEhead
\bTABLEbody
\bTR \bTD sparrow \eTD \bTD small \eTD \bTD light \eTD \bTD high \eTD \eTR
\bTR \bTD dog \eTD \bTD medium \eTD \bTD medium \eTD \bTD medium \eTD \eTR
\bTR \bTD snail \eTD \bTD small \eTD \bTD light \eTD \bTD slow \eTD \eTR
\bTR \bTD elephant \eTD \bTD big \eTD \bTD heavy \eTD \bTD medium \eTD \eTR
\eTABLEbody
\eTABLE

\stoptext

Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] [m-database] How to properly add module arguments?

2023-02-25 Thread Paul Mazaitis via ntg-context
Dear list,

## The Incredibly Short Version

I am trying to extend m-database, and I want to add a flag to control behavior. 
I can get it to work, but I am having trouble understanding how to do it 
properly.

## The Short Version

I have a project where I wish to incorporate many CSV files as Natural Tables.

I want to keep the headers in the CSV files so they're useful in other contexts.

The `m-database` module doesn't have a feature to suppress the header row, from 
what I can see.

(I know `handlecsv` can do this, but I'm having troubles with that; if the 
`m-database` line of inquiry doesn't work out, I'll go back it, but I figure 
I'll focus on this solution for now.)

Looking at the module sources, I can implement the functionality I need in the 
Lua part of the module, but:

I seem to only be able to bodge in additional arguments for the commands in the 
module.

On first try, I got the error: `tex error   > tex error on line 30 in file 
/Users/pmazaitis/Opt/context/tex/texmf-context/tex/context/modules/mkiv/m-databaseplus.mkiv:
 ! Undefined control sequence`

And then: `The control sequence at the end of the top line of your error 
message was never
\def'ed.`

Looking at the docs points me to a solution using  `\def`, but it's not clear 
to me how that's working in the case of the database module (the database 
module seems to be initializing these values someplace else?).

If I \def the settings variable in m-database.mkiv,  I can get it to work, but 
I don't think that's the correct way to go about this.

Question: how do I properly define new module arguments for the database module?

## The Long Version, With MWE

### Files Associated With the MWE

Apologies for all of the file inclusions, but I want to be complete.


Here's the .csv file I'm using for the MWE:

--- begin database-mwe.csv ---

Ref. No.,Part No.,Description,Remarks
,RD14C82E000J,Carbon 000흮 ±5% 1/4W,

---  end database-mwe.csv  ---

Some notes on database-mwe.csv:

I'd like to keep the header row in place to make this file useful for other 
tools.

These are lists of electronic parts, so I'd like to include uppercase omega, 
lower case mu, and percent sign characters in the CSV file.


Here's the .tex file I'm using for the MWE:

--- begin database-mwe.tex ---

\usemodule[database]

\setupdatabase[quotechar={"},separator={,}]

\defineseparatedlist
  [PartsTable]
  [separator=comma,left=\bTD,right=\eTD,first=\bTR,last=\eTR,before={
\bTABLE[split=repeat,option=stretch]
  \bTABLEhead
  \bTR
\bTH Ref. No. \eTH \bTH Part No. \eTH \bTH Description \eTH \bTH Remarks 
\eTH
  \eTR
  \eTABLEhead
  \bTABLEbody
   },
   after={
  \eTABLEbody
  \eTABLE
   }]

\starttext

test

\startasciimode
\processdatabasefile[PartsTable][parts_list-test.csv]
\stopasciimode

\stoptext

---  end database-mwe.tex  ---

Some notes on database-mwe.tex:

This actually works pretty well with the distributed m-database module!

Some of these lists are quite long, so I want to use a TABLEhead to replicate 
the headings at the top of a new page. I don't think there's a way to automate 
this with `m-database`, so I'm okay with hard-coding the headers. This does 
mean I get a double header row at the top of the table. I want to suppress the 
header row; I'd like to implement this behavior in the module behind a switch.

(I'm using the `asciimode` environment to dodge problems with unescaped `%` 
characters and Greek letters. I tried adding the startasciimode/stopasciimode 
commands to various keys in the \defineseparatedlist command, but I didn't get 
anywhere with it - I got errors. A problem for another time...)

I think I've got a good handle on how to do this in Lua, but I'm struggling 
with what to add to the switch appropriately.

In attempting to add a switch, I tried the following.

Based off of https://wiki.contextgarden.net/Modules#Modules_writing_guidelines,
I added a stanza to the appropriate interface file:

--- begin stanza added to i-database.xml ---






---  end stanza added to i-database.xml  ---

I modeled that after the stanza for the argument `strip`. I think that's the 
only thing I need to do in the interface file.

Changing the i-database.xml file does not break the build.

However, as soon as I add the skipheader argument to the m-database.mkiv file:

--- begin definition in m-database.mkiv ---

\setupdatabase
  [\c!separator={,},
   \c!quotechar=,
   \c!commentchar=,
   \c!strip=\v!no,
   \c!skipheader=\v!no, % <- Added, following the pattern with strip
   \c!before=,
   \c!after=,
   \c!first=,
   \c!last=,
   \c!left=,
   \c!right=]

---  end definition in m-database.mkiv  ---


...the build fails (with the error from the Short Version section).

If I then add the following \def to m-database.mkiv before the \setupdatabase 
command:

\def\c!skipheader {skipheader}

...the build succeeds! I can now pass that settings value to m-database.l

Re: [NTG-context] \xmlmap errors when returning key-value

2023-02-22 Thread Denis Maier via ntg-context
I maybe should have mentioned the error message I'm getting:

error in line 9, namespace '1CB>:', key 'align=lefttoright,'

Maybe that's helpful for tracking this down...

Best,
Denis

> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Denis Maier
> via ntg-context
> Gesendet: Montag, 20. Februar 2023 15:32
> An: ntg-context@ntg.nl
> Cc: Maier, Denis Christian (UB) 
> Betreff: [NTG-context] \xmlmap errors when returning key-value
> 
> > -Ursprüngliche Nachricht-
> > Von: ntg-context  Im Auftrag von Hans
> > Hagen via ntg-context
> > Gesendet: Donnerstag, 16. Februar 2023 23:45
> > An: Denis Maier via ntg-context 
> > Cc: Hans Hagen 
> > Betreff: Re: [NTG-context] Unexpected results with \xmlpos
> >
> > On 2/16/2023 10:16 AM, Denis Maier via ntg-context wrote:
> > > Hi,
> > >
> > > I’m getting unexpected results for \xmlpos
> > >
> > > With the example below, I was expecting to get the following positions:
> > >
> > > 1 2 3 4
> > >
> > > However the result is: 2 4 6 8, i.e. each time it’s exactly the double.
> > >
> > > What am I missing?
> >
> > that there are spaces between elements .. you can try:
> >
> > \xmlmatch {#1}
> >
> > instead
> >
> > Hans
> 
> Thanks, that does the trick.
> 
> However, now I get an error when I try to return a key-value setting via
> xmlmap, see below. Any hints why this does not work
> 
> \xmlmapvalue{colgroupalign}{dir: rtl}{align=righttoleft}
> \xmlmapvalue{colgroupalign}{dir: ltr}{align=lefttoright}
> 
> as opposed to:
> 
> \xmlmapvalue{colgroupalignvar}{dir: rtl}{righttoleft}
> \xmlmapvalue{colgroupalignvar}{dir: ltr}{lefttoright}
> 
> ?
> 
> Best,
> Denis
> 
> \startbuffer[test]
> 
> 
> 
>   
>  
> 
> 
> 
> 
>  
>  
> 
>asdf
>bsdf
>csdf
>dsdf
> 
>  
>  
> 
>a
>b
>c
>d
> 
>  
>   
> 
> 
> \stopbuffer
> 
> \startxmlsetups xml:test
> \xmlsetsetup{\xmldocument}{document}{xml:*}
> \xmlsetsetup{#1}{table-wrap}{xml:table-wrap}
> \xmlsetsetup{#1}{table}{xml:table}
> \stopxmlsetups
> 
> \xmlregistersetup{xml:test}
> 
> \xmlmapvalue{colgroupalign}{dir: rtl}{align=righttoleft}
> \xmlmapvalue{colgroupalign}{dir: ltr}{align=lefttoright}
> 
> \xmlmapvalue{colgroupalignvar}{dir: rtl}{righttoleft}
> \xmlmapvalue{colgroupalignvar}{dir: ltr}{lefttoright}
> 
> \startxmlsetups xml:table:colgroup
>   \xmlfilter {#1} {/col/command(xml:table:colgroup:col)} % gives errors
>   %\xmlfilter {#1} {/col/command(xml:table:colgroup:colvar)} % works
> \stopxmlsetups
> 
> \startxmlsetups xml:table:colgroup:colvar
>   \setupTABLE[c][\xmlmatch
> {#1}][align=\xmlvalue{colgroupalignvar}{\xmlatt{#1}{style}}{lefttoright}]
> \stopxmlsetups
> 
> \startxmlsetups xml:table:colgroup:col
>   \setupTABLE[c][\xmlmatch
> {#1}][\xmlvalue{colgroupalign}{\xmlatt{#1}{style}}{align=lefttoright}]
> \stopxmlsetups
> 
> \startxmlsetups xml:document
>   \xmlflush{#1}
> \stopxmlsetups
> 
> \startxmlsetups xml:table-wrap
>   \startplacetable
>   \xmlflush{#1}
> \stopplacetable
> \stopxmlsetups
> 
> \startxmlsetups xml:table
>   \xmlfilter {#1} {/colgroup/command(xml:table:colgroup)}
>   \bTABLE
>   \xmlfilter{#1}{/thead/command(xml:table:thead)}
>   \xmlfilter{#1}{/tbody/command(xml:table:tbody)}
>   \eTABLE
> \stopxmlsetups
> 
> \startxmlsetups xml:table:thead
>   \bTABLEhead
>   \xmlfilter{#1}{/tr/command(xml:table:thead:tr)}
>   \eTABLEhead
> \stopxmlsetups
> 
> \startxmlsetups xml:table:thead:tr
>   \bTR
>   \xmlfilter{#1}{/th/command(xml:table:thead:tr:th)}
>   \eTR
> \stopxmlsetups
> 
> \startxmlsetups xml:table:thead:tr:th
>   \bTH
>   \xmlflush{#1}
>   \eTH
> \stopxmlsetups
> 
> \startxmlsetups xml:table:tbody
> \bTABLEbody\xmlfilter{#1}{/tr/command(xml:table:tbody:tr)}\eTABLEbody
> \stopxmlsetups
> 
> \startxmlsetups xml:table:tbody:tr
> \bTR\xmlfilter{#1}{/td/command(xml:table:tbody:tr:td)}\eTR
> \stopxm

[NTG-context] \xmlmap errors when returning key-value

2023-02-20 Thread Denis Maier via ntg-context
> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Hans Hagen
> via ntg-context
> Gesendet: Donnerstag, 16. Februar 2023 23:45
> An: Denis Maier via ntg-context 
> Cc: Hans Hagen 
> Betreff: Re: [NTG-context] Unexpected results with \xmlpos
> 
> On 2/16/2023 10:16 AM, Denis Maier via ntg-context wrote:
> > Hi,
> >
> > I’m getting unexpected results for \xmlpos
> >
> > With the example below, I was expecting to get the following positions:
> >
> > 1 2 3 4
> >
> > However the result is: 2 4 6 8, i.e. each time it’s exactly the double.
> >
> > What am I missing?
> 
> that there are spaces between elements .. you can try:
> 
> \xmlmatch {#1}
> 
> instead
> 
> Hans

Thanks, that does the trick.

However, now I get an error when I try to return a key-value setting via 
xmlmap, see below. Any hints why this does not work

\xmlmapvalue{colgroupalign}{dir: rtl}{align=righttoleft}
\xmlmapvalue{colgroupalign}{dir: ltr}{align=lefttoright}

as opposed to:

\xmlmapvalue{colgroupalignvar}{dir: rtl}{righttoleft}
\xmlmapvalue{colgroupalignvar}{dir: ltr}{lefttoright}

?

Best,
Denis

\startbuffer[test]




   
  
  
  
  
   
   
  
 asdf
 bsdf
 csdf
 dsdf
  
   
   
  
 a
 b
 c
 d
  
   



\stopbuffer

\startxmlsetups xml:test
\xmlsetsetup{\xmldocument}{document}{xml:*}
\xmlsetsetup{#1}{table-wrap}{xml:table-wrap}
\xmlsetsetup{#1}{table}{xml:table}
\stopxmlsetups

\xmlregistersetup{xml:test}

\xmlmapvalue{colgroupalign}{dir: rtl}{align=righttoleft}
\xmlmapvalue{colgroupalign}{dir: ltr}{align=lefttoright}

\xmlmapvalue{colgroupalignvar}{dir: rtl}{righttoleft}
\xmlmapvalue{colgroupalignvar}{dir: ltr}{lefttoright}

\startxmlsetups xml:table:colgroup
\xmlfilter {#1} {/col/command(xml:table:colgroup:col)} % gives errors
%\xmlfilter {#1} {/col/command(xml:table:colgroup:colvar)} % works
\stopxmlsetups

\startxmlsetups xml:table:colgroup:colvar
  \setupTABLE[c][\xmlmatch 
{#1}][align=\xmlvalue{colgroupalignvar}{\xmlatt{#1}{style}}{lefttoright}]
\stopxmlsetups

\startxmlsetups xml:table:colgroup:col
  \setupTABLE[c][\xmlmatch 
{#1}][\xmlvalue{colgroupalign}{\xmlatt{#1}{style}}{align=lefttoright}]
\stopxmlsetups

\startxmlsetups xml:document
  \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:table-wrap
\startplacetable
\xmlflush{#1}
\stopplacetable
\stopxmlsetups

\startxmlsetups xml:table
  \xmlfilter {#1} {/colgroup/command(xml:table:colgroup)}
  \bTABLE
\xmlfilter{#1}{/thead/command(xml:table:thead)}
    \xmlfilter{#1}{/tbody/command(xml:table:tbody)}
  \eTABLE
\stopxmlsetups

\startxmlsetups xml:table:thead
\bTABLEhead
\xmlfilter{#1}{/tr/command(xml:table:thead:tr)}
\eTABLEhead
\stopxmlsetups

\startxmlsetups xml:table:thead:tr
\bTR
\xmlfilter{#1}{/th/command(xml:table:thead:tr:th)}
\eTR
\stopxmlsetups

\startxmlsetups xml:table:thead:tr:th
\bTH
\xmlflush{#1}
\eTH
\stopxmlsetups

\startxmlsetups xml:table:tbody 
\bTABLEbody\xmlfilter{#1}{/tr/command(xml:table:tbody:tr)}\eTABLEbody
\stopxmlsetups

\startxmlsetups xml:table:tbody:tr
\bTR\xmlfilter{#1}{/td/command(xml:table:tbody:tr:td)}\eTR
\stopxmlsetups

\startxmlsetups xml:table:tbody:tr:td
\bTC \xmlflush{#1} \eTC 
\stopxmlsetups


\starttext
  \xmlprocessbuffer{test}{test}{}
\stoptext

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Unexpected results with \xmlpos

2023-02-16 Thread Denis Maier via ntg-context
Hi,

I'm getting unexpected results for \xmlpos
With the example below, I was expecting to get the following positions:
1 2 3 4
However the result is: 2 4 6 8, i.e. each time it's exactly the double.

What am I missing?

Background: I need to define column alignment based on the value of the  
element inside the colgroup, so I was thinking about something like this :

\xmlmapvalue{colstyle}{dir: rtl}{align=righttolef }
\xmlmapvalue{colstyle}{dir: ltr}{align=lefttoright}

\startxmlsetups xml:table:colgroup:col
  \setupTABLE[c][\xmlpos{#1}][\xmlvalue{colstyle}{\xmlatt{#1}{style}}{}]
\stopxmlsetups

Best,
Denis

\startbuffer[test]




   
 
 
 
 
   
   
 
   a
   b
   c
   d
 
   
   
 
   a
   b
   c
   d
 
   



\stopbuffer

\startxmlsetups xml:test
\xmlsetsetup{\xmldocument}{document}{xml:*}
\xmlsetsetup{#1}{table-wrap}{xml:table-wrap}
\xmlsetsetup{#1}{table}{xml:table}
\stopxmlsetups

\xmlregistersetup{xml:test}

\startxmlsetups xml:document
  \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:table-wrap
\startplacetable
\xmlflush{#1}
\stopplacetable
\stopxmlsetups

\startxmlsetups xml:table:colgroup
%\xmlvalue{colstyle}{\xmlatt{#1}{style}}{}
\xmlfilter {#1} {/col/command(xml:table:colgroup:col)}
\stopxmlsetups

\startxmlsetups xml:table:colgroup:col
%\xmlvalue{colstyle}{\xmlatt{#1}{style}}{}
\xmlpos {#1}
\stopxmlsetups

\startxmlsetups xml:table
  \xmlfilter {#1} {/colgroup/command(xml:table:colgroup)}
  \bTABLE
\xmlfilter{#1}{/thead/command(xml:table:thead)}
\xmlfilter{#1}{/tbody/command(xml:table:tbody)}
  \eTABLE
\stopxmlsetups

\startxmlsetups xml:table:thead
\bTABLEhead
   \xmlfilter{#1}{/tr/command(xml:table:thead:tr)}
\eTABLEhead
\stopxmlsetups

\startxmlsetups xml:table:thead:tr
\bTR
   
\xmlfilter{#1}{/th/command(xml:table:thead:tr:th)}
\eTR
\stopxmlsetups

\startxmlsetups xml:table:thead:tr:th
\bTH
   \xmlflush{#1}
\eTH
\stopxmlsetups

\startxmlsetups xml:table:tbody
\bTABLEbody\xmlfilter{#1}{/tr/command(xml:table:tbody:tr)}\eTABLEbody
\stopxmlsetups

\startxmlsetups xml:table:tbody:tr
\bTR\xmlfilter{#1}{/td/command(xml:table:tbody:tr:td)}\eTR
\stopxmlsetups

\startxmlsetups xml:table:tbody:tr:td
\bTC \xmlflush{#1} \eTC
\stopxmlsetups


\starttext
  \xmlprocessbuffer{test}{test}{}
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Table breaks incorrectly between pages

2022-05-14 Thread Stefan Nedeljkovic via ntg-context
Wow, thank you very, very much!

On Sun, 15 May 2022, 05:35 śrīrāma,  wrote:

> On 5/13/22 12:30 PM Stefan Nedeljkovic via ntg-context wrote:
> > Dear list I need your help with a table that seems to completely screw up
> > the page when it spans across multiple pages. I'm attaching all the
> > necessary files.
> >
> > Kind regards,
> > Stefan
>
> This seems to be a known issue for quite a while, see here:
>   https://www.mail-archive.com/ntg-context@ntg.nl/msg69827.html
>
> As Wolfgang suggested there, you can use framed instead of TABLE in your
> header. I have modified your example file (see attached). With that you
> get the
> attached PDF.
>
> By the way, your example was missing a \bTABLEhead. Moreover, I believe
> cells
> in TABLE head entries should be enclosed by \bTH \eTH instead of \(b|e)TD.
> I
> have made these changes as well.
>
> [Also, I hope you are aware that you can use style=\tt, style=\bf per row/
> column/cell with \setupTABLE; that will significantly reduce markup in
> your
> file]
>
> Best,
>   Sreeram
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Table breaks incorrectly between pages

2022-05-14 Thread śrīrāma via ntg-context
On 5/13/22 12:30 PM Stefan Nedeljkovic via ntg-context wrote:
> Dear list I need your help with a table that seems to completely screw up
> the page when it spans across multiple pages. I'm attaching all the
> necessary files.
> 
> Kind regards,
> Stefan

This seems to be a known issue for quite a while, see here:
  https://www.mail-archive.com/ntg-context@ntg.nl/msg69827.html

As Wolfgang suggested there, you can use framed instead of TABLE in your 
header. I have modified your example file (see attached). With that you get the 
attached PDF.

By the way, your example was missing a \bTABLEhead. Moreover, I believe cells 
in TABLE head entries should be enclosed by \bTH \eTH instead of \(b|e)TD. I 
have made these changes as well.

[Also, I hope you are aware that you can use style=\tt, style=\bf per row/
column/cell with \setupTABLE; that will significantly reduce markup in your 
file]

Best,
  Sreeram% kate: hl ctx

\input fonts

\usetypescript[ibmplex][uc]
\setupbodyfont[ibmplex,rm,9pt]

\setuppapersize[A4]
\setuplayout[
leftedge=\dimexpr0cm,
rightedge=\dimexpr0cm,
leftedgedistance=\dimexpr0cm,
rightedgedistance=\dimexpr0cm,
leftmargin=\dimexpr0cm,
rightmargin=\dimexpr0cm,
leftmargindistance=\dimexpr0cm,
rightmargindistance=\dimexpr0cm,
width=middle,
cutspace=\dimexpr1.5cm,
backspace=\dimexpr1.5cm,
topspace=\dimexpr1.5cm,
header=\dimexpr4cm,
height=middle,
bottomspace=\dimexpr0cm,
footer=\dimexpr0.5cm]

\setupheadertexts[\directsetup{fheader}]

\definehspace[tnumber][0.5em]

\startsetups [fheader]
\startframed[width=max,frame=off]
\startoverlay
{\leftaligned{\framedtext[location=top,frame=off,width=fit,offset=0ex]{„ДОЛИНА” Д.О.О. Београд\\
  ПЈ за прераду меса\\
  ПИБ: СР 100029284\\
  МБ: 06434517\\
  Текући рачун: 205-157956-65\\
  Email: dolin...@gmail.com}}}
{\rightaligned{\framedtext[location=top,frame=off,width=fit,offset=0ex]{%
  Булевар Краља Александра 334, 11000 Београд\\
  011\hspace[tnumber]3806\hspace[tnumber]007\\
  011\hspace[tnumber]3820\hspace[tnumber]457\\
  011\hspace[tnumber]2419\hspace[tnumber]078\\
  \vskip 2em
  Жике Поповића бб, 12220, Велико Градиште\\
  012\hspace[tnumber]662\hspace[tnumber]016}}}
\stopoverlay
\stopframed
\stopsetups

\startsetups [headertable]
\setupTABLE[frame=off]
\setupTABLE[column][1][align=flushleft]
\setupTABLE[column][2][align=flushright]
\stopsetups

\startsetups headertext
\start
\bTABLE[setups=headertable,option=stretch]
\bTR
\bTD
„ДОЛИНА” Д.О.О. Београд\\
ПЈ за прераду меса\\
ПИБ: СР 100029284\\
МБ: 06434517\\
Текући рачун: 205-157956-65\\
Email: dolin...@gmail.com
\eTD
\bTD
Булевар Краља Александра 334, 11000 Београд\\
011\hspace[tnumber]3806\hspace[tnumber]007\\
011\hspace[tnumber]3820\hspace[tnumber]457\\
011\hspace[tnumber]2419\hspace[tnumber]078\\
\vskip 2em
Жике Поповића бб, 12220, Велико Градиште\\
012\hspace[tnumber]662\hspace[tnumber]016\\
\eTD
\eTR
\eTABLE
\stop
\stopsetups

\setuppagenumbering[location=]
\setupfootertexts[][\midaligned{\userpagenumber/\lastuserpage}]
\starttext
\switchtobodyfont[18pt]
\definehspace[hspacing][0.15em]
О\hspace[hspacing]Т\hspace[hspacing]П\hspace[hspacing]Р\hspace[hspacing]Е\hspace[hspacing]М\hspace[hspacing]Н\hspace[hspacing]И\hspace[hspacing]Ц\hspace[hspacing] А\\
\switchtobodyfont[9pt]
{\bf РАЧУН БРОЈ 3180/09}\\
\vskip 3em
Купац: ХЛАДНИ ИЗВОР\\
Место: РИПАЊ, Авалска бр. 261\\
ПИБ: 103358290\\
МБ: 17556711\\
\vskip 3em
Место издавања рачуна: Велико Градиште\\
Датум издавања рачуна: 04.06.2020. 11:13:03\\
Датум промета: 05.06.2020\\
Датум плаћања: 05.06.2020\\
\vskip 3em\start
\startsetups[maintable]
\setupTABLE[frame=off]
\setupTABLE[row][*][height=7.25mm]
\setupTABLE[column][1][align=flushleft]
\setupTABLE[column][2][align=flushleft]
\setupTABLE[column][3][align=flushleft]
\setupTABLE[column][4][alignmentcharacter={.},aligncharacter=yes,align=flushright]
\setupTABLE[column][5][alignmentcharacter={.},aligncharacter=yes,align=flushright]
\setupTABLE[column][6][alignmentcharacter={.},aligncharacter=yes,align=flushright]
\setupTABLE[column][7][alignmentcharacter={.},aligncharacter=yes,align=flushright]
\setupTABLE[column][8][alignmentcharacter={.},aligncharacter=yes,align=flushright]
\setupTABLE[column][9][alignmentcharacter={.},aligncharacter=yes,align=flushright]
\setupTABLE[column][10][alignmentcharacter={.},aligncharacter=yes,align=flushright]
\setupTABLE[column][11][alignmentcharacter={.},aligncharacter=yes,align=flushright]
\setupTABLE[column][12][alignmentcharacter={.},aligncharacter=yes,align=flushright]
\stopsetups
\switchtobodyfont[6pt]
\startalignment[middle]
\bTABLE[setups=maintable,option=stretch,split=repeat]
\bTABLEhead
\bTR[bottomframe=on, rulethickness=2pt,offset=0.25pt]
\bTH\bf Рб \eTH
\bTH\bf Шифра артикла \eTH
\bTH\bf Назив артикла \eTH
\bTH\bf Јединица мере \eTH
\bTH\bf Количина \eTH
\bTH\bf Цена \eTH
\bTH\bf Износ \eTH
\bTH\bf Попуст \eTH
\bTH\bf Основа за ПДВ \eTH
\bTH\bf Порез \eTH
\bTH\bf Износ пореза \eTH
\bTH\bf О

Re: [NTG-context] xmlpos values doubled

2022-04-20 Thread Ben Moon via ntg-context
Hello again,

I wonder whether anyone has some thoughts to help with my problem? Either why 
\xmlpos gives double values or alternatives to arrange my table format?

Best wishes,
Ben


On Mon, 28 Mar 2022, at 10:44, Ben Moon via ntg-context wrote:
> Hello All,
> 
> I'm trying to render a table stored in XML JATS format 
> (https://jats.nlm.nih.gov/archiving/) and eventually want to use the 
>  tag to setup column aligning from the @align attribute, e.g.,
> 
> \setupTABLE [column] [\xmlpos{#1}] [align=\xmlatt{#1}{align}]
> 
> Including \xmlpos{#1} I get double the value returned, i.e.: the first 
> element in colgroup returns 2, the second returns 4 etc.
> 
> Below is a MWE to show my issue. I show \xmlpos for each  tag in 
>   above the table, which returns 2, 4, 6, 8 but I expected 1, 2, 3, 
> 4. Am I missing something or is there another way I could do this?
> 
> 
> \startbuffer[table]
>   
> 
>   
> 
> 
> 
> 
>   
>   
> 
>   H1 (centre)
>   H2 (right)
>   H3
>   H4
> 
>   
>   
> 
>   A1
>   A2
>   A3
>   A4
> 
> 
>   B1
>   B2
>   B3
>   B4
> 
>   
> 
>   
> \stopbuffer
> 
> \startxmlsetups xml:tabletestsetups
> \xmlsetsetup{#1}{*}{-}
> % tables
> \xmlsetsetup{#1}{table-wrap|table}{xml:*}
> \xmlsetsetup{#1}{thead|tbody|tr|th|td}{xml:table:*}
> \xmlsetsetup{#1}{colgroup|col}{xml:*}
> \stopxmlsetups
> 
> \xmlregistersetup{xml:tabletestsetups}
> 
> \startxmlsetups xml:table-wrap
> \startplacetable
> % \contextversion \par
> \xmlflush{#1}
> \stopplacetable
> \stopxmlsetups
> 
> \startxmlsetups xml:table
> \bTABLE
> \xmlflush{#1}
> \eTABLE
> \stopxmlsetups
> 
> \startxmlsetups xml:colgroup
> \xmlflush{#1}
> \stopxmlsetups
> 
> \startxmlsetups xml:col
> \xmlpos{#1} \xmlatt{#1}{align}\par
> \stopxmlsetups
> 
> \startxmlsetups xml:table:thead
> \bTABLEhead
> \xmlflush{#1}
> \eTABLEhead
> \stopxmlsetups
> 
> \startxmlsetups xml:table:tr
> \bTR
> \xmlflush{#1}
> \eTR
> \stopxmlsetups
> 
> \startxmlsetups xml:table:th
> \bTH
> \xmlflush{#1}
> \eTH
> \stopxmlsetups
> 
> \startxmlsetups xml:table:tbody
> \bTABLEbody
> \xmlflush{#1}
> \eTABLEbody
> \stopxmlsetups
> 
> \startxmlsetups xml:table:td
> \bTC
> \xmlflush{#1}
> \eTC
> \stopxmlsetups
> 
> \xmlprocessbuffer{main}{table}{}
> 
> 
> All the best,
> Ben
> 
> 
> Ben Moon
> b...@themoons.uk
> 
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___
> 
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] xmlpos values doubled

2022-03-28 Thread Ben Moon via ntg-context
Hello All,

I'm trying to render a table stored in XML JATS format 
(https://jats.nlm.nih.gov/archiving/) and eventually want to use the  
tag to setup column aligning from the @align attribute, e.g.,

\setupTABLE [column] [\xmlpos{#1}] [align=\xmlatt{#1}{align}]

Including \xmlpos{#1} I get double the value returned, i.e.: the first element 
in colgroup returns 2, the second returns 4 etc.

Below is a MWE to show my issue. I show \xmlpos for each  tag in 
  above the table, which returns 2, 4, 6, 8 but I expected 1, 2, 3, 
4. Am I missing something or is there another way I could do this?


\startbuffer[table]
  

  




  
  

  H1 (centre)
  H2 (right)
  H3
  H4

  
  

  A1
  A2
  A3
  A4


  B1
  B2
  B3
  B4

  

  
\stopbuffer

\startxmlsetups xml:tabletestsetups
\xmlsetsetup{#1}{*}{-}
% tables
\xmlsetsetup{#1}{table-wrap|table}{xml:*}
\xmlsetsetup{#1}{thead|tbody|tr|th|td}{xml:table:*}
\xmlsetsetup{#1}{colgroup|col}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:tabletestsetups}

\startxmlsetups xml:table-wrap
\startplacetable
% \contextversion \par
\xmlflush{#1}
\stopplacetable
\stopxmlsetups

\startxmlsetups xml:table
\bTABLE
\xmlflush{#1}
\eTABLE
\stopxmlsetups

\startxmlsetups xml:colgroup
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:col
\xmlpos{#1} \xmlatt{#1}{align}\par
\stopxmlsetups

\startxmlsetups xml:table:thead
\bTABLEhead
\xmlflush{#1}
\eTABLEhead
\stopxmlsetups

\startxmlsetups xml:table:tr
\bTR
\xmlflush{#1}
\eTR
\stopxmlsetups

\startxmlsetups xml:table:th
\bTH
\xmlflush{#1}
\eTH
\stopxmlsetups

\startxmlsetups xml:table:tbody
\bTABLEbody
\xmlflush{#1}
\eTABLEbody
\stopxmlsetups

\startxmlsetups xml:table:td
\bTC
\xmlflush{#1}
\eTC
\stopxmlsetups

\xmlprocessbuffer{main}{table}{}


All the best,
Ben

Ben Moon
b...@themoons.uk
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Multiline cell in spreadsheettable

2021-11-18 Thread Hans Hagen via ntg-context

On 11/18/2021 5:07 PM, juh via ntg-context wrote:

Am Thu, Nov 18, 2021 at 12:56:33PM +0100 schrieb Hans Hagen:

On 11/18/2021 10:29 AM, juh via ntg-context wrote:

Hi all,

is there a parameter to have multiple lines in a cell in a spreadsheettable?

see end of m-spreadsheet ... they are just natural tables


I found this code on the wiki

% mode=mkiv
\setuppapersize[A5]
\bTABLE
\setupTABLE[c][each][alignmentcharacter={number->.},aligncharacter=yes,align=middle]
\bTABLEhead
\bTR
\bTH Same-Width Prefix \eTH \bTH Varying-Width Prefix \eTH
\bTH Same-Width Suffix \eTH \bTH Varying-Width Suffix \eTH
\eTR
\eTABLEhead
\bTABLEbody
\bTR \bTD  \$1.00 \eTD \bTD\$1.00 \eTD \bTD  1.00\% \eTD \bTD  1.00\%   
\eTD \eTR
\bTR \bTD \$10.00 \eTD \bTD \$\$10.00 \eTD \bTD 10.00\% \eTD \bTD 10.00\%\% 
\eTD \eTR
\bTR \bTD  \$1.0  \eTD \bTD\$1.0  \eTD \bTD  1.0\%  \eTD \bTD  1.0\%
\eTD \eTR
\bTR \bTD \$10.0  \eTD \bTD \$\$10.0  \eTD \bTD 10.0\%  \eTD \bTD 10.0\%\%  
\eTD \eTR
\eTABLEbody
\eTABLE

It sets the text of bTH like p{4cm} in LaTeX in several lines.

maybe something

\setupTABLE[c][1][width=4cm]
\setupTABLE[c][3][width=4cm]

or otherwise more cells with a span (nx=...)


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Multiline cell in spreadsheettable

2021-11-18 Thread juh via ntg-context
Am Thu, Nov 18, 2021 at 12:56:33PM +0100 schrieb Hans Hagen:
> On 11/18/2021 10:29 AM, juh via ntg-context wrote:
> > Hi all,
> > 
> > is there a parameter to have multiple lines in a cell in a spreadsheettable?
> see end of m-spreadsheet ... they are just natural tables

I found this code on the wiki

% mode=mkiv
\setuppapersize[A5]
\bTABLE
\setupTABLE[c][each][alignmentcharacter={number->.},aligncharacter=yes,align=middle]
\bTABLEhead
\bTR
\bTH Same-Width Prefix \eTH \bTH Varying-Width Prefix \eTH
\bTH Same-Width Suffix \eTH \bTH Varying-Width Suffix \eTH
\eTR
\eTABLEhead
\bTABLEbody
\bTR \bTD  \$1.00 \eTD \bTD\$1.00 \eTD \bTD  1.00\% \eTD \bTD  1.00\%   
\eTD \eTR
\bTR \bTD \$10.00 \eTD \bTD \$\$10.00 \eTD \bTD 10.00\% \eTD \bTD 10.00\%\% 
\eTD \eTR
\bTR \bTD  \$1.0  \eTD \bTD\$1.0  \eTD \bTD  1.0\%  \eTD \bTD  1.0\%
\eTD \eTR
\bTR \bTD \$10.0  \eTD \bTD \$\$10.0  \eTD \bTD 10.0\%  \eTD \bTD 10.0\%\%  
\eTD \eTR
\eTABLEbody
\eTABLE

It sets the text of bTH like p{4cm} in LaTeX in several lines.

But this does not work with my invoice code:

\startspreadsheettable[test][frame=off]
\setupTABLE[c][each][alignmentcharacter={number->.},aligncharacter=yes,align=middle]
\startrow[topframe=off,bottomframe=on]
\startcell[align=flushleft] "Anz" \stopcell
\startcell[align=flushleft, width=9cm] "Beschreibung" \stopcell
\startcell[align=flushleft] "MwSt" \stopcell
\startcell[align=flushright] "Einzeln" \stopcell
\startcell[align=flushright] "Gesamt" \stopcell
\stoprow

$for(positions)$
\startrow
\startcell[align=center] @ "0.2f h" $it.stunden$ \stopcell
\startcell[align=flushleft] "$it.name$" \stopcell  %<-- this cell should
be like p{4cm}
\startcell[align=flushright] @ "0.2f \percent" $it.mwst$ \stopcell
\startcell[align=flushright] @ "0.2f €" $it.stundensatz$ \stopcell
\startcell[align=flushright] @ "0.2f €" (A[row] * D[row]) \stopcell
\stoprow
$endfor$

\startrow[topframe=on]
\startcell[align=flushleft] " " \stopcell
\startcell[align=flushleft, style=bold] "Gesamt netto" \stopcell
\startcell[align=flushleft] " " \stopcell
\startcell[align=flushleft] " " \stopcell
\startcell[align=flushright, style=bold] @ "0.2f €" sum(E) \stopcell
\stoprow

\startrow[topframe=off]
\startcell[align=flushleft] " " \stopcell
\startcell[align=flushleft] "Mehrwertsteuer" \stopcell
\startcell[align=flushleft] " " \stopcell
\startcell[align=flushleft] " " \stopcell
\startcell[align=flushright] @ "0.2f €" 0.19 * E[row-1] \stopcell
\stoprow

\startrow[topframe=off]
\startcell[align=flushleft] " " \stopcell
\startcell[align=flushleft, style=bold] "Gesamtsumme" \stopcell
\startcell[align=flushleft] " " \stopcell
\startcell[align=flushleft] " " \stopcell
\startcell[align=flushright, style=bold] @ "0.2f €" E[row-1]+E[row-2] \stopcell
\stoprow
\stopspreadsheettable

The key between $ are variables which get filled by pandoc.


signature.asc
Description: PGP signature
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] How to improve visually a table

2021-02-16 Thread Wolfgang Schuster

Alain Delmotte schrieb am 16.02.2021 um 21:00:

Le 16/02/2021 à 20:02, Wolfgang Schuster a écrit :

Alain Delmotte schrieb am 16.02.2021 um 19:23:


Hi!

I am progressing in the use of ConTeXt by applying it to some 
specific projects.


For two manuals I am preparing for myself I'd like to reproduce the 
original work.


What I'd like to have:

nice table

What I have so far:

present state

How to obtain the first?



Can you show your code for the table.

Wolfgang

Here it is, but I did it to have a sufficiently good table, as I 
didn't know how to recreate the original.


\placetable[none,here]{}{

\starttabulate[|i1Slw(20mm)|i1Slp(20mm)|i1lp(7cm)|]

\DB espéranto \NC {\bf exemple} \NC {\bf équivalent en français}\NR\TB

\NC {\bs g} \NC {\bs g}azeto, {\bs g}itaro \NC toujours comme le g de 
gare (jamais comme le j) \NR\HL


\NC {\bs c} \NC la{\bs c}a \NC ts, comme dans tsé-tsé \NR\HL

\NC {\bs j} \NC {\bs j}es \NC comme le y de yoga ou le ia de piano ou 
le ill de pareil, œil, fouille \NR\HL


\NC {\bs s} \NC ta{\bs s}o \NC toujours ss comme dans tasse (jamais 
comme un z) \NR\HL


\NC {\bs h} \NC {\bs h}a lo \NC la combinaison ha se prononce comme 
quand on rit : ha !, ha !, ha ! Pareil pour ho : ho !,ho !,ho ! et hi 
: hi !,hi !, hi ! \NR\HL


\stoptabulate


Thanks for your answer,



You achieve better results with natural tables where each cell is a 
\framed block where you have options to add backgrounds colors, rounded 
corners and custom border colors.


Look at the attachment for a example.

Wolfgang

\setupbodyfont[dejavu,10pt,ss]

\starttext

\definecolor [tableheader] [x=00ADEF]

\startsetups[tablesettings]
\setupTABLE[start][framecolor=gray,loffset=.5ex,roffset=.5ex]
   
%\setupTABLE[header][background=color,backgroundcolor=tableheader,foregroundcolor=white]
   %\setupTABLE[header][1][corner=08]
   %\setupTABLE[header][3][corner=05]

\setupTABLE[row][first][background=color,backgroundcolor=tableheader,foregroundcolor=white]
\setupTABLE[first][first][corner=08]
\setupTABLE[last][first][corner=05]
\setupTABLE[first][last][corner=07]
\setupTABLE[last][last][corner=06]
\setupTABLE[column][last][style={\setcharacterspacing[frenchpunctuation]}]
\stopsetups

\bTABLE[setups=tablesettings]
%\bTABLEhead
\bTR
\bTH espéranto \eTH
\bTH exemple \eTH
\bTH équivalent en français \eTH
\eTR
%\eTABLEhead
%\bTABLEbody
\bTR
\bTD {\bs g} \eTD
\bTD {\bs g}azeto, {\bs g}itaro \eTD
\bTD toujours comme le g de gare (jamais comme le j) \eTD
\eTR
\bTR
\bTD {\bs c} \eTD
\bTD la{\bs c}a \eTD
\bTD ts, comme dans tsé-tsé \eTD
\eTR
\bTR
\bTD {\bs j} \eTD
\bTD {\bs j}es \eTD
\bTD comme le y de yoga ou le ia de piano ou le ill de pareil, œil, fouille 
\eTD
\eTR
\bTR
\bTD {\bs s} \eTD
\bTD ta{\bs s}o \eTD
\bTD toujours ss comme dans tasse (jamais comme un z) \eTD
\eTR
\bTR
\bTD {\bs h} \eTD
\bTD {\bs h}a lo \eTD
\bTD la combinaison ha se prononce comme quand on rit: ha!, ha!, ha! Pareil 
pour ho: ho!, ho!, ho! et hi: hi!, hi!, hi! \eTD
\eTR
%\eTABLEbody
\eTABLE

\stoptext
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] bTABLEhead not working

2020-11-24 Thread Bruce Horrocks
This worked for me a couple of versions ago but not under 2020.11.24 00:41. The 
headings are being printed as ordinary text at the top of the table rather than 
framed.

\starttext
\bTABLE[split=yes, header=repeat]
\bTABLEhead
  \bTR
\bTH A \eTH
\bTH B \eTH
  \eTR
\eTABLEhead
\bTABLEbody
  \bTR
\bTD 0 \eTD
\bTD zzz\eTD
  \eTR
\eTABLEbody
\eTABLE
\stoptext

--
Bruce Horrocks
Hampshire, UK

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Split Table, don't repeat caption

2020-10-08 Thread Denis Maier



Am 07.10.2020 um 18:00 schrieb Denis Maier:

Am 07.10.2020 um 17:46 schrieb Wolfgang Schuster:

Denis Maier schrieb am 07.10.2020 um 17:39:

Hi,

is there a way not to repeat the caption of a multipage natural 
table? I've searched the list archive and it looks the question came 
up a couple of times, but I couldn't find an answer.


If this doesn't help you have to provide a example.
[...]



Ok:

=
\setupcaption[table]
    [location=top]
\starttext

\startplacetable[location=split,title={Title\footnote{footnote}}]
    \bTABLE[split=yes]
    \bTABLEhead
    \bTR \bTD Header 1 \eTD \bTD Header 2 \eTD \eTR
    \eTABLEhead
    \bTABLEbody
    \dorecurse{100}{\bTR \bTD Column 1 \eTD \bTD Column 2 \eTD \eTR}
    \eTABLEbody
    \eTABLE
\stopplacetable
\stoptext


So, the caption appears on each page, and the footnote is attached to 
the last caption. Ideally, the footnote should be attached to the 
first caption. (And, actually, I want the caption only once.)


Ok, I've found a solution:

```
\setupcaption[table][location=top]
\starttext


\startplacetable[location={none,split}]
    \startalignment[middle]
    \placefloatcaption[table][title={Title\footnote{footnote}}]
    \stopalignment
    \bTABLE[split=yes]
    \bTABLEhead
    \bTR \bTD Header 1 \eTD \bTD Header 2 \eTD \eTR
    \eTABLEhead
    \bTABLEbody
    \dorecurse{100}{\bTR \bTD Column 1 \eTD \bTD Column 2 \eTD \eTR}
    \eTABLEbody
    \eTABLE
\stopplacetable
\stoptext
```

That works, but isn't there an easier solution yet? An 
automatic/parameter-based solution would be great. Something like:


=
\setupcaption[table]
    [location=top]
\starttext

\startplacetable[location={split,captiononcefirst},title={Title\footnote{footnote}}] 


   [...]
\stopplacetable
\stoptext



Best,
Denis

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Split Table, don't repeat caption

2020-10-07 Thread Denis Maier

Am 07.10.2020 um 17:46 schrieb Wolfgang Schuster:

Denis Maier schrieb am 07.10.2020 um 17:39:

Hi,

is there a way not to repeat the caption of a multipage natural 
table? I've searched the list archive and it looks the question came 
up a couple of times, but I couldn't find an answer.


If this doesn't help you have to provide a example.
[...]



Ok:

=
\setupcaption[table]
    [location=top]
\starttext

\startplacetable[location=split,title={Title\footnote{footnote}}]
    \bTABLE[split=yes]
    \bTABLEhead
    \bTR \bTD Header 1 \eTD \bTD Header 2 \eTD \eTR
    \eTABLEhead
    \bTABLEbody
    \dorecurse{100}{\bTR \bTD Column 1 \eTD \bTD Column 2 \eTD \eTR}
    \eTABLEbody
    \eTABLE
\stopplacetable
\stoptext


So, the caption appears on each page, and the footnote is attached to 
the last caption. Ideally, the footnote should be attached to the first 
caption. (And, actually, I want the caption only once.)


Best,
Denis
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Split Table, don't repeat caption

2020-10-07 Thread Wolfgang Schuster

Denis Maier schrieb am 07.10.2020 um 17:39:

Hi,

is there a way not to repeat the caption of a multipage natural table? 
I've searched the list archive and it looks the question came up a 
couple of times, but I couldn't find an answer.


If this doesn't help you have to provide a example.

\starttext

\bTABLE[split=yes]
    \bTABLEhead
    \bTR \bTD Header 1 \eTD \bTD Header 2 \eTD \eTR
    \eTABLEhead
    \bTABLEbody
    \dorecurse{100}{\bTR \bTD Column 1 \eTD \bTD Column 2 \eTD \eTR}
    \eTABLEbody
\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] pdf tagging for accesbility

2020-07-12 Thread Duncan Hothersall
I have no answer I'm afraid, but I would like to register a similar
interest in any potential answer to the question.

Duncan

On Sun, 12 Jul 2020, 14:20 David Eric Cox, 
wrote:

> Hello.
>
> Is there any way to pdf-tag table headers to assist screen readers and the
> like?  I can get tagging in general and thought that natural tables would
> work because of \bTABLEhead ... \eTABLEhead would do the job, but it
> doesn't.
>
> I'd appreciate any feedback.
>
> David
>
>
> Sent with ProtonMail <https://protonmail.com> Secure Email.
>
>
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] pdf tagging for accesbility

2020-07-12 Thread David Eric Cox
Hello.

Is there any way to pdf-tag table headers to assist screen readers and the 
like? I can get tagging in general and thought that natural tables would work 
because of \bTABLEhead ... \eTABLEhead would do the job, but it doesn't.

I'd appreciate any feedback.

David

Sent with [ProtonMail](https://protonmail.com) Secure Email.___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Normal tables error: Dimension too large. Context version: 2019.04.29 08:52

2019-05-10 Thread Hans Hagen

On 5/10/2019 8:22 PM, Felipe de Jesús Molina Bravo wrote:

Hi!

I have a table with 39 columns (the file is attached). With the context 
version:

     ConTeXt Process Management 1.01
     current version: 2017.05.15 21:48

I don't have any problem; but with the newer version:
     ConTeXt Process Management 1.02
     current version: 2019.04.29 08:52

show the next error:

tex error   > tex error on line 114 in file 
/home/fmolina/tempo/latex/context/pbas/ts.tex: ! Dimension too large


\tabl_ntb_table_get_max_width ...<\wd \scratchbox
   \relax \scratchdimen 
\wd \...

\tabl_ntb_table_stop ...l_ntb_table_get_max_width
   \ifautoTBLspread 
\tabl_ntb...

\eTABLE ...oveunwantedspaces \tabl_ntb_table_stop
   \stopTBLprocessing 
\fi \po...

l.114 \eTABLE


My table is:

\setupTABLE[header][each][background=color,backgroundcolor=white, 
width=broad]

\bTABLE[split=repeat,option={stretch},  align={flushright}, frame=off]
   \bTABLEhead[align=flushright]
     \bTR
    \bTH [offset=none, align={flushleft}, nc=39]
     .
    \eTH
    ...
       \bTR[strut=no]
        \bTD[align={flushleft,lohi}, nr=1]
   {
     \bTABLE[option={stretch},offset=0pt, frame=off]
  ...
      \eTABLE % fin de tabla interna en columna matriz
   }
    \eTD
    \bTD[ width=broad, nr=1 ] banco 1\eTD
    \bTD[ width=broad, nr=1 ] banco 1\eTD
        ... % to complet 39 columns

When i remove "width=broad" from  the "\bTD...banco 1\eTD" i can 
generate my pdf with it new version


How wan resolve this problem? please guide me!!
broad effectively uses hsize so 39 times the hsize is larger than tex 
likes dealing with ... can't you use fit instead?


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Normal tables error: Dimension too large. Context version: 2019.04.29 08:52

2019-05-10 Thread Felipe de Jesús Molina Bravo
Hi!

I have a table with 39 columns (the file is attached). With the context
version:
ConTeXt Process Management 1.01
current version: 2017.05.15 21:48

I don't have any problem; but with the newer version:
ConTeXt Process Management 1.02
current version: 2019.04.29 08:52

show the next error:

tex error   > tex error on line 114 in file
/home/fmolina/tempo/latex/context/pbas/ts.tex: ! Dimension too large

\tabl_ntb_table_get_max_width ...<\wd \scratchbox
  \relax \scratchdimen \wd
\...
\tabl_ntb_table_stop ...l_ntb_table_get_max_width
  \ifautoTBLspread
\tabl_ntb...
\eTABLE ...oveunwantedspaces \tabl_ntb_table_stop
  \stopTBLprocessing \fi
\po...
l.114 \eTABLE


My table is:

\setupTABLE[header][each][background=color,backgroundcolor=white,
width=broad]
\bTABLE[split=repeat,option={stretch},  align={flushright}, frame=off]
  \bTABLEhead[align=flushright]
\bTR
   \bTH [offset=none, align={flushleft}, nc=39]
.
   \eTH
   ...
  \bTR[strut=no]
   \bTD[align={flushleft,lohi}, nr=1]
  {
\bTABLE[option={stretch},offset=0pt, frame=off]
 ...
 \eTABLE % fin de tabla interna en columna matriz
  }
   \eTD
   \bTD[ width=broad, nr=1 ] banco 1\eTD
   \bTD[ width=broad, nr=1 ] banco 1\eTD
   ... % to complet 39 columns

When i remove "width=broad" from  the "\bTD...banco 1\eTD" i can generate
my pdf with it new version

How wan resolve this problem? please guide me!!

Thank's in advance!

See you
\starttext
% Hoja legal horizontal
\definepapersize[LH][legal,landscape][legal,landscape]
\setuppapersize[LH]
%
\setuplayout
  [backspace=0.8cm,
   topspace=1.6cm,
   bottomspace=0cm,
   leftmargin=0cm,
   rightmargin=0cm,
   bottomspace=0cm,
   header=0cm,
   footer=0.5cm,
%  paperwidth=34.7cm
%  width=33.9cm,
%  height=39.2cm
   ]

\usetypescript[heros]
\setupbodyfont[heros,8pt]
\testpage[15]
% Calculamos el tamaño de la columna matriz. \textwidth tiene el ancho de la
% linea en puntos (en la documentación indica que es el ancho del contexto en el
% que se encuentra). Dividimos entre el total de columnas menos las columnas que
% son llamadas y las que son separadoras de columna
\definemeasure[tam][1.5\dimexpr (\textwidth/39)\relax]

\setupTABLE[column][1][width=1.5\dimexpr (\textwidth/39)]
\setupTABLE[header][each][background=color,backgroundcolor=white, width=broad]
\setupTABLE[r][odd][background=color,backgroundcolor=gray]
\setupTABLE[r][even][background=color,backgroundcolor=white]

\bTABLE[split=repeat,option={stretch},  align={flushright}, frame=off]
  \bTABLEhead[align=flushright]
\bTR
   \bTH [offset=none, align={flushleft}, nc=39]
   {
 \bTABLE[option=tight, align={flushright}, frame=off]
   \bTR
 \bTD[ align={flushleft}, width=.8\textwidth ]
   Sucursales de la banca múltiple por demarcación territorial según institución
 \eTD
 \bTD[ align={flushright}, width=.2\textwidth ]
   Cuadro 23.1
 \eTD
   \eTR
 \eTABLE
   }
   \eTH
\eTR
\bTR[strut=no]
   \bTH[align={flushleft}, nc=39]
 Al 31 de diciembre de 2017   \eTH
\eTR

%  Linea horizontal de encabezados ***
\bTR[strut=no]
   \bTH[rulethickness=2pt,topframe=on, nc=39] \eTH
\eTR
\bTR[strut=no]
  \bTD[align={flushleft,lohi}, nr=1] 
  {
\bTABLE[option={stretch},offset=0pt, frame=off]
  \bTR
  \bTD[loffset= 0ex]
  Demarcación territorial
  \eTD
  \eTR
\eTABLE % fin de tabla interna en columna matriz
  }
   \eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
   \bTD[ width=broad, nr=1 ] banco 1\eTD  
%  \bTD[ width=broad, nr=1 ] banco 1\eTD  
%  \bTD[

Re: [NTG-context] Strange behaviour of TABLE with \currentTABLErow

2018-12-10 Thread Tomas Hala
Hi Wolfgang, 

thank you for your reply. 

The split=repeat -- my fault, sorry. But -- surprisingly -- this mistake
helped me along understanding the problem. I discovered -- if head
and next head are defined -- that the "line number 1" servers for the
opening head at the beginning of a table whereas "line number 2" 
is used for all "next heads" at all pages of the table. 

So the problem is reduced to substracting one or two for only heads
and head+next heads, respectively.

Best wishes,

Tomáš 

P. S.
One possible solution can be e.g.:

\newcount\myrow
\def\currentTABLEbodyrow{\def\takenumber##1{\myrow=##1\advance\myrow-2 
\the\myrow}\takenumber\currentTABLErow}



The number of rows is now determined by the number of all rows
# (including header and footer) and the counting starts also from the first
# row in the table independent of the type of the row.



Mon, Dec 03, 2018 ve 11:14:53PM +0100 Wolfgang Schuster napsal(a):
# Tomas Hala schrieb am 03.12.18 um 20:23:
# >Hi all,
# >
# >at https://wiki.contextgarden.net/Command/currentTABLEcolumn I learnt
# >about \currentTABLErow etc. for counting lines in natural tables.
# >
# >I have got the following two minimal non-working examples (on TeXlive 2018):
# >
# >\starttext\setupTABLE[split=yes]
# >   \bTABLE
# >   \bTABLEhead\bTR\bTH head  \eTH\eTR\eTABLEhead
# >   \bTABLEbody
# > \dorecurse{100}{\bTR\bTD \currentTABLErow xxx \eTD\eTR}
# >   \eTABLEbody
# >   \eTABLE
# >\stoptext
# >
# >In this case, the head-line is alse counted which makes no sense
# >and I do not know how to supress it.
# Even though this is not what you expect it makes sense because when ConTeXt
# creates the table the whole thing is only one huge part which the
# headers for
# the first and the following pages on top and the footer on the bottom.
# 
# The number of rows is now determined by the number of all rows
# (including header and footer) and the counting starts also from the first
# row in the table independent of the type of the row.
# 
# What you want is a counter which removes the header row from the value
# but to keep backwards compatibility this has to be a new command,
# e.g. \currentTABLEbodyrow
# >If I add \bTABLEnext (below), I receive very strange result -- both heads
# >are at the beginning of the table and both counted. Moreover, the "next"
# >head is not used on the following pages.
# >
# >\starttext\setupTABLE[split=yes]
# >   \bTABLE
# >   \bTABLEhead\bTR\bTH head  \eTH\eTR\eTABLEhead
# >   \bTABLEnext\bTR\bTH next head \eTH\eTR\eTABLEnext
# >   \bTABLEbody
# > \dorecurse{100}{\bTR\bTD \currentTABLErow xxx \eTD\eTR}
# >   \eTABLEbody
# >   \eTABLE
# >\stoptext
# >
# >I tried \TC and \TD instead of \TH, also without success.
# >What I am doing wrong?
# You need split=repeat.
# 
# The normal command to create a cell is \bTD, the \bTH command
# is usefull for the header because it changes the font style to bold
# and it also disables the character alignment for the current cell.
# 
# Wolfgang

 Tomáš Hála

Mendelova univerzita, Provozně ekonomická fakulta, ústav informatiky
Zemědělská 1, CZ-613 00 Brno,  tel. +420 545 13 22 28

http://akela.mendelu.cz/~thala
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Strange behaviour of TABLE with \currentTABLErow

2018-12-03 Thread Wolfgang Schuster

Tomas Hala schrieb am 03.12.18 um 20:23:

Hi all,

at https://wiki.contextgarden.net/Command/currentTABLEcolumn I learnt
about \currentTABLErow etc. for counting lines in natural tables.

I have got the following two minimal non-working examples (on TeXlive 2018):

\starttext\setupTABLE[split=yes]
   \bTABLE
   \bTABLEhead\bTR\bTH head  \eTH\eTR\eTABLEhead
   \bTABLEbody
 \dorecurse{100}{\bTR\bTD \currentTABLErow xxx \eTD\eTR}
   \eTABLEbody
   \eTABLE
\stoptext

In this case, the head-line is alse counted which makes no sense
and I do not know how to supress it.

Even though this is not what you expect it makes sense because when ConTeXt
creates the table the whole thing is only one huge part which the 
headers for

the first and the following pages on top and the footer on the bottom.

The number of rows is now determined by the number of all rows
(including header and footer) and the counting starts also from the first
row in the table independent of the type of the row.

What you want is a counter which removes the header row from the value
but to keep backwards compatibility this has to be a new command,
e.g. \currentTABLEbodyrow

If I add \bTABLEnext (below), I receive very strange result -- both heads
are at the beginning of the table and both counted. Moreover, the "next"
head is not used on the following pages.

\starttext\setupTABLE[split=yes]
   \bTABLE
   \bTABLEhead\bTR\bTH head  \eTH\eTR\eTABLEhead
   \bTABLEnext\bTR\bTH next head \eTH\eTR\eTABLEnext
   \bTABLEbody
 \dorecurse{100}{\bTR\bTD \currentTABLErow xxx \eTD\eTR}
   \eTABLEbody
   \eTABLE
\stoptext

I tried \TC and \TD instead of \TH, also without success.
What I am doing wrong?

You need split=repeat.

The normal command to create a cell is \bTD, the \bTH command
is usefull for the header because it changes the font style to bold
and it also disables the character alignment for the current cell.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Strange behaviour of TABLE with \currentTABLErow

2018-12-03 Thread Tomas Hala
Hi all,

at https://wiki.contextgarden.net/Command/currentTABLEcolumn I learnt
about \currentTABLErow etc. for counting lines in natural tables.

I have got the following two minimal non-working examples (on TeXlive 2018):

\starttext\setupTABLE[split=yes]
  \bTABLE
  \bTABLEhead\bTR\bTH head  \eTH\eTR\eTABLEhead
  \bTABLEbody
\dorecurse{100}{\bTR\bTD \currentTABLErow xxx \eTD\eTR}
  \eTABLEbody
  \eTABLE
\stoptext

In this case, the head-line is alse counted which makes no sense
and I do not know how to supress it.

If I add \bTABLEnext (below), I receive very strange result -- both heads
are at the beginning of the table and both counted. Moreover, the "next"
head is not used on the following pages.

\starttext\setupTABLE[split=yes]
  \bTABLE
  \bTABLEhead\bTR\bTH head  \eTH\eTR\eTABLEhead
  \bTABLEnext\bTR\bTH next head \eTH\eTR\eTABLEnext
  \bTABLEbody
\dorecurse{100}{\bTR\bTD \currentTABLErow xxx \eTD\eTR}
  \eTABLEbody
  \eTABLE
\stoptext

I tried \TC and \TD instead of \TH, also without success. 
What I am doing wrong?  
Thanks in advance for help.

Best wishes,

Tomáš

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Issue with ligatures before dashes

2018-10-30 Thread Wolfgang Schuster

\setuppapersize[A7]

\starttext

fi fl ffi ffl

fi-fi fl-fl ffi-ffi ffl-ffl

\setbreakpoints[compound]

fi-fi fl-fl ffi-ffi ffl-ffl

\stoptext

Wolfgang


Rik Kabel schrieb am 30.10.18 um 17:32:


This was reported on the LuaLatex list yesterday, and I extended the 
example to include ConTeXt compounds. From my test folder:


%% No ligatures before dashes! Reported as: “ligatures before
%%   dashes not working with LuaLaTeX 1.07.0” on comp.tex.luatex,
%%   2018-10-29 by Toni Dietze. This is also a problem with ConTeXt,
%%   and is a problem with compounds as well. The problem is worse
%%   with 1.09.0: With 1.07.0 (6686) it fails with the bare hyphen
%%   but had no problem with en-dash, em-dash, and the compounds
%%   shown below. With luatex 1.09.0 (6930) it fails with bare
%%   hyphen and all shown compounds except |=|.

\starttext
   \setupTABLE[c][1,3][align=left]
   \setupTABLE[c][2,4][loffset=1em,roffset=1em]
   \setupTABLE[r][each][offset=0pt]
   \bTABLE[frame=off]
\bTABLEhead
 \bTR[align=center,bottomframe=on]
   \bTH[nc=2] Non-compound\eTH
   \bTH[nc=2] Compound\eTH
 \eTR
\eTABLEhead
\bTABLEbody
 \bTR
   \bTD - \eTD \bTD off-course\eTD
   \bTD \|-\| \eTD \bTD off|-|course\eTD
 \eTR
 \bTR
   \bTD – \eTD \bTD off–course\eTD
   \bTD \|–\| \eTD \bTD off|–|course\eTD
 \eTR
 \bTR
   \bTD — \eTD \bTD off—course\eTD
   \bTD \|—\| \eTD \bTD off|—|course\eTD
 \eTR
 \bTR
   \bTD   \eTD \bTD  \eTD
   \bTD \|_\| \eTD \bTD off|_|course\eTD
 \eTR
 \bTR
   \bTD   \eTD \bTD  \eTD
   \bTD \|=\| \eTD \bTD off|=|course\eTD
 \eTR
\eTABLEbody
   \eTABLE
\stoptext

In one 300-page book, this hits a few times (off-course, 
oft-repeated,...). Not the worst problem, but clearly a regression.


--
Rik


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Issue with ligatures before dashes

2018-10-30 Thread Rik Kabel
This was reported on the LuaLatex list yesterday, and I extended the 
example to include ConTeXt compounds. From my test folder:


   %% No ligatures before dashes! Reported as: “ligatures before
   %%   dashes not working with LuaLaTeX 1.07.0” on comp.tex.luatex,
   %%   2018-10-29 by Toni Dietze. This is also a problem with ConTeXt,
   %%   and is a problem with compounds as well. The problem is worse
   %%   with 1.09.0: With 1.07.0 (6686) it fails with the bare hyphen
   %%   but had no problem with en-dash, em-dash, and the compounds
   %%   shown below. With luatex 1.09.0 (6930) it fails with bare
   %%   hyphen and all shown compounds except |=|.

   \starttext
  \setupTABLE[c][1,3][align=left]
  \setupTABLE[c][2,4][loffset=1em,roffset=1em]
  \setupTABLE[r][each][offset=0pt]
  \bTABLE[frame=off]
   \bTABLEhead
\bTR[align=center,bottomframe=on]
  \bTH[nc=2] Non-compound\eTH
  \bTH[nc=2] Compound\eTH
\eTR
   \eTABLEhead
   \bTABLEbody
\bTR
  \bTD - \eTD \bTD off-course\eTD
  \bTD \|-\| \eTD \bTD off|-|course\eTD
\eTR
\bTR
  \bTD – \eTD \bTD off–course\eTD
  \bTD \|–\| \eTD \bTD off|–|course\eTD
\eTR
\bTR
  \bTD — \eTD \bTD off—course\eTD
  \bTD \|—\| \eTD \bTD off|—|course\eTD
\eTR
\bTR
  \bTD   \eTD \bTD  \eTD
  \bTD \|_\| \eTD \bTD off|_|course\eTD
\eTR
\bTR
  \bTD   \eTD \bTD  \eTD
  \bTD \|=\| \eTD \bTD off|=|course\eTD
\eTR
   \eTABLEbody
  \eTABLE
   \stoptext

In one 300-page book, this hits a few times (off-course, 
oft-repeated,...). Not the worst problem, but clearly a regression.


--
Rik
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] align is reversed inside a table

2018-09-29 Thread David Walther

Using this table as an example, when I do align=left, the column aligns right,
and when I do align=right, it aligns left.  align=center works as expected.  Am
I doing something wrong or is this a bug?

I am using the version of context distributed with Debian unstable:

mtx-context | ConTeXt Process Management 1.01
mtx-context |
mtx-context | main context file: 
/usr/share/texmf/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2017.05.15 21:48

Minimal example here:

\setuppagenumbering[alternative=doublesided,location=none,page=no]
\setupfootertexts[\sans{Source: http://mywebsite}]
\setupheadertexts[test column text wrapping]
\setupheadertexts
 [] [Page \userpagenumber\ of \lastuserpagenumber]
 [Page \userpagenumber\ of \lastuserpagenumber] []
\setuppapersize[letter, portrait]
\setuplayout[topspace=0.5in, backspace=1in, height=10in, width=7in,
header=0.5in, footer=0.5in, headerdistance=0in, footerdistance=0in]
\switchtobodyfont[12pt]
\starttext
\setupTABLE[split=repeat]
\setupTABLE[r][each][toffset=3pt, boffset=3pt, loffset=3pt, roffset=3pt]
\setupTABLE[c][each][leftframe=off,rightframe=off,align=right]
\setupTABLE[c][first][frame=off,align=left]
\setupTABLE[c][2][style=\tfx\it,align=left]
\bTABLE
\bTABLEhead
\bTR\bTH Col1 \eTH\bTH Col2 \eTH\bTH Col3 \eTH\eTR
\eTABLEhead
\bTABLEnext
\bTR\bTH Col1 \eTH\bTH Col2 \eTH\bTH Col3 \eTH\eTR
\eTABLEnext
\bTABLEbody
\bTR\bTC \eTC\bTC NightShift \eTC\bTC Tension Lines 146 - 150 \eTC\eTR
\bTR\bTC 30. \eTC \bTC[nc=2,align=center,style=] \bf{Foo Bar} \eTC\eTR
%\bTR\bTC 30. \eTC \bTC\eTC \bTC[align=center] \bf{Foo Bar} \eTC\eTR
\eTABLEbody
\eTABLE
\stoptext
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] table making ugly column sizes, how to fix?

2018-09-29 Thread David Walther

Full example at the bottom.

I'm making a table.  So far so good.

Every so often I want to make something like a section header.

Regular table rows are like this:

\bTR\bTC \eTC\bTC NightShift \eTC\bTC Tension Lines 146 - 150 \eTC\eTR

For the section headers, I do this, and they look the way I want:

\bTR\bTC 30. \eTC \bTC[nc=2,align=center,style=] \bf{Foo Bar} \eTC\eTR

But then the regular lines have ugly line breaks and suddenly the column size 
of column 3 is squeezed.  This shouldn't be, we have the whole page to work 
with.

So, when I do my section headers this way, the columns come out sized nicely, 
but the section header isn't styled the way I want it:

\bTR\bTC 30. \eTC \bTC\eTC \bTC[align=center] \bf{Foo Bar} \eTC\eTR

Below is my minimal example you can cut and paste.  How do I do the section
headers without messing up the column sizing?


\setuppagenumbering[alternative=doublesided,location=none,page=no]
\setupfootertexts[\sans{Source: http://mywebsite}]
\setupheadertexts[test column text wrapping]
\setupheadertexts
 [] [Page \userpagenumber\ of \lastuserpagenumber]
 [Page \userpagenumber\ of \lastuserpagenumber] []
\setuppapersize[letter, portrait]
\setuplayout[topspace=0.5in, backspace=1in, height=10in, width=7in,
header=0.5in, footer=0.5in, headerdistance=0in, footerdistance=0in]
\switchtobodyfont[12pt]
\starttext
\setupTABLE[split=repeat]
\setupTABLE[r][each][toffset=3pt, boffset=3pt, loffset=3pt, roffset=3pt]
\setupTABLE[c][each][leftframe=off,rightframe=off,align=right]
\setupTABLE[c][first][frame=off,align=left]
\setupTABLE[c][2][style=\tfx\it,align=left]
\bTABLE
\bTABLEhead
\bTR\bTH Col1 \eTH\bTH Col2 \eTH\bTH Col3 \eTH\eTR
\eTABLEhead
\bTABLEnext
\bTR\bTH Col1 \eTH\bTH Col2 \eTH\bTH Col3 \eTH\eTR
\eTABLEnext
\bTABLEbody
\bTR\bTC \eTC\bTC NightShift \eTC\bTC Tension Lines 146 - 150 \eTC\eTR

% This displays the way I want, but breaks the regular rows.
\bTR\bTC 30. \eTC \bTC[nc=2,align=center,style=] \bf{Foo Bar} \eTC\eTR

% This works with the regular rows, but doesn't look how I want.
%\bTR\bTC 30. \eTC \bTC\eTC \bTC[align=center] \bf{Foo Bar} \eTC\eTR
\eTABLEbody
\eTABLE
\stoptext
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] TABLE: centering splitted TABLE

2018-06-21 Thread Wolfgang Schuster

Remove the alignment environment, floats are centered by default.

Wolfgang

Procházka Lukáš Ing. <mailto:l...@pontex.cz>
9. Juni 2018 um 20:33
Hello,

I have two questions about TABLEs. Suppose having the following code:


\setuplayout[page]

 



\starttext
  \startalignment[middle]
\dontleavehmode
\bTABLE[before=,after=,inbetween=]
  \bTABLEbody
\dorecurse{10}{
  \bTR
\bTD aaa\eTD
\bTD bbb\eTD
  \eTR
}
  \eTABLEbody
\eTABLE
\crlf
\bTABLE[before=,after=,inbetween=]
  \bTABLEbody
\bTR
  \bTD AAA\eTD
  \bTD BBB\eTD
\eTR
  \eTABLEbody
\eTABLE
  \stopalignment
  %
  \page
  \startalignment[middle]
\dontleavehmode
\bTABLE[split=yes]
  \bTABLEbody
\dorecurse{60}{
  \bTR
\bTD uuu\eTD
\bTD vvv\eTD
  \eTR
}
  \eTABLEbody
\eTABLE
  \stopalignment
\stoptext


- How to make the "uuu - vvv" table - which goes into several pages - 
centered on each page, like "aaa - bbb" (non splitting) table is?


- How to suppress the vertical space between the last row of "aaa - 
bbb" table and the first row of the "AAA - BBB" table?


(I'm trying to typeset some picture playing cards, so usual 
typographic rules don't apply here...)


Any help would be appreciated.

Best regards,

Lukas


___
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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___
Procházka Lukáš Ing. <mailto:l...@pontex.cz>
20. Juni 2018 um 07:43
Hello,

On Sat, 09 Jun 2018 20:33:30 +0200, Procházka Lukáš Ing. 
 wrote:



any reaction?

E.g.
"splitted TABLE cannot be centered on pages - the alg is not 
implemented, and won't be" or
"splitted TABLE cannot be centered on pages - the alg is not 
implemented, but will be" or
"splitted TABLE cannot be centered on pages - use xtable instead with 
[key=value]" or
"use \setupTABLE[something=here] - it will center splitted TABLE on 
each page"?


Best regards,

Lukas


Wolfgang Schuster <mailto:schuster.wolfg...@gmail.com>
20. Juni 2018 um 07:59


Place the table as float and disable the caption, e.g.

\startplacetable[location={split,force,none}]
...
\stopplacetable

Wolfgang
Procházka Lukáš Ing. <mailto:l...@pontex.cz>
21. Juni 2018 um 11:10
Hello,

thanks, it works:


  \startalignment[middle]
\startplacetable[location={split,force,none}]
  \bTABLE[split=repeat]
\bTABLEhead
  \bTR\bTH A\eTH\bTH B\eTH\eTR
\eTABLEhead
\bTABLEbody
  \dorecurse{60}{
\bTR
  \bTD uuu\eTD
  \bTD vvv\eTD
\eTR
  }
\eTABLEbody
  \eTABLE
\stopplacetable
  \stopalignment


Best regards,

Lukas


On Wed, 20 Jun 2018 07:59:28 +0200, Wolfgang Schuster 
 wrote:






___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] TABLE: centering splitted TABLE

2018-06-21 Thread Procházka Lukáš Ing .

Hello,

thanks, it works:


  \startalignment[middle]
\startplacetable[location={split,force,none}]
  \bTABLE[split=repeat]
\bTABLEhead
  \bTR\bTH A\eTH\bTH B\eTH\eTR
\eTABLEhead
\bTABLEbody
  \dorecurse{60}{
\bTR
  \bTD uuu\eTD
  \bTD vvv\eTD
\eTR
  }
\eTABLEbody
  \eTABLE
\stopplacetable
  \stopalignment


Best regards,

Lukas


On Wed, 20 Jun 2018 07:59:28 +0200, Wolfgang Schuster 
 wrote:




Procházka Lukáš Ing. <mailto:l...@pontex.cz>
20. Juni 2018 um 07:43
Hello,

On Sat, 09 Jun 2018 20:33:30 +0200, Procházka Lukáš Ing.
 wrote:


any reaction?

E.g.
"splitted TABLE cannot be centered on pages - the alg is not
implemented, and won't be" or
"splitted TABLE cannot be centered on pages - the alg is not
implemented, but will be" or
"splitted TABLE cannot be centered on pages - use xtable instead with
[key=value]" or
"use \setupTABLE[something=here] - it will center splitted TABLE on
each page"?


Place the table as float and disable the caption, e.g.

\startplacetable[location={split,force,none}]
...
\stopplacetable

Wolfgang




--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz | 
IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Expansion help needed, getvariable and TABLE

2018-01-31 Thread Rik Kabel

On 2018-01-31 01:04, Wolfgang Schuster wrote:



Rik Kabel <mailto:cont...@rik.users.panix.com>
31. Januar 2018 um 03:10

Listers,

I have a problem, and a question on ConTeXt programming efficiency.

In the example below, I have a set of variables. When these are 
reference directly via \getvariable, everything works as expected in 
simple text and in TABLEs. When I \define a macro to the 
\getvariable, that works in simple text, but only the value of the 
last iteration appears in the TABLE. The macro definition is saved 
and when it is used, that is the value that it has.


So, how can I \define (or \def, ...) a macro to the expanded value to 
avoid this? That is the problem.


The question is, Is there is any advantage to be had in doing this? 
Assume that the value is referenced many (tens of) times. There seems 
to be an aesthetic value of factoring out the multiple identical 
instances of the \getvariable syntax and assigning a more 
semantically informative name, but beyond that, is there any other value?



Natural tables collect the content of all cells to perform the width 
and height calculations
and you have to expand the content of the cells to get the current 
value of \getvariable.


\starttexdefinition unexpanded doTableRow #SET
    \bTR
  \expanded{\bTC\getvariable{#SET}{a}\eTC}
  \expanded{\bTC\getvariable{#SET}{b}\eTC}
    \eTR
\stoptexdefinition


BTW: You can use the \processcommacommand command when you save your 
lists in a macro (no need for \expandafter).


\defineexpandable\Sets{one,two}

\processcommacommand[\Sets]\doInlineTextExp


Wolfgang


Thank you for the help and the processcommacommand bit. However, the 
problem is still there (and I was just wrong in my own follow-up).


Below is an updated example with and without the \expanded{\bTC...

It does not seem to make a difference here, but perhaps it is needed in 
some situations.


My question is about factoring the \getvariable out of the \bTC rows (in 
this example) and \defining a simpler macro to hold the value. Should it 
be done, and if so, how?


   % macros=mkvi engine=luajittex

   \setvariables  [one]
   [a=1,b=1b,c=1c]
   \setvariables  [two]
   [a=2a,b=2,c=2c]

   \defineexpandable  \Sets
   {one,two}

   \starttexdefinition unexpanded doInlineText #SET
    Direct: \getvariable{#SET}{a} \getvariable{#SET}{b}\
    \getvariable{#SET}{c}\par
   \stoptexdefinition

   \starttexdefinition unexpanded doTableRow #SET
    \bTR
  \bTC\getvariable{#SET}{a}\eTC
  \bTC\getvariable{#SET}{b}\eTC
  \bTC\getvariable{#SET}{c}\eTC
    \eTR
   \stoptexdefinition

   \starttexdefinition doInlineTextExpA #SET
    \define\A{\getvariable{#SET}{a}}
    \define\B{\getvariable{#SET}{b}}
    \define\C{\getvariable{#SET}{c}}
    Factored A: \A\ \B\ \C\par
   \stoptexdefinition

   \starttexdefinition doTableRowExpA #SET
    \define\A{\getvariable{#SET}{a}}
    \define\B{\getvariable{#SET}{b}}
    \define\C{\getvariable{#SET}{c}}
    \bTR
  \bTC\A\eTC
  \bTC\B\eTC
  \bTC\C\eTC
    \eTR
   \stoptexdefinition

   \starttexdefinition doInlineTextExpB #SET
    \define\A{\getvariable{#SET}{a}}
    \define\B{\getvariable{#SET}{b}}
    \define\C{\getvariable{#SET}{c}}
    Factored B: \A\ \B\ \C\par
   \stoptexdefinition

   \starttexdefinition doTableRowExpB #SET
    \define\A{\getvariable{#SET}{a}}
    \define\B{\getvariable{#SET}{b}}
    \define\C{\getvariable{#SET}{c}}
    \bTR
  \expanded{\bTC\A\eTC}
  \expanded{\bTC\B\eTC}
  \expanded{\bTC\C\eTC}
    \eTR
   \stoptexdefinition

   \starttext

    \processcommacommand[\Sets]\doInlineText

    \bTABLE[frame=off]
  \bTABLEhead
    \bTR[nc=2]
  \bTH Direct\eTH
    \eTR
  \eTABLEhead
  \bTABLEbody
  \processcommacommand[\Sets]\doTableRow
  \eTABLEbody
    \eTABLE

    \processcommacommand[\Sets]\doInlineTextExpA

    \bTABLE[frame=off]
  \bTABLEhead
    \bTR[nc=2]
  \bTH Factored A\eTH
    \eTR
  \eTABLEhead
  \bTABLEbody
    \processcommacommand[\Sets]\doTableRowExpA
  \eTABLEbody
    \eTABLE

    \processcommacommand[\Sets]\doInlineTextExpB

    \bTABLE[frame=off]
  \bTABLEhead
    \bTR[nc=2]
  \bTH Factored B\eTH
    \eTR
  \eTABLEhead
  \bTABLEbody
    \processcommacommand[\Sets]\doTableRowExpB
  \eTABLEbody
    \eTABLE

   \stoptext



--
RIk

___
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-c

[NTG-context] Expansion help needed, getvariable and TABLE

2018-01-30 Thread Rik Kabel

Listers,

I have a problem, and a question on ConTeXt programming efficiency.

In the example below, I have a set of variables. When these are 
reference directly via \getvariable, everything works as expected in 
simple text and in TABLEs. When I \define a macro to the \getvariable, 
that works in simple text, but only the value of the last iteration 
appears in the TABLE. The macro definition is saved and when it is used, 
that is the value that it has.


So, how can I \define (or \def, ...) a macro to the expanded value to 
avoid this? That is the problem.


The question is, Is there is any advantage to be had in doing this? 
Assume that the value is referenced many (tens of) times. There seems to 
be an aesthetic value of factoring out the multiple identical instances 
of the \getvariable syntax and assigning a more semantically informative 
name, but beyond that, is there any other value?


   % macros=mkvi engine=luajittex

   \setvariables  [one]
   [a=1a,b=1b]
   \setvariables  [two]
   [a=2a,b=2b]

   \define    \Sets
   {one,two}

   \starttexdefinition unexpanded doInlineText #SET
    Direct: \getvariable{#SET}{a} \getvariable{#SET}{b}\par
   \stoptexdefinition

   \starttexdefinition unexpanded doTableRow #SET
    \bTR
  \bTC\getvariable{#SET}{a}\eTC
  \bTC\getvariable{#SET}{b}\eTC
    \eTR
   \stoptexdefinition

   \starttexdefinition doInlineTextExp #SET
    \define\A{\getvariable{#SET}{a}}
    \define\B{\getvariable{#SET}{b}}
    Factored: \A\ \B\par
   \stoptexdefinition

   \starttexdefinition doTableRowExp #SET
    \define\A{\getvariable{#SET}{a}}
    \define\B{\getvariable{#SET}{b}}
    \bTR
  \bTC\A\eTC
  \bTC\B\eTC
    \eTR
   \stoptexdefinition

   \starttext

   \starttext

   \expandafter\processcommalist\expandafter[\Sets]\doInlineText

    \bTABLE[frame=off]
  \bTABLEhead
    \bTR[nc=2]
  \bTH Direct\eTH
    \eTR
  \eTABLEhead
  \bTABLEbody
   \expandafter\processcommalist\expandafter[\Sets]\doTableRow
  \eTABLEbody
    \eTABLE

   \expandafter\processcommalist\expandafter[\Sets]\doInlineTextExp

    \bTABLE[frame=off]
  \bTABLEhead
    \bTR[nc=2]
  \bTH Factored\eTH
    \eTR
  \eTABLEhead
  \bTABLEbody
   \expandafter\processcommalist\expandafter[\Sets]\doTableRowExp
  \eTABLEbody
    \eTABLE

   \stoptext

--
Rik

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Long and slender floating tables

2017-04-23 Thread Javier M Mora

Hi, I have several long and slenders tables like this:



---8<---

\starttext

Some Text at start.

% Point bA

\placetable[split]{My long table}{

% Point bB

\bTABLE[split=repeat]
\bTABLEhead
\bTR\bTD one \eTD\bTD two \eTD\bTD three \eTD\eTR
\eTABLEhead
\bTABLEbody
\dorecurse{100}{\bTR\bTD 1 \eTD\bTD 2 \eTD\bTD 3 \eTD\eTR}
\eTABLEbody
\eTABLE

% Point eB

}

% Point eA

Some Text at the end.

\stoptext

---8<---



Typesetting this tables are quite ugly because the wide white space each 
side.


I think the ideal solution is to place columns inside the floating but 
context garden wiki says float and columns doesn't work very well. I've 
tried put in Points "bA" and "eA" and in "bB" and "eB" the commands


\startcolumn - \stopcolumn
\startsinglecolumn - \stopsinglecolumn

but unsuccesful.

I am thinking to cut manually the table but there are enough amount of 
table to don't like the idea.


In the worst case, I'll force tables to start a page and cut them manually.

Questions:

* Is there a easy automatically system to cut tables in columns? How?

* Do you think/know a better way to show/expose data with this shape 
(long rows and few columns)?



Thanks.
Javier M. Mora



___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Orphans and widows in Natural Tables

2016-06-09 Thread Wolfgang Schuster

Pavneet Arora <mailto:pavneet_ar...@waroc.com>
9. Juni 2016 um 22:21
Related to my previous enquiry, I have the same issue with another part
of the report card that uses Natural Tables.

I'd like to keep two rows together as a unit, and not have the table
split between them. Is that possible, and how?

advTHANKSance



\definefontfamily[mainface][rm][Latin Modern Roman]
\definefontfamily[mainface][ss][Latin Modern Sans]
\definefontfamily[mainface][tt][Latin Modern Typewriter]
\definefontfamily[mainface][mm][Latin Modern Math]
%\definefontfamily[mainface][rm][Andada][sc=file:AndadaSC-Regular.otf]
%\definefontfamily[mainface][ss][Fira Sans]
%\definefontfamily[mainface][tt][Inconsolata]
%\definefontfamily[mainface][mm][Latin Modern Math]

\setupbodyfont[mainface,9pt]

\starttext
\setupTABLE[frame=off, split=repeat]
\setupTABLE[r][last][bottomframe=on]
\setupTABLE[c][1][width=3.0in]
\setupTABLE[c][2][width=0.5in, align=flushright]
\setupTABLE[c][3][width=0.5in, align=flushright]
\setupTABLE[c][4][width=2.5in]
\bTABLE
\bTABLEhead
\bTR[topframe=on, bottomframe=on]
\bTH {\bf Unit Description} \eTH
\bTH {\bf Weight} \eTH
\bTH {\bf Mark} \eTH
\bTH \eTH
\eTR
\eTABLEhead
\bTABLEbody
\dorecurse{10}{
%% Need to keep Unit description row and comment row together.
\bTR[topframe=on]
\bTD {\sc Unit } \eTD
\bTD 10 \eTD
\bTD 99 \eTD
\bTD \eTD
\eTR
\bTR

\bTR[samepage=before]

\bTD[nc=4] \input lorem.tex \eTD
\eTR
}
\eTABLEbody
\eTABLE
\stoptext

<<<< MWE

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
___

Re: [NTG-context] Orphans and widows in Natural Tables

2016-06-09 Thread Aditya Mahajan

On Thu, 9 Jun 2016, Pavneet Arora wrote:

Related to my previous enquiry, I have the same issue with another part 
of the report card that uses Natural Tables.


I'd like to keep two rows together as a unit, and not have the table 
split between them.  Is that possible, and how?


advTHANKSance



MWE


\definefontfamily[mainface][rm][Latin Modern Roman]
\definefontfamily[mainface][ss][Latin Modern Sans]
\definefontfamily[mainface][tt][Latin Modern Typewriter]
\definefontfamily[mainface][mm][Latin Modern Math]
%\definefontfamily[mainface][rm][Andada][sc=file:AndadaSC-Regular.otf]
%\definefontfamily[mainface][ss][Fira Sans]
%\definefontfamily[mainface][tt][Inconsolata]
%\definefontfamily[mainface][mm][Latin Modern Math]

\setupbodyfont[mainface,9pt]

\starttext
   \setupTABLE[frame=off, split=repeat]
   \setupTABLE[r][last][bottomframe=on]
   \setupTABLE[c][1][width=3.0in]
   \setupTABLE[c][2][width=0.5in, align=flushright]
   \setupTABLE[c][3][width=0.5in, align=flushright]
   \setupTABLE[c][4][width=2.5in]
   \bTABLE
   \bTABLEhead
   \bTR[topframe=on, bottomframe=on]
   \bTH {\bf Unit Description} \eTH
   \bTH {\bf Weight} \eTH
   \bTH {\bf Mark} \eTH
   \bTH \eTH
   \eTR
   \eTABLEhead
   \bTABLEbody
   \dorecurse{10}{
   %% Need to keep Unit description row and comment row together.
   \bTR[topframe=on]
   \bTD {\sc Unit } \eTD
   \bTD 10 \eTD
   \bTD 99 \eTD
   \bTD \eTD
   \eTR


(Untested): Add

\noindent{\blank[samepage]}


   \bTR
   \bTD[nc=4] \input lorem.tex \eTD
   \eTR
   }
   \eTABLEbody
   \eTABLE
\stoptext


Aditya
___
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
___

[NTG-context] Orphans and widows in Natural Tables

2016-06-09 Thread Pavneet Arora
Related to my previous enquiry, I have the same issue with another part 
of the report card that uses Natural Tables.

I'd like to keep two rows together as a unit, and not have the table 
split between them.  Is that possible, and how?

advTHANKSance


>>>> MWE

\definefontfamily[mainface][rm][Latin Modern Roman]
\definefontfamily[mainface][ss][Latin Modern Sans]
\definefontfamily[mainface][tt][Latin Modern Typewriter]
\definefontfamily[mainface][mm][Latin Modern Math]
%\definefontfamily[mainface][rm][Andada][sc=file:AndadaSC-Regular.otf]
%\definefontfamily[mainface][ss][Fira Sans]
%\definefontfamily[mainface][tt][Inconsolata]
%\definefontfamily[mainface][mm][Latin Modern Math]

\setupbodyfont[mainface,9pt]

\starttext
\setupTABLE[frame=off, split=repeat]
\setupTABLE[r][last][bottomframe=on]
\setupTABLE[c][1][width=3.0in]
\setupTABLE[c][2][width=0.5in, align=flushright]
\setupTABLE[c][3][width=0.5in, align=flushright]
\setupTABLE[c][4][width=2.5in]
\bTABLE
    \bTABLEhead
\bTR[topframe=on, bottomframe=on] 
\bTH {\bf Unit Description} \eTH
\bTH {\bf Weight} \eTH
\bTH {\bf Mark} \eTH
\bTH \eTH
\eTR
\eTABLEhead
\bTABLEbody
\dorecurse{10}{
%% Need to keep Unit description row and comment row together.
\bTR[topframe=on] 
\bTD {\sc Unit } \eTD
\bTD 10 \eTD
\bTD 99 \eTD
\bTD \eTD
\eTR
\bTR
\bTD[nc=4] \input lorem.tex \eTD
\eTR
}
\eTABLEbody
\eTABLE
\stoptext

<<<< MWE

-- 
Pavneet Arora   m: +1 (647) 406-6843
Waroc Informatikt: +1 (416) 937-9276
___
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
___

[NTG-context] Floating split TABLE misaligned

2016-02-05 Thread Andreas Schneider

Hi,

I presume I found a bug in TABLE placement. The attached examples shows, 
that the split TABLE is not centered on the first page, bug centered on 
the second. I would expect it to be centered in both cases.


Best regards,
Andreas\setupTABLE[split=repeat, textwidth=.9\textwidth]
\setupTABLE[column][last][width=broad]
\setupTABLE[row][first][style=bold]
\setupTABLE[offset=.2em]

\setupwhitespace[medium]
\setuptolerance[verytolerant]

\starttext
	\dorecurse{2}{\input knuth\par}

	\placetable[here,split][]{Test}{
		\bTABLE
			\bTABLEhead
\bTR \bTD Col1 \eTD \bTD Col2 \eTD \eTR
			\eTABLEhead
			\bTABLEbody
\dorecurse{20}{\bTR \bTD Test \eTD \bTD Test \eTD \eTR}
			\eTABLEbody
		\eTABLE
	}
\stoptext___
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
___

[NTG-context] Fwd: \bTABLEheader used to work?

2015-10-18 Thread Henman


I found out that the command is \bTABLEhead and not \bTABLEheader, but I 
don't know why my saved example had ...header instead of head.


Thanks.


 Forwarded Message 
Subject:\bTABLEheader used to work?
Date:   Sun, 18 Oct 2015 00:06:38 -0700
From:   Henman <dhen...@gmail.com>
To: Context Users Group <ntg-context@ntg.nl>



I tried to build on a previously compilable table generating context
file, but can not do so now.   Here is  a simple example:

I am getting a " ! Undefined control sequence
  Line #.20   which is ==>\bTABLEheader

Do I have hidden bug in my script or did this change?
I'd appreciate hellp of this.

Thanks
--

% start here
\define\ROWCNT{5}
\define\COLCNT{5}

\starttext
%
  \bTABLE[align={middle,lohi},width=20mm,height=10mm]

 \bTABLEheader
   \bTR  \bTD \eTD\dorecurse{\COLCNT}  { \bTH #1 \eTH } \eTR
 %  col label cells% ... data cells ...
 \eTABLEheader

 \bTABLEbody
\dorecurse{\ROWCNT}
  {
  \bTR
  \bTD #1 \eTD   % row label cells
  \dorecurse{\COLCNT}  { \bTD  \eTD }   % data rows  (use
#1:##1  for r# : c#)
  \eTR
  }
 \eTABLEbody

  \eTABLE
\stoptext
% end of example



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

Re: [NTG-context] Splitting natural table fails with xtable in footer

2015-10-06 Thread Andreas Schneider

No ideas? Nothing I can do about this? :-(


Am 2015-10-01 12:52, schrieb Andreas Schneider:

Hello,

In the following minimal example, an error occurs when build the file
(with a recent context version):


\starttext

\startsetups[s:footer]
  
\startembeddedxtable[frame=off,distance=5pt,bodyfont=6pt,option=stretch]

\startxrow
  \startxcell Filename: \stopxcell
  \startxcell[distance=1cm] \outputfilename.pdf \stopxcell
\stopxrow
  \stopembeddedxtable
\stopsetups

\setupheader[style=\tx]
\setupfooter[style=\tx]
\setupfootertexts[\setups{s:footer}][][][\setups{s:footer}]

\startchapter[title={Test}]
  \placetable[split]{Test}{
  \bTABLE[split=repeat]
\bTABLEhead
  \bTR \bTD Col1 \eTD \bTD Col2 \eTD \eTR
\eTABLEhead
\bTABLEbody
  \dorecurse{50}{\bTR \bTD Value1 \eTD \bTD Value2 \eTD \eTR}
\eTABLEbody
  \eTABLE}
\stopchapter

\stoptext


The error is as follows:

This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) 
(rev 5238)
ConTeXt  ver: 2015.09.13 13:31 MKIV beta  fmt: 2015.10.1  int: 
english/english

...
tex error   > tex error on line 25 in file
/Users/aese/Temp/ctx/split.tex: ! You can't use `\prevdepth' in
restricted horizontal mode
...
tex error   > tex error on line 25 in file
/Users/aese/Temp/ctx/split.tex: ! Illegal unit of measure (pt
inserted)





In reality my footer is lot more complex (huge table :-)) and I see no
better way to handle this.

Is there a way to fix this situation? (Preferable without rolling out
a new ConTeXt version?)

Best regards,
Andreas
___
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
___

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

[NTG-context] Splitting natural table fails with xtable in footer

2015-10-01 Thread Andreas Schneider

Hello,

In the following minimal example, an error occurs when build the file 
(with a recent context version):



\starttext

\startsetups[s:footer]
  
\startembeddedxtable[frame=off,distance=5pt,bodyfont=6pt,option=stretch]

\startxrow
  \startxcell Filename: \stopxcell
  \startxcell[distance=1cm] \outputfilename.pdf \stopxcell
\stopxrow
  \stopembeddedxtable
\stopsetups

\setupheader[style=\tx]
\setupfooter[style=\tx]
\setupfootertexts[\setups{s:footer}][][][\setups{s:footer}]

\startchapter[title={Test}]
  \placetable[split]{Test}{
  \bTABLE[split=repeat]
\bTABLEhead
  \bTR \bTD Col1 \eTD \bTD Col2 \eTD \eTR
\eTABLEhead
\bTABLEbody
  \dorecurse{50}{\bTR \bTD Value1 \eTD \bTD Value2 \eTD \eTR}
\eTABLEbody
  \eTABLE}
\stopchapter

\stoptext


The error is as follows:




This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238)
ConTeXt  ver: 2015.09.13 13:31 MKIV beta  fmt: 2015.10.1  int: 
english/english

...
tex error   > tex error on line 25 in file 
/Users/aese/Temp/ctx/split.tex: ! You can't use `\prevdepth' in 
restricted horizontal mode

...
tex error   > tex error on line 25 in file 
/Users/aese/Temp/ctx/split.tex: ! Illegal unit of measure (pt inserted)





In reality my footer is lot more complex (huge table :-)) and I see no 
better way to handle this.


Is there a way to fix this situation? (Preferable without rolling out a 
new ConTeXt version?)


Best regards,
Andreas
___
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
___

[NTG-context] formal multipage table

2015-04-07 Thread Csikos Bela
Hello:

I would like to place a landscape formal multi-page table in a document.
I try to attach a pdf showing what I would like to achieve.
The example file was made in latex using array, booktabs, lscape, and  
longtable packages.

I read the contextgarden wiki pages on different table packages but according 
to that information none of the available table modules can be used to make 
such table. Is the information up-to-date and accurate? Furthermore, how can I 
insert the table in landscape mode on a portrait page (page numbers should be 
portrait). I need different headers for the first and the following pages, 
different footers for the last and the previous pages, rules width different 
depths for start/end and middle rules.

I experimented with both Tables and TABLE modules but before I go into it more 
I would like to know if it is feasible at all what I want.

This is one of the trials I made:

\defineipsum[tf][alternative=lines,n=2]

\starttext

\setupTABLE[r][first][style=\tf]

\bTABLE[split=repeat,option=stretch,frame=off,bottomframe=on]
\bTABLEhead
\bTR
  \bTH[nc=2]  This is the first page header \eTH
\eTR
\bTR
  \bTH  Column 1 \eTH  
  \bTH  Column 2 \eTH
\eTR
\eTABLEhead

\bTABLEnext
\bTR
  \bTH[nc=2]  This is the page header (not on first page) \eTH
\eTR
\bTR
  \bTH  Column 1 \eTH  
  \bTH  Column 2 \eTH
\eTR
\eTABLEnext

\bTABLEbody
\dorecurse{25}{
\bTR
  \bTC  \ipsum[tf] \eTC
  \bTC   \eTC
\eTR}
\eTABLEbody

\bTABLEfoot[bottomframe=off]
\bTR
  \bTC[nc=2] This is the footer \eTC
\eTR
\eTABLEfoot
\eTABLE

\stoptext

There is no separate footer, I could not get rid of the rule below the footer, 
and I don't understand why the firs header is not in normal typeface instead of 
bold.


Thanks in advance,

bcsikos

formal-multipage-table.pdf
Description: Adobe PDF document
___
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
___

[NTG-context] Multi-page centered natural TABLE

2014-08-25 Thread Christoph Reller
Hi!

How do I use a natural table to produce a table which is both:
- distributed across multiple pages (split=yes) and
- centered horizontally on each page.

I did try the following but it only works if split=no.

\starttext
\startalignment[middle]\dontleavehmode%
  \bTABLE[split=yes]
\bTABLEhead
  \bTR\bTH Thing \eTH\bTH Desc \eTH\eTR
\eTABLEhead
\bTABLEbody
  \dorecurse{40}{\bTR\bTD Foo \eTD\bTD Text. \eTD\eTR}
\eTABLEbody
  \eTABLE
\stopalignment
\stoptext

Thank you for any help.

Christoph
___
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
___

Re: [NTG-context] Multi-page centered natural TABLE

2014-08-25 Thread Wolfgang Schuster

Am 25.08.2014 um 15:38 schrieb Christoph Reller christoph.rel...@gmail.com:

 Hi!
 
 How do I use a natural table to produce a table which is both:
 - distributed across multiple pages (split=yes) and
 - centered horizontally on each page.
 
 I did try the following but it only works if split=no.
 
 \starttext
 \startalignment[middle]\dontleavehmode%
   \bTABLE[split=yes]
 \bTABLEhead
   \bTR\bTH Thing \eTH\bTH Desc \eTH\eTR
 \eTABLEhead
 \bTABLEbody
   \dorecurse{40}{\bTR\bTD Foo \eTD\bTD Text. \eTD\eTR}
 \eTABLEbody
   \eTABLE
 \stopalignment
 \stoptext
 
 Thank you for any help.

You have to use the float mechanism. To disable the caption and number you can 
use the “none”
keyword and to split the table at page breaks use the “split” keyword. There is 
no need to set
“split=yes” for the table unless you want to repeat the header which requires 
“split=repeat”.

\starttext

\startplacetable[location={none,split}]
  \bTABLE%[split=repeat]
\bTABLEhead
  \bTR\bTH Thing \eTH\bTH Desc \eTH\eTR
\eTABLEhead
\bTABLEbody
  \dorecurse{40}{\bTR\bTD Foo \eTD\bTD Text. \eTD\eTR}
\eTABLEbody
  \eTABLE
\stopplacetable

\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
___


Re: [NTG-context] About natural tables

2013-10-30 Thread Wolfgang Schuster

Am 30.10.2013 um 17:43 schrieb MANUEL GONZALEZ SUAREZ 
gonzalezsman...@uniovi.es:

 Hello everyone.
 I like to compose tables using the method Natural Tables recommended 
 Contextgarden but do not know how I have toconfigure to display only 
 horizontal lines (not vertical). I send a minimal example:
 
 
 \starttext
 \starttable[|c|c|]
 \HL
 \NC Letters \NC Numbers \SR % or \NC\AR
 \HL
 \NC A \NC 1 \AR
 \NC B \NC 2 \AR
 \NC C \NC 3 \AR
 \HL
 \stoptable
 \stoptext
 
 How I could translate to a natural table  this code?

\startsetups[table:rules]

\setupTABLE [start]  [frame=off,align=middle]
\setupTABLE [header] [topframe=on,bottomframe=on]

\setupTABLE [row] [first] [topframe=on]
\setupTABLE [row] [last]  [bottomframe=on]

\stopsetups

\starttext

\bTABLE[setups=table:rules]
\bTABLEhead
\bTR
\bTD Letters \eTD
\bTD Numbers \eTD
\eTR
\eTABLEhead
\bTABLEbody
\bTR
\bTD A \eTD
\bTD 1 \eTD
\eTR
\bTR
\bTD B \eTD
\bTD 2 \eTD
\eTR
\bTR
\bTD C \eTD
\bTD 2 \eTD
\eTR
\eTABLEbody
\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
___

Re: [NTG-context] About natural tables

2013-10-30 Thread Aditya Mahajan

On Wed, 30 Oct 2013, Wolfgang Schuster wrote:



Am 30.10.2013 um 17:43 schrieb MANUEL GONZALEZ SUAREZ 
gonzalezsman...@uniovi.es:


Hello everyone.
I like to compose tables using the method Natural Tables recommended 
Contextgarden but do not know how I have toconfigure to display only horizontal lines 
(not vertical). I send a minimal example:


\starttext
\starttable[|c|c|]
\HL
\NC Letters \NC Numbers \SR % or \NC\AR
\HL
\NC A \NC 1 \AR
\NC B \NC 2 \AR
\NC C \NC 3 \AR
\HL
\stoptable
\stoptext

How I could translate to a natural table  this code?


\startsetups[table:rules]

\setupTABLE [start]  [frame=off,align=middle]
\setupTABLE [header] [topframe=on,bottomframe=on]

\setupTABLE [row] [first] [topframe=on]
\setupTABLE [row] [last]  [bottomframe=on]

\stopsetups

\starttext

\bTABLE[setups=table:rules]
\bTABLEhead
\bTR
\bTD Letters \eTD
\bTD Numbers \eTD
\eTR
\eTABLEhead
\bTABLEbody
\bTR
\bTD A \eTD
\bTD 1 \eTD
\eTR
\bTR
\bTD B \eTD
\bTD 2 \eTD
\eTR
\bTR
\bTD C \eTD
\bTD 2 \eTD
\eTR
\eTABLEbody
\eTABLE

\stoptext


or

\startsetups[table:rules]
\setupTABLE [start]  [frame=off,align=middle]
\setupTABLE [row] [first] [topframe=on, bottomframe=on]
\setupTABLE [row] [last]  [bottomframe=on]
\stopsetups

\starttext

\startTABLE[setups=table:rules]
\NC Letters \NC Numbers \NC \NR
\NC A \NC 1 \NC \NR
\NC B \NC 2 \NC \NR
\NC C \NC 3 \NC \NR
\stopTABLE
\stoptext

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


Re: [NTG-context] About natural tables

2013-10-30 Thread MANUEL GONZALEZ SUAREZ
Thanks very much Wolfgang

De: ntg-context-boun...@ntg.nl ntg-context-boun...@ntg.nl en nombre de Aditya 
Mahajan adit...@umich.edu
Enviado: miércoles, 30 de octubre de 2013 17:24
Para: mailing list for ConTeXt users
Asunto: Re: [NTG-context] About natural tables

On Wed, 30 Oct 2013, Wolfgang Schuster wrote:


 Am 30.10.2013 um 17:43 schrieb MANUEL GONZALEZ SUAREZ 
 gonzalezsman...@uniovi.es:

 Hello everyone.
 I like to compose tables using the method Natural Tables recommended 
 Contextgarden but do not know how I have toconfigure to display only 
 horizontal lines (not vertical). I send a minimal example:


 \starttext
 \starttable[|c|c|]
 \HL
 \NC Letters \NC Numbers \SR % or \NC\AR
 \HL
 \NC A \NC 1 \AR
 \NC B \NC 2 \AR
 \NC C \NC 3 \AR
 \HL
 \stoptable
 \stoptext

 How I could translate to a natural table  this code?

 \startsetups[table:rules]

   \setupTABLE [start]  [frame=off,align=middle]
   \setupTABLE [header] [topframe=on,bottomframe=on]

   \setupTABLE [row] [first] [topframe=on]
   \setupTABLE [row] [last]  [bottomframe=on]

 \stopsetups

 \starttext

 \bTABLE[setups=table:rules]
   \bTABLEhead
   \bTR
   \bTD Letters \eTD
   \bTD Numbers \eTD
   \eTR
   \eTABLEhead
   \bTABLEbody
   \bTR
   \bTD A \eTD
   \bTD 1 \eTD
   \eTR
   \bTR
   \bTD B \eTD
   \bTD 2 \eTD
   \eTR
   \bTR
   \bTD C \eTD
   \bTD 2 \eTD
   \eTR
   \eTABLEbody
 \eTABLE

 \stoptext

or

\startsetups[table:rules]
\setupTABLE [start]  [frame=off,align=middle]
\setupTABLE [row] [first] [topframe=on, bottomframe=on]
\setupTABLE [row] [last]  [bottomframe=on]
\stopsetups

\starttext

\startTABLE[setups=table:rules]
\NC Letters \NC Numbers \NC \NR
\NC A \NC 1 \NC \NR
\NC B \NC 2 \NC \NR
\NC C \NC 3 \NC \NR
\stopTABLE
\stoptext

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


[NTG-context] setuplayout with duplex - shifted textarea

2013-10-14 Thread Zenlima
Hi,

I have a both sided document in which I have to switch the layout
inside a page. If I do that with text only content it works fine, but
as soon I have bigger objects (like a table) the textarea get messed
up (shifted horizontally).

I added in this example inner and outer margin notes to make it more
obvious.

Is there a way so solve this unwanted shifting like on page 2 of the
attached example?

Thanks,
H.

--8
\setuppapersize[A4][A4]

\definelayout[WithoutMarginnotes][location={duplex},grid=no,topspace=3cm,height=24cm,backspace=3cm,cutspace=0cm,leftmargin=1cm,leftmargindistance=0.4cm,width=16cm,rightmargindistance=0cm,rightmargin=0cm]

\definelayout[WithMarginnotes][location={duplex},grid=no,topspace=3cm,height=24cm,backspace=3cm,cutspace=0cm,leftmargin=1cm,leftmargindistance=0.4cm,width=12.1cm,rightmargindistance=0.4cm,rightmargin=3.5cm]

\setuppagenumbering[alternative=doublesided,location=]


\starttext

\setuplayout[WithMarginnotes]

\dorecurse {6} {
 \ininner[stack=yes]{\expanded{\dorecurse{2}{IM\recurselevel\space}}}%
 \inouter[stack=yes]{\expanded{\dorecurse{3}{OM\recurselevel\space}}}%
 \input tufte \par
}

\setuplayout[WithoutMarginnotes]

\placetable[split][]{Big table object}
{
\setupTABLE[row][1][width=\textwidth]
\bTABLE[split=repeat]
\bTABLEhead
\bTR \bTD XXX \eTD \eTR
\eTABLEhead
\bTABLEbody
\dorecurse{20}{
\bTR \bTD XXX \eTD \eTR}
\eTABLEbody
\eTABLE
}

\setuplayout[WithMarginnotes]

\dorecurse {3} {
 \ininner[stack=yes]{\expanded{\dorecurse{2}{IM\recurselevel\space}}}%
 \inouter[stack=yes]{\expanded{\dorecurse{3}{OM\recurselevel\space}}}%
 \input tufte \par
}

\stoptext

layoutchange-1.pdf
Description: Adobe PDF document
___
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
___

Re: [NTG-context] Alignment table with comma, and long long space after

2013-09-22 Thread Xan
It does not work with that:

%%% Per a què les taules se me puguin alinear amb les comes
\chardef\characteralignmentmode=2
\chardef\characteralignmentmode\plustwo

%%% 
http://randomdeterminism.wordpress.com/2012/11/18/separation-of-content-and-presentation-for-tables-part-1/
\startsetups table:style
  \setupTABLE[row][first][background=color, backgroundcolor=tablecolor, 
color=black, align={middle,lohi},style=ss]
  \setupTABLE[column][1][align={right,lohi}]
  
\setupTABLE[column][2][align={left,lohi},alignmentcharacter={,},aligncharacter=yes]
%  \setupTABLE[column][2][width=.20\textwidth]
  \setupTABLE[loffset=1mm,roffset=1mm]
  \setupTABLE[frame=off]
  \setupTABLE[topframe=on,bottomframe=on]
  \setupTABLE[column][first][leftframe=on]
  \setupTABLE[column][last][rightframe=on]
\stopsetups


What can I do?

Xan.
On Sat, 21 Sep 2013 18:55:51 +0200
Wolfgang Schuster schuster.wolfg...@gmail.com ha escrit:

 
 Am 21.09.2013 um 16:22 schrieb Xan dxpubl...@telefonica.net:
 
  Hi,
  
  I have this
  
  \startsetups table:style
   \setupTABLE[row][first][background=color, backgroundcolor=tablecolor, 
  color=black, align={middle,lohi},style=ss]
   \setupTABLE[column][1][align={right,lohi}]
   
  \setupTABLE[column][2][align={left,lohi},alignmentcharacter={,},aligncharacter=yes]
  %  \setupTABLE[column][2][width=.20\textwidth]
   \setupTABLE[loffset=1mm,roffset=1mm]
   \setupTABLE[frame=off]
   \setupTABLE[topframe=on,bottomframe=on]
   \setupTABLE[column][first][leftframe=on]
   \setupTABLE[column][last][rightframe=on]
  \stopsetups
  
  \placefigure[here]{Diverses mesures}{
  \bTABLE[setups={table:header, table:frame, table:style}]
  \bTABLEhead
  \bTR \bTD Esdeveniment \eTD \bTD Mesura (m) \eTD \eTR
  \eTABLEhead
  \bTABLEbody
  \bTR \bTD Distància mitjana Terra-Lluna \eTD \bTD 150.000.000.000 \eTD \eTR
  \bTR \bTD Diàmetre mitjà terrestre \eTD \bTD 12 800.000 \eTD \eTR
  \bTR \bTD Distància Palma-Alcúdia \eTD \bTD 75.000 \eTD \eTR
  \bTR \bTD Diàmetre mitjà de Júpiter \eTD \bTD 140.000.000 \eTD \eTR
  \bTR \bTD L'altura d'una persona \eTD \bTD 1,75 \eTD \eTR
  \bTR \bTD La distància mitjana entre el Sol i Alfa-Centauri \eTD \bTD 
  40.790.494.000.000.000 \eTD \eTR
  \eTABLEbody
  \eTABLE}
  
  
  but ConTeXt produces a lot of space after 1,75.
  
  How can I do for second column fits the content?
 
 Add the following line to your setups for the table.
 
 \chardef\characteralignmentmode\plustwo
 
 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
___


Re: [NTG-context] Alignment table with comma, and long long space after

2013-09-22 Thread Xan
Yes:



 You can show us a *complete* minimal example.
 
 Wolfgang
% Regime
\enableregime[utf]

% Choose a language, and associated hyphenation rules.
\mainlanguage[ca]

% AMSTHM equivalent
%% Exercici
%% Mirar http://wiki.contextgarden.net/Command/setupdescriptions
%%% posar alternative=left per identar tots els continguts | alternative=serried per tractar el contingut com un paràgraf ordinari
\defineenumeration
  [exercici]
  [alternative=serried,text={\startcolor[darkblue]Exercici\stopcolor},stopper={.\space},left={\bgroup},right={\egroup},width=fit,headstyle=\ss,distance=0.25em,width=fit]

%\defineenumeration
%  [exerciciimportant]
%  [text={Exercici},headstyle=bold,between=\blank,titledistance=0em,textdistance=1em,
%stopper={.\space},location=serried,left={\bgroup\bf},right={\egroup},width=fit,before={\bgroup\startframedtext[background=screen,frame=off,width=broad]},after={\stopframedtext\egroup}]

% Intent fer una comanda per a fer requadres a les coses importants
% http://www.ntg.nl/pipermail/ntg-context/2013/074823.html
\def\important{\dodoubleempty\doimportant}
\def\doimportant[#1][#2]{\bgroup
\ifsecondargument
   \startframedtext[background=color,backgroundcolor=#2,frame=off,width=broad]%
   #1
\else
   \startframedtext[background=screen,frame=off,width=broad]%
   #1
\fi
\stopframedtext
\egroup}

\defineframedtext
  [important]
  [background=screen,
   frame=off,
   width=broad]

% Per a veure què falla amb els símbols
\enabletrackers [fonts.missing]


% Choose a font
%\usetypescript[pagella][ec]
%\setupbodyfont[pagella,11pt]
\setupbodyfont [cmr,11pt] % cmr, 11pt

% Margins
%\setuplayout[topspace=2cm, backspace=2cm, header=1.5cm,margin=2cm,width=middle,footer=1cm]

% Colors
\definecolor[headingcolor][c=1,m=0.5431,y=0,k=0.5451]
\definecolor[tablecolor][b=1,t=.5,a=1]

% Page number
\setuppagenumbering [location={header,right}]

% Paper size
\setuppapersize [A4]

% Italic in emph (by default is slanted)
\setupbodyfontenvironment[default][em=italic]

% Headers and footers
\setupfooter[text][style={\ss\tfx},color=headingcolor,before={\hrule}]
\setupheader[text][style={\ss},color=headingcolor,after={\hrule}]

%% Display of headers
\setuphead[title][style={\tfd},align=middle,before={\begingroup},after={\bigskip\endgroup}]
\setupheads[section,subject][style={\tfc}]
\setupheads[subsubject,subsection][style={\tfb}]
\setuphead[title,chapter,subject,section,subsubject,subsection][color=headingcolor]

%% Per veure els enllaços
\setupinteraction[state=start]

%% Per a BibTeX
\setuppublications[alternative=ams]


%% Taules: estils

%%% Per a què les taules se me puguin alinear amb les comes
\chardef\characteralignmentmode=2
\chardef\characteralignmentmode\plustwo

%%% http://randomdeterminism.wordpress.com/2012/11/18/separation-of-content-and-presentation-for-tables-part-1/
\startsetups table:style
  \setupTABLE[row][first][background=color, backgroundcolor=tablecolor, color=black, align={middle,lohi},style=ss]
  \setupTABLE[column][1][align={right,lohi}]
  \setupTABLE[column][2][align={left,lohi},alignmentcharacter={,},aligncharacter=yes]
%  \setupTABLE[column][2][width=.20\textwidth]
  \setupTABLE[loffset=1mm,roffset=1mm]
  \setupTABLE[frame=off]
  \setupTABLE[topframe=on,bottomframe=on]
  \setupTABLE[column][first][leftframe=on]
  \setupTABLE[column][last][rightframe=on]
\stopsetups

%% Normal
\startsetups table2:style
  \setupTABLE[row][first][background=color, backgroundcolor=tablecolor, color=black, align={middle,lohi},style=ss]
  \setupTABLE[column][1][align={right,lohi}]
  \setupTABLE[column][2][align={left,lohi}]
%  \setupTABLE[column][2][width=.20\textwidth]
  \setupTABLE[loffset=1mm,roffset=1mm]
  \setupTABLE[frame=off]
  \setupTABLE[topframe=on,bottomframe=on]
  \setupTABLE[column][first][leftframe=on]
  \setupTABLE[column][last][rightframe=on]
\stopsetups


%% ConTeXt MIV

%% Capçaleres i peus

%%% Prenc els primers 5 caràcters del sha256 del fitxer (requereix ConTeXt MIV)
\setupfootertexts[\jobname\space(versió \ctxlua{context(os.resultof(sha256sum \jobname.tex | cut -c  -5))}, \currentdate)][]

\starttext


\placefigure[here]{Diverses mesures}{
\bTABLE[setups={table:header, table:frame, table:style}]
\bTABLEhead
\bTR \bTD Esdeveniment \eTD \bTD Mesura (m) \eTD \eTR
\eTABLEhead
\bTABLEbody
\bTR \bTD Distància mitjana Terra-Lluna \eTD \bTD 150.000.000.000 \eTD \eTR
\bTR \bTD Diàmetre mitjà terrestre \eTD \bTD 12 800.000 \eTD \eTR
\bTR \bTD Distància Palma-Alcúdia \eTD \bTD 75.000 \eTD \eTR
\bTR \bTD Diàmetre mitjà de Júpiter \eTD \bTD 140.000.000 \eTD \eTR
\bTR \bTD L'altura d'una persona \eTD \bTD 1,75 \eTD \eTR
\bTR \bTD La distància mitjana entre el Sol i Alfa-Centauri \eTD \bTD 40.790.494.000.000.000 \eTD \eTR
\eTABLEbody
\eTABLE}

\stoptext


prova.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry

[NTG-context] Alignment table with comma, and long long space after

2013-09-21 Thread Xan
Hi,

I have this

\startsetups table:style
  \setupTABLE[row][first][background=color, backgroundcolor=tablecolor, 
color=black, align={middle,lohi},style=ss]
  \setupTABLE[column][1][align={right,lohi}]
  
\setupTABLE[column][2][align={left,lohi},alignmentcharacter={,},aligncharacter=yes]
%  \setupTABLE[column][2][width=.20\textwidth]
  \setupTABLE[loffset=1mm,roffset=1mm]
  \setupTABLE[frame=off]
  \setupTABLE[topframe=on,bottomframe=on]
  \setupTABLE[column][first][leftframe=on]
  \setupTABLE[column][last][rightframe=on]
\stopsetups

\placefigure[here]{Diverses mesures}{
\bTABLE[setups={table:header, table:frame, table:style}]
\bTABLEhead
\bTR \bTD Esdeveniment \eTD \bTD Mesura (m) \eTD \eTR
\eTABLEhead
\bTABLEbody
\bTR \bTD Distància mitjana Terra-Lluna \eTD \bTD 150.000.000.000 \eTD \eTR
\bTR \bTD Diàmetre mitjà terrestre \eTD \bTD 12 800.000 \eTD \eTR
\bTR \bTD Distància Palma-Alcúdia \eTD \bTD 75.000 \eTD \eTR
\bTR \bTD Diàmetre mitjà de Júpiter \eTD \bTD 140.000.000 \eTD \eTR
\bTR \bTD L'altura d'una persona \eTD \bTD 1,75 \eTD \eTR
\bTR \bTD La distància mitjana entre el Sol i Alfa-Centauri \eTD \bTD 
40.790.494.000.000.000 \eTD \eTR
\eTABLEbody
\eTABLE}


but ConTeXt produces a lot of space after 1,75.

How can I do for second column fits the content?

Thanks in advance,
Xan.

PS: Please CCme
___
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
___


Re: [NTG-context] Alignment table with comma, and long long space after

2013-09-21 Thread Wolfgang Schuster

Am 21.09.2013 um 16:22 schrieb Xan dxpubl...@telefonica.net:

 Hi,
 
 I have this
 
 \startsetups table:style
  \setupTABLE[row][first][background=color, backgroundcolor=tablecolor, 
 color=black, align={middle,lohi},style=ss]
  \setupTABLE[column][1][align={right,lohi}]
  
 \setupTABLE[column][2][align={left,lohi},alignmentcharacter={,},aligncharacter=yes]
 %  \setupTABLE[column][2][width=.20\textwidth]
  \setupTABLE[loffset=1mm,roffset=1mm]
  \setupTABLE[frame=off]
  \setupTABLE[topframe=on,bottomframe=on]
  \setupTABLE[column][first][leftframe=on]
  \setupTABLE[column][last][rightframe=on]
 \stopsetups
 
 \placefigure[here]{Diverses mesures}{
 \bTABLE[setups={table:header, table:frame, table:style}]
 \bTABLEhead
 \bTR \bTD Esdeveniment \eTD \bTD Mesura (m) \eTD \eTR
 \eTABLEhead
 \bTABLEbody
 \bTR \bTD Distància mitjana Terra-Lluna \eTD \bTD 150.000.000.000 \eTD \eTR
 \bTR \bTD Diàmetre mitjà terrestre \eTD \bTD 12 800.000 \eTD \eTR
 \bTR \bTD Distància Palma-Alcúdia \eTD \bTD 75.000 \eTD \eTR
 \bTR \bTD Diàmetre mitjà de Júpiter \eTD \bTD 140.000.000 \eTD \eTR
 \bTR \bTD L'altura d'una persona \eTD \bTD 1,75 \eTD \eTR
 \bTR \bTD La distància mitjana entre el Sol i Alfa-Centauri \eTD \bTD 
 40.790.494.000.000.000 \eTD \eTR
 \eTABLEbody
 \eTABLE}
 
 
 but ConTeXt produces a lot of space after 1,75.
 
 How can I do for second column fits the content?

Add the following line to your setups for the table.

\chardef\characteralignmentmode\plustwo

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
___


Re: [NTG-context] Table cell spanning multiple columns in tabulate

2013-07-16 Thread Thomas Friedrich
2013/7/16 Sietse Brouwer sbbrou...@gmail.com:
 Thomas Friedrich wrote:
 I am switching from texexec to context, and from table to tabulate.
 Question: What is the equivalent for \use{2}\ReFormat[c]{text} in the
 \table environment, when you what to do the same in the \tabulate
 environment? I couldn't find the answer in the context garden.

 Wolfgang Schuster wrote:
 The tabulate environment has no support for spanned cells.

 The TABLE mechanism does, though, and that is probably the mkiv
 standard for writing non-trivial tables. It's a bit more verbose, but
 it can do an enormous number of things -- including many things that
 the tabulate mechanism can't. Wiki link:
 http://wiki.contextgarden.net/TABLE

 The equivalent of \use{2}\ReFormat[c]{text} would be this (rest of
 table code added to make this example self-contained and compilable):

 \bTABLE
   \bTR
 \bTD[nc=2, align=center] text \eTD
   \eTR
   \bTR
 \bTD apples \eTD
 \bTD oranges \eTD
   \eTR
 \eTABLE

 Hope this help!
 Cheers,
 Sietse

Thanks for pointing this out, and I did indeed rewrite the code, so it
would work with the TABLE mechanism. It's a bit like breaking a
butterfly with a wheel. Please have a look at the following code, as I
think I may have found bug in the TABLE mechanism.

The following code does exactly what I want but it has a pretty bad
hack on line 7, where I reference all columns by
[1,2,3,4,5,6,7,8][1,2,3] rather than using the [r][1,2,3], since the
latter does not work as expected.  It seems that statements concerning
columns take precedence before statements that concern rows.  In the
example below, \setupTABLE[c][1,2,3][align=right] overwrites
\setupTABLE[r][1,2][align=center] --- no matter where you put the
latter (before or after the former statement). At least for me, this
is rather unintuitive.

~~~ snip ~~~
\enableregime[utf-8]
\starttext
\placetable[here][tab:bcg-study-data]{The table shows results}{%

\bTABLE
\setupTABLE[r][each][align=left]
\setupTABLE[1,2,3,4,5,6,7,8][1,2][align=center]
%%% The following should be equivalest to the line above:
%\setupTABLE[r][1,2][align=center]

\setupTABLE[c][1,2,3][align=right]
\setupTABLE[c][4,5,6,7][width=17mm]
\setupTABLE[r][2][height=\lineheight]

\setupTABLE[frame=off]
\setupTABLE[4,5,6,7][2][bottomframe=on]
\setupTABLE[r][first][topframe=on]
\setupTABLE[r][last][bottomframe=on]
\setupTABLE[r][4][topframe=on]

\bTABLEhead
\bTR
  \bTD[nr=3] Trial \eTD
  \bTD[nr=3] Author \eTD
  \bTD[nr=3] Year \eTD
  \bTD[nc=4] Infected when\eTD
  \bTD[nr=3] {Absolute\\ latitute}\eTD
\eTR
\bTR
  \bTD[nc=2] vaccinated \eTD
  \bTD[nc=2] not vaccinated \eTD
\eTR
\bTR
  \bTD yes \eTD
  \bTD no \eTD
  \bTD yes \eTD
  \bTD no \eTD
\eTR
\eTABLEhead
\bTABLEbody
\bTR\bTD A \eTD\bTD Aronson   \eTD\bTD 1948 \eTD\bTD 4 \eTD\bTD 119
\eTD\bTD 11 \eTD\bTD 128  \eTD\bTD 44 \eTD\eTR
\bTR\bTD B \eTD\bTD Ferguson  \eTD\bTD 1949 \eTD\bTD 6 \eTD\bTD 300
\eTD\bTD 129 \eTD\bTD 274 \eTD\bTD 55 \eTD\eTR
\bTR\bTD C \eTD\bTD Rosenthal \eTD\bTD 1960 \eTD\bTD 3 \eTD\bTD 228
\eTD\bTD 11 \eTD\bTD 2090 \eTD\bTD 442 \eTD\eTR
\bTR\bTD D \eTD\bTD Hart \eTD\bTD 1977 \eTD\bTD 656 \eTD\bTD 13536
\eTD\bTD 248 \eTD\bTD 12619 \eTD\bTD 52 \eTD\eTR
\eTABLEbody
\eTABLE}
\stoptext
~~~ snip ~~~


Is this a bug? Is this a feature?

Thanks.

Thomas








 On 15 July 2013 16:49, Wolfgang Schuster schuster.wolfg...@gmail.com wrote:

 Am 15.07.2013 um 16:39 schrieb Thomas Friedrich 
 friedr...@statistik.tu-dortmund.de:

 Hello ConTeXt users,

 I am switching from texexec to context, and from table to tabulate.
 Question: What is the equivalent for \use{2}\ReFormat[c]{text} in the
 \table environment, when you what to do the same in the \tabulate
 environment? I couldn't find the answer in the context garden.

 The tabulate environment has no support for spanned cells.

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



-- 
Thomas Friedrich
Fakultät Statistik
Technische Universität Dortmund
44221 Dortmund
Telefon: 0231 755 - 3116
FAX: 0231 755 - 5304
E-Mail: friedr...@statistik.tu

[NTG-context] [***SPAM***] Shifting table header when using overlay

2013-07-14 Thread Dmitriy Tokarev
Hi All,

I'm trying to get a table header with such bottom border:
||

I plan to use an overlay to overlap the the internal borders of the cells. But 
in this case, the table header somehow slightly shifted to the left relative to 
the body (see attachment). Is it possible to remove this effect? Or maybe there 
is another way to achieve the desired border? Thanks.

\startuseMPgraphic{MP:thickBtm}
   draw (0,2pt)--(OverlayWidth,2pt) withpen pensquare scaled 1pt withcolor red;
   clip currentpicture to OverlayBox;
   setbounds currentpicture to OverlayBox;
\stopuseMPgraphic

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

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

--
Dmitriy

table.pdf
Description: Adobe PDF document
___
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
___

[NTG-context] split natural table

2013-05-21 Thread Stephens, Kenny
I use a natural table to format my page header. I have another natural table in 
the body. When the body's table is split onto the second page it interferes 
with the formatting of the header's table, but only the header-table on the 
first page. I've included an example. Run as-is, the header has the correct 
format. Uncomment the last row of the body table to see the incorrect header 
formatting. This behavior also occurs using live.contextgarden.net (today, 
2013-05-21).

The incorrect header table format occurs with split=yes and split=repeat 
for the body table. If split=no then the header table keeps the correct 
format.

TexLive 2012 (updated 2013-05-20 to frozen version)
LuaTeX beta-0.70.2-2012052410
ConTeXt: 2012.05.30 11:26 MkIV fmt: 2012.9.13

\setuppapersize[letter][letter]
\setuplayout[topspace=0pt,
 header=42pt,
 headerdistance=6pt,
 ]
\setuppagenumbering[location=]
\setupwhitespace[none]
\define\syllabusheader{%
\vskip0.1mm
\bTABLE[frame=off,width=\textwidth]
  \setupTABLE[c][1][width=fit,  align=raggedright,style={\bfb\ss}]
  \setupTABLE[c][2][width=broad,align=center, style={\bfd\ss}]
  \setupTABLE[c][3][width=fit,  align=raggedleft, style={\bfb\ss}]
  \bTR \bTD Left \eTD \bTD Center \eTD \bTD Right \eTD \eTR
\eTABLE
}
\setupheadertexts[{\framed[corner=09,width=broad,align=center,height=\headerheight]%
  {\syllabusheader}}]
\starttext
\bTABLE[split=repeat]
  \setupTABLE[c][1][width=10em,align={center,lohi},style={\bfx}]
  \setupTABLE[r][1][align={hilo,center},style={\bfx}]
  \setupTABLE[c][2][width=20em,style={\tfx}]
  \bTABLEhead
   \bTR\bTH Row number \eTH\bTH Content \eTH\eTR
  \eTABLEhead
  \bTABLEbody
   \bTR\bTC  1 \eTC\bTC \input{knuth} \eTC\eTR
   \bTR\bTC  2 \eTC\bTC \input{knuth} \eTC\eTR
   \bTR\bTC  3 \eTC\bTC \input{knuth} \eTC\eTR
%   \bTR\bTC  4 \eTC\bTC \input{knuth} \eTC\eTR % Uncomment this line to see 
wrong behavior
  \eTABLEbody
\eTABLE
\stoptext

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

[NTG-context] \bTD\numexpr\currentTABLErow\minusone\relax\eTD

2013-04-19 Thread Alan BRASLAU
Hello,

I naively tried using
\bTD\numexpr\currentTABLErow\minusone\relax\dTD
in a TABLE.

As I do not master even simple calculations under TeX, I do not see
what I am missing in order to label TABLE rows, starting from 0?


(Row 1 is a heading, set off by \bTABLEhead\eTABLEhead, which is why I
am looking to subtract 1 from \currentTABLErow, but this does not
matter of course.

But perhaps the addressing of TABLE rows, including within \setupTABLE,
should or could handle this situation? This is a secondary question to
think about...)

Alan
___
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
___


Re: [NTG-context] TABLE: header with a thick bottom line

2012-10-23 Thread Procházka Lukáš Ing . - Pontex s . r . o .

On Mon, 22 Oct 2012 17:45:21 +0200, Marco Patzer home...@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:l...@pontex.cz]
Pontex s. r. o.  [mailto:pon...@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

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

t-Tab-ThkBtm.mkiv
Description: Binary data


t-Tab-ThkBtm.pdf
Description: Adobe PDF document
___
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
___

Re: [NTG-context] TABLE: header with a thick bottom line

2012-10-23 Thread Rogers, Michael K
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
___


Re: [NTG-context] ntg-context Digest, Vol 100, Issue 63

2012-10-23 Thread Shane Peelar
: [NTG-context] TABLE: header with a thick bottom line
 Message-ID:
 
 1e5a50c784a8ad44b420ef5a1e9b2806afc33...@e14mbx20n.enterprise.emory.net

 Content-Type: text/plain; charset=iso-8859-2

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


 --

 Message: 5
 Date: Tue, 23 Oct 2012 17:28:58 +0200
 From: Hans Hagen pra...@wxs.nl
 To: Proch?zka Luk?? Ing. - Pontex s. r. o. l...@pontex.cz
 Cc: ConTeXt ntg-context@ntg.nl
 Subject: Re: [NTG-context] Lua in Ctx: require() fails?
 Message-ID: 5086b7ba.1090...@wxs.nl
 Content-Type: text/plain; charset=ISO-8859-2; format=flowed

 On 23-10-2012 16:58, Proch?zka Luk?? Ing. - Pontex s. r. o. wrote:
  On Tue, 23 Oct 2012 16:53:01 +0200, Hans Hagen pra...@wxs.nl wrote:
 
  On 23-10-2012 16:37, Proch?zka Luk?? Ing. - Pontex s. r. o. wrote:
 
  resolverslibraries  ! checking for Test.lua using lua
 path
  d:/Lukas/Lua/?.lua
  
 
  in the output log but d:\Lukas\Lua\Test.lua is not found here (?!).
 
  So - ?
 
  no clue ... maybe an error in test.lua
 
   Have you seen the content of Test.lua? It just prints some text...
 
  When I downgraded Ctx to the previous installed version, it works...

 When I make

 e:\tmp\whatever.lua (current path)
 e:\tmp\whatever\something.lua

 And run

 \starttext

  \enabletrackers[resolvers.libraries]

  \startluacode
  print(LUAINPUTS,os.getenv(LUAINPUTS))

  require(whatever) ;
  require(something) ;
  \stopluacode

 \stoptext

 i get

 LUAINPUTS   e:/tmp/whatever
 resolverslibraries  ! locating whatever as whatever.lua
 using formats texlua
 resolverslibraries  ! checking for whatever.lua' using
 format tex
 resolverslibraries  ! lib whatever.lua located on
 whatever.lua
 whatever
 resolverslibraries  ! locating something as something.lua
 using formats texlua
 resolverslibraries  ! checking for something.lua' using
 format tex
 resolverslibraries  ! checking for something.lua' using
 format lua
 resolverslibraries  ! lib something.lua located on
 e:/tmp/whatever/something.lua
 something

 so it must be something with your path spec

 -
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
   | www.pragma-pod.nl
 -


 --

 Message: 6
 Date: Tue, 23 Oct 2012 11:58:05 -0400
 From: Shane Peelar lookatyouhac...@gmail.com
 To: ntg-context@ntg.nl
 Subject: [NTG-context] Some odd behaviour I noticed in MkIV with
 respect to  enumerations
 Message-ID:
 CAEseUXkaFYJTGP=K=
 bgrl8kztyzyxkehvohqga-vhb7b0bl...@mail.gmail.com
 Content-Type: text/plain; charset=iso-8859-1

 Hello everyone,

 I was going through a tutorial to learn how to set up theorem-like
 environments in ConTeXt:
 http://www.ntg.nl/maps/36/09.pdf

 and I noticed a few strange behaviours.  I recognize that this tutorial was
 written for MkII ConTeXt,
 but after consulting the documentation in the latest ConTeXt manual and the
 wiki, I have determined
 that these features should

[NTG-context] TABLE: header with a thick bottom line

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

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:l...@pontex.cz]
Pontex s. r. o.  [mailto:pon...@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

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

t-TabHdr.mkiv
Description: Binary data


t-TabHdr.pdf
Description: Adobe PDF document
___
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
___

Re: [NTG-context] TABLE: header with a thick bottom line

2012-10-22 Thread Aditya Mahajan

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

[NTG-context] TABLE and row/column align settings

2012-10-03 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

I have a complicated TABLE, but I simplified it to the following example:


\def\DoTable#1{%
  \bTABLE
\setupTABLE[width=2cm]
\setupTABLE[column][#1][align=flushright] % 
... [1]
\setupTABLE[row][1][align=middle] % Settings for ALL columns in the row 1 
should be overwritten ... [2]
\bTABLEhead
  \bTR
\bTH a\eTH
\bTH b\eTH
  \eTR
\eTABLEhead
\bTABLEbody
  \bTR
\bTD a\eTD
\bTD b\eTD
  \eTR
\eTABLEbody
  \eTABLE
}

\starttext
  No column specification: \DoTable{}

  With column specification: \DoTable{2}
\stoptext


The problem is that row #1 should be mid-aligned in all columns. So I wrote:


\setupTABLE[column][2][align=flushright] % Column #2 has its own 
alignment...
\setupTABLE[row][1][align=middle] % ... but overwrite here for the whole 
row #1 (including column #2)


But column #2 keeps the previously assigned alignment.

The situation doesn't change even if I swap [1] and [2] (for the case the earlier 
setting, the higher priority).

Moreover, if the column number if not specified (\DoTable{}), the row setting 
overwrites setting for ALL columns; so only if the column is specified 
precisely, its setting is kept.

So how to overwrite row #1 setting globally?

And how setting priorities are evaluated? I guessed the later specification, 
the higher weight (which would allow overwriting)...

Note that in the example it would be possible to specify settings for each 
row/column, but it not useful way in the case of more/very complicated tables.

TIA.

Best regards,

Lukas


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

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

t-TabAli.mkiv
Description: Binary data


t-TabAli.pdf
Description: Adobe PDF document
___
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
___

Re: [NTG-context] TABLE and row/column align settings

2012-10-03 Thread Wolfgang Schuster

Am 03.10.2012 um 10:16 schrieb Procházka Lukáš Ing. - Pontex s. r. o. 
l...@pontex.cz:

 Hello,
 
 I have a complicated TABLE, but I simplified it to the following example:
 
 
 \def\DoTable#1{%
  \bTABLE
\setupTABLE[width=2cm]
\setupTABLE[column][#1][align=flushright] % 
 ... [1]
\setupTABLE[row][1][align=middle] % Settings for ALL columns in the row 1 
 should be overwritten ... [2]
\bTABLEhead
  \bTR
\bTH a\eTH
\bTH b\eTH
  \eTR
\eTABLEhead
\bTABLEbody
  \bTR
\bTD a\eTD
\bTD b\eTD
  \eTR
\eTABLEbody
  \eTABLE
 }
 
 \starttext
  No column specification: \DoTable{}
 
  With column specification: \DoTable{2}
 \stoptext
 
 
 The problem is that row #1 should be mid-aligned in all columns. So I wrote:
 
 
\setupTABLE[column][2][align=flushright] % Column #2 has its own 
 alignment...
\setupTABLE[row][1][align=middle] % ... but overwrite here for the whole 
 row #1 (including column #2)
 
 
 But column #2 keeps the previously assigned alignment.
 
 The situation doesn't change even if I swap [1] and [2] (for the case the 
 earlier setting, the higher priority).
 
 Moreover, if the column number if not specified (\DoTable{}), the row setting 
 overwrites setting for ALL columns; so only if the column is specified 
 precisely, its setting is kept.
 
 So how to overwrite row #1 setting globally?
 
 And how setting priorities are evaluated? I guessed the later specification, 
 the higher weight (which would allow overwriting)...
 
 Note that in the example it would be possible to specify settings for each 
 row/column, but it not useful way in the case of more/very complicated tables.

\def\DoTable
  {\dosingleempty\DodoTable}

\def\DodoTable[#1]%
  {\bgroup
   \setupTABLE[width=2cm]%
   \doifsomething{#1}{\setupTABLE[column][#1][align=flushright]}%
   \setupTABLE[header][align=middle]%
   \bTABLE
 \bTABLEhead
   \bTR
 \bTH a\eTH
 \bTH b\eTH
   \eTR
 \eTABLEhead
 \bTABLEbody
   \bTR
 \bTD a\eTD
 \bTD b\eTD
   \eTR
 \eTABLEbody
   \eTABLE
   \egroup}

\starttext

No column specification: \DoTable

With column specification: \DoTable[2]

\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
___


Re: [NTG-context] TABLE and row/column align settings

2012-10-03 Thread Procházka Lukáš Ing . - Pontex s . r . o .

... Thanks for the answer but -

- I generated a macro just do demonstrate different behavior in row #1 depending on whether 
settings for columns were specified for a PARTICULAR column 
(\setupTABLE[column][2][...]) or for columns IN GENERAL 
(\setupTABLE[column][][...]).

I need the case with a particular column settings to work:


\starttext
  \bTABLE
\setupTABLE[width=2cm]
\setupTABLE[column][2][align=flushright]
\setupTABLE[row][1][align=middle] % Settings for ALL columns in the row 1 
should be overwritten; but are not (?!)
\bTABLEhead[align=middle]
  \bTR
\bTH[align=middle] a\eTH
\bTH[align=middle] b\eTH
  \eTR
\eTABLEhead
\bTABLEbody
  \bTR
\bTD a\eTD
\bTD b\eTD
  \eTR
\eTABLEbody
  \eTABLE
\stoptext


You can see that \setupTABLE[row][1][align=middle] doesn't affect column #2, which 
keeps its previously setting \setupTABLE[column][2][align=flushright]; this is unwanted.

I'd need \setupTABLE[row][1][align=middle] to overwrite the column #2 
setting, so that all columns in the row #1 be mid-aligned.

Lukas


On Wed, 03 Oct 2012 10:53:39 +0200, Wolfgang Schuster 
wolfgang.schus...@gmail.com wrote:



Am 03.10.2012 um 10:16 schrieb Procházka Lukáš Ing. - Pontex s. r. o. 
l...@pontex.cz:


Hello,

I have a complicated TABLE, but I simplified it to the following example:


\def\DoTable#1{%
 \bTABLE
   \setupTABLE[width=2cm]
   \setupTABLE[column][#1][align=flushright] % 
... [1]
   \setupTABLE[row][1][align=middle] % Settings for ALL columns in the row 1 
should be overwritten ... [2]
   \bTABLEhead
 \bTR
   \bTH a\eTH
   \bTH b\eTH
 \eTR
   \eTABLEhead
   \bTABLEbody
 \bTR
   \bTD a\eTD
   \bTD b\eTD
 \eTR
   \eTABLEbody
 \eTABLE
}

\starttext
 No column specification: \DoTable{}

 With column specification: \DoTable{2}
\stoptext


The problem is that row #1 should be mid-aligned in all columns. So I wrote:


   \setupTABLE[column][2][align=flushright] % Column #2 has its own alignment...
   \setupTABLE[row][1][align=middle] % ... but overwrite here for the whole row 
#1 (including column #2)


But column #2 keeps the previously assigned alignment.

The situation doesn't change even if I swap [1] and [2] (for the case the earlier 
setting, the higher priority).

Moreover, if the column number if not specified (\DoTable{}), the row setting 
overwrites setting for ALL columns; so only if the column is specified 
precisely, its setting is kept.

So how to overwrite row #1 setting globally?

And how setting priorities are evaluated? I guessed the later specification, 
the higher weight (which would allow overwriting)...

Note that in the example it would be possible to specify settings for each 
row/column, but it not useful way in the case of more/very complicated tables.


\def\DoTable
  {\dosingleempty\DodoTable}

\def\DodoTable[#1]%
  {\bgroup
   \setupTABLE[width=2cm]%
   \doifsomething{#1}{\setupTABLE[column][#1][align=flushright]}%
   \setupTABLE[header][align=middle]%
   \bTABLE
 \bTABLEhead
   \bTR
 \bTH a\eTH
 \bTH b\eTH
   \eTR
 \eTABLEhead
 \bTABLEbody
   \bTR
 \bTD a\eTD
 \bTD b\eTD
   \eTR
 \eTABLEbody
   \eTABLE
   \egroup}

\starttext

No column specification: \DoTable

With column specification: \DoTable[2]

\stoptext

Wolfgang



--
Ing. Lukáš Procházka [mailto:l...@pontex.cz]
Pontex s. r. o.  [mailto:pon...@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
___


Re: [NTG-context] TABLE and row/column align settings

2012-10-03 Thread Wolfgang Schuster

Am 03.10.2012 um 11:11 schrieb Procházka Lukáš Ing. - Pontex s. r. o. 
l...@pontex.cz:

 ... Thanks for the answer but -
 
 - I generated a macro just do demonstrate different behavior in row #1 
 depending on whether settings for columns were specified for a PARTICULAR 
 column (\setupTABLE[column][2][...]) or for columns IN GENERAL 
 (\setupTABLE[column][][...]).
 
 I need the case with a particular column settings to work:
 
 
 \starttext
  \bTABLE
\setupTABLE[width=2cm]
\setupTABLE[column][2][align=flushright]
\setupTABLE[row][1][align=middle] % Settings for ALL columns in the row 1 
 should be overwritten; but are not (?!)
\bTABLEhead[align=middle]
  \bTR
\bTH[align=middle] a\eTH
\bTH[align=middle] b\eTH
  \eTR
\eTABLEhead
\bTABLEbody
  \bTR
\bTD a\eTD
\bTD b\eTD
  \eTR
\eTABLEbody
  \eTABLE
 \stoptext
 
 
 You can see that \setupTABLE[row][1][align=middle] doesn't affect column 
 #2, which keeps its previously setting 
 \setupTABLE[column][2][align=flushright]; this is unwanted.
 
 I'd need \setupTABLE[row][1][align=middle] to overwrite the column #2 
 setting, so that all columns in the row #1 be mid-aligned.

The \setupTABLE calls do only store the settings but the values are used later 
when each cell is formatted
and at this step row settings are processed before column settings but when you 
want a different format
for the header you can use \setupTABLE[header][…] which has a higher priority 
than these two setups.

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
___

[NTG-context] Long table centered on every page

2012-09-20 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello

how to center a table over several pages?

Suppose the following code:


\def\TAB{%
  \bTABLE[split=repeat]
\bTABLEhead
  \bTR
\bTH head1 \eTH
  \eTR
\eTABLEhead
%
\bTABLEbody
  \dorecurse{40}{%
\bTR
  \bTD body \eTD
\eTR
  }
\eTABLEbody
  \eTABLE
}

\starttext
  Table 1:

  \midaligned{\TAB}

  \page
  Table 2:

  \startalignment[middle]
%\dontleavehmode%
\TAB
  \stopalignment
\stoptext


Table 1 is centered in the page, however both parts of the table are placed 
next to each other (unwanted).

If I use \startalignment instead \midaligned (table 2), the table is not 
centered on the page (also unwanted), even if I uncomment the \dontleavehmode.

So - how to center a long table on every page it is printed on?

TIA.

Lukas


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

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

t-LongTab.mkiv
Description: Binary data


t-LongTab.pdf
Description: Adobe PDF document
___
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
___

Re: [NTG-context] Long table centered on every page

2012-09-20 Thread Wolfgang Schuster

Am 20.09.2012 um 09:26 schrieb Procházka Lukáš Ing. - Pontex s. r. o. 
l...@pontex.cz:

 Hello
 
 how to center a table over several pages?
 
 Suppose the following code:
 
 
 \def\TAB{%
  \bTABLE[split=repeat]
\bTABLEhead
  \bTR
\bTH head1 \eTH
  \eTR
\eTABLEhead
%
\bTABLEbody
  \dorecurse{40}{%
\bTR
  \bTD body \eTD
\eTR
  }
\eTABLEbody
  \eTABLE
 }
 
 \starttext
  Table 1:
 
  \midaligned{\TAB}
 
  \page
  Table 2:
 
  \startalignment[middle]
%\dontleavehmode%
\TAB
  \stopalignment
 \stoptext
 
 
 Table 1 is centered in the page, however both parts of the table are placed 
 next to each other (unwanted).
 
 If I use \startalignment instead \midaligned (table 2), the table is not 
 centered on the page (also unwanted), even if I uncomment the \dontleavehmode.
 
 So - how to center a long table on every page it is printed on?

Use \placetable[force]{}{…} and omit the caption with the “none” keyword when 
you don’t want it.

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
___

Re: [NTG-context] Long table centered on every page

2012-09-20 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

On Thu, 20 Sep 2012 15:51:23 +0200, Wolfgang Schuster 
wolfgang.schus...@gmail.com wrote:



Use \placetable[force]{}{…} and omit the caption with the “none” keyword when 
you don’t want it.

WOlfgang


did you mean this?


\def\TAB{%
  \bTABLE[split=repeat]
\bTABLEhead
  \bTR
\bTH head1 \eTH
  \eTR
\eTABLEhead
%
\bTABLEbody
  \dorecurse{40}{%
\bTR
  \bTD body \eTD
\eTR
  }
\eTABLEbody
  \eTABLE
}

\starttext
  \placetable[force,none]{}{\TAB}
\stoptext


- But this long table is not split to more pages! - See the attachment...

Lukas


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

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

t-LongTab.mkiv
Description: Binary data


t-LongTab.pdf
Description: Adobe PDF document
___
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
___

Re: [NTG-context] Long table centered on every page

2012-09-20 Thread Wolfgang Schuster

Am 20.09.2012 um 16:26 schrieb Procházka Lukáš Ing. - Pontex s. r. o. 
l...@pontex.cz:

 Hello,
 
 On Thu, 20 Sep 2012 15:51:23 +0200, Wolfgang Schuster 
 wolfgang.schus...@gmail.com wrote:
 
 
 Use \placetable[force]{}{…} and omit the caption with the “none” keyword 
 when you don’t want it.
 
 WOlfgang
 
 did you mean this?
 
 
 \def\TAB{%
  \bTABLE[split=repeat]
\bTABLEhead
  \bTR
\bTH head1 \eTH
  \eTR
\eTABLEhead
%
\bTABLEbody
  \dorecurse{40}{%
\bTR
  \bTD body \eTD
\eTR
  }
\eTABLEbody
  \eTABLE
 }
 
 \starttext
  \placetable[force,none]{}{\TAB}
 \stoptext
 
 
 - But this long table is not split to more pages! - See the attachment…


You need also the “split” keyword for the float.

\starttext

\startplacetable[location={force,split,none}]
 \bTABLE[split=repeat]
   \bTABLEhead
 \bTR
   \bTH head1 \eTH
 \eTR
   \eTABLEhead
   %
   \bTABLEbody
 \dorecurse{40}{%
   \bTR
 \bTD body \eTD
   \eTR
 }
   \eTABLEbody
 \eTABLE
\stopplacetable

\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
___


Re: [NTG-context] Long table centered on every page

2012-09-20 Thread Procházka Lukáš Ing . - Pontex s . r . o .

You need also the “split” keyword for the float.

\starttext

\startplacetable[location={force,split,none}]
 \bTABLE[split=repeat]
   \bTABLEhead
 \bTR
   \bTH head1 \eTH
 \eTR
   \eTABLEhead
   %
   \bTABLEbody
 \dorecurse{40}{%
   \bTR
 \bTD body \eTD
   \eTR
 }
   \eTABLEbody
 \eTABLE
\stopplacetable

\stoptext

Wolfgang


... That's it. Thank you, Wolfgang!

Best regards,

Lukas


--
Ing. Lukáš Procházka [mailto:l...@pontex.cz]
Pontex s. r. o.  [mailto:pon...@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
___

[NTG-context] Luatex crash with x86-64 Linux binary

2012-09-10 Thread Brian R. Landy
[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23][5][topframe=on]%
\setupTABLE[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23][19,19][bottomframe=on]%
\setupTABLE[3][4,3,2,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=on]%
\setupTABLE[23][4,3,2,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][rightframe=on]%
\setupTABLE[21][3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=on]%
\setupTABLE[21][3][rightframe=on]%
\setupTABLE[20][3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=on]%
\setupTABLE[16][3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=on]%
\setupTABLE[15][3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=on]%
\setupTABLE[14][3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=on]%
\setupTABLE[13][3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=on]%
\setupTABLE[12][3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=on]%
\setupTABLE[10][3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=on]%
\setupTABLE[9][3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=on]%
\setupTABLE[8][3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=on]%
\setupTABLE[6][3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=on]%
\setupTABLE[5][3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=on]%
\setupTABLE[4][3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=on]%
\setupTABLE[16][2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=on]%
\setupTABLE[16][2][rightframe=on]%
\setupTABLE[9][2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=on]%
\setupTABLE[8][2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=on]%
\setupTABLE[4][2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=on]%
\setupTABLE[8][4,3,2][headstyle={\smaller\bf}]%
\setupTABLE[1,2][5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][align={high,middle}]%
\setupTABLE[3][5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][align={high,flushleft},aligncharacter=no]%
\setupTABLE[1,2,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22][4,3,2,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][rightframe=off]%
\setupTABLE[2,3,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20,21,22,23][4,3,2,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19][leftframe=off]%
\setupTABLE[16][2][rightframe=on]%
\setupTABLE[21][3][rightframe=on]%
\setupTABLE[16,17,18,19,20,21,22,23][3,4][align=flushleft]%
\setupTABLE[1][1][align={flushleft}]%
\setupTABLE[c][1][width=0.28125in]%
\setupTABLE[c][2][width=0.37500in]%
\setupTABLE[c][3][width=0.6in]%
\setupTABLE[c][4][width=0.56250in]%
\setupTABLE[c][5][width=0.34375in]%
\setupTABLE[c][6][width=0.34375in]%
\setupTABLE[c][7][width=0.37500in]%
\setupTABLE[c][8][width=0.25000in]%
\setupTABLE[c][9,10][width=0.31250in]%
\setupTABLE[c][11][width=0.40625in]%
\setupTABLE[c][12,13,14][width=0.375in]%
\setupTABLE[c][15][width=0.28125in]%
\setupTABLE[c][16,17,18,19,20,21,22,23][width=0.30in]%
\setupTABLE[c][20][width=0.10in]%
\bTABLE[left=\setupinterlinespace\strut,right=\strut,strut=no,autostrut=no,frame=off,offset=0.15ex,headstyle={\switchtobodyfont[modern,rm]\bf},align={middle,lohi},excelalign={flushright,lohi},alignmentcharacter={.},aligncharacter=yes,background=color,backgroundcolor=none]%
\bTABLEhead%
\bTR%
\bTH[nc=23]{\setupinterlinespace\strut Freddie Mac Fixed 30yr 
3.0\strut\par}\eTH%
\eTR%
\bTR%
\bTH[]{\setupinterlinespace\strut \strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut \strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut \strut\par}\eTH%
\bTH[nc=4]{\setupinterlinespace\strut \strut\par}\eTH%
\bTH[nr=3]{\setupinterlinespace\strut W\par A\par L\par A\strut\par}\eTH%
\bTH[nc=7]{\setupinterlinespace\strut \strut\par}\eTH%
\bTH[nc=8]{\setupinterlinespace\strut CBR\strut\par}\eTH%
\eTR%
\bTR%
\bTH[]{\setupinterlinespace\strut \strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut Iss\strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut \strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut CBal\strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut Fac-\strut\par}\eTH%
\bTH[nc=2]{\setupinterlinespace\strut \strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut Orig\strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut Curr\strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut Curr\strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut Orig\strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut MTM\strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut Orig\strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut \%\strut\par}\eTH%
\bTH[nc=4]{\setupinterlinespace\strut 2012\strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut \strut\par}\eTH%
\bTH[nc=3]{\setupinterlinespace\strut Hist. Horizon\strut\par}\eTH%
\eTR%
\bTR%
\bTH[]{\setupinterlinespace\strut Cpn\strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut Year\strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut Collat\strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut \textdollar mm\strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut tor\strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut WAC\strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut WAM\strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut ALS\strut\par}\eTH%
\bTH[]{\setupinterlinespace\strut ALS\strut

[NTG-context] TABLE lines (frame)

2012-06-12 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

I'd need to create table with a head and a body, and with horizontal lines 
between rows disabled, excluding the head.

Something like (ASCII art trial):

+--+--+
| Head | Head |
+--+--+   - Line here bellow the head is wanted (and can be thicker 
than the outer lines)...
| 11   | 12   |
|  |  |   - ... but no horizontal line between body's rows.
| 21   | 22   |
+--+--+

I played with *frame settings (guided by wiki), but no success.

My trial code:


\starttext
  
\bTABLE[split=repeat,option=stretch,align=middle,frame=off,leftframe=on,rightframe=on]
\bTABLEhead[bottomframe=on]
  \bTR\bTD Head \eTD\eTR
  \bTR\bTD Head \eTD\eTR
\eTABLEhead
\bTABLEbody
  \bTR\bTD 11\eTD\bTD 12\eTD\eTR
  \bTR\bTD 21\eTD\bTD 22\eTD\eTR
\eTABLEbody
  \eTABLE
\stoptext


How to specify rules (frame) to get the desired look?

TIA.

Kind regards,

Lukas


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

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

t-TAB.mkiv
Description: Binary data


t-TAB.pdf
Description: Adobe PDF document
___
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
___

Re: [NTG-context] TABLE lines (frame)

2012-06-12 Thread luigi scarso
On Tue, Jun 12, 2012 at 5:12 PM, Procházka Lukáš Ing. - Pontex s. r.
o. l...@pontex.cz wrote:
 Hello,

 I'd need to create table with a head and a body, and with horizontal lines
 between rows disabled, excluding the head.

 Something like (ASCII art trial):

 +--+--+
 | Head | Head |
 +--+--+   - Line here bellow the head is wanted (and can be thicker
 than the outer lines)...
 | 11   | 12   |
 |      |      |   - ... but no horizontal line between body's rows.
 | 21   | 22   |
 +--+--+

 I played with *frame settings (guided by wiki), but no success.

 My trial code:

 
 \starttext
  \bTABLE[split=repeat,option=stretch,align=middle,frame=off,leftframe=on,rightframe=on]
    \bTABLEhead[bottomframe=on]
      \bTR\bTD Head \eTD\eTR
      \bTR\bTD Head \eTD\eTR
    \eTABLEhead
    \bTABLEbody
      \bTR\bTD 11\eTD\bTD 12\eTD\eTR
      \bTR\bTD 21\eTD\bTD 22\eTD\eTR
    \eTABLEbody
  \eTABLE
 \stoptext
 

 How to specify rules (frame) to get the desired look?

 TIA.

 Kind regards,

 Lukas

Hm, your ascii-art and the tex code don't match very well (you have
one head-row on ascii, but two head-rows on tex)
This is quite similar to your ascii-art:

\starttext
 
\bTABLE[split=repeat,option=stretch,align=middle,frame=off,leftframe=on,rightframe=on]
   \bTABLEhead
% \bTR\bTD Head \eTD\eTR
 \bTR[bottomframe=on,topframe=on]\bTD Head \eTD\bTD Head \eTD\eTR
   \eTABLEhead
   \bTABLEbody
 \bTR\bTD 11\eTD\bTD 12\eTD\eTR
 \bTR[bottomframe=on]\bTD 21\eTD\bTD 22\eTD\eTR
   \eTABLEbody
 \eTABLE
\stoptext

-- 
luigi
___
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
___

Re: [NTG-context] TABLE lines (frame)

2012-06-12 Thread Wolfgang Schuster

Am 12.06.2012 um 17:12 schrieb Procházka Lukáš Ing. - Pontex s. r. o.:

 Hello,
 
 I'd need to create table with a head and a body, and with horizontal lines 
 between rows disabled, excluding the head.
 
 Something like (ASCII art trial):
 
 +--+--+
 | Head | Head |
 +--+--+   - Line here bellow the head is wanted (and can be thicker 
 than the outer lines)...
 | 11   | 12   |
 |  |  |   - ... but no horizontal line between body's rows.
 | 21   | 22   |
 +--+--+
 
 I played with *frame settings (guided by wiki), but no success.
 
 My trial code:
 
 
 \starttext
  
 \bTABLE[split=repeat,option=stretch,align=middle,frame=off,leftframe=on,rightframe=on]
\bTABLEhead[bottomframe=on]
  \bTR\bTD Head \eTD\eTR
  \bTR\bTD Head \eTD\eTR
\eTABLEhead
\bTABLEbody
  \bTR\bTD 11\eTD\bTD 12\eTD\eTR
  \bTR\bTD 21\eTD\bTD 22\eTD\eTR
\eTABLEbody
  \eTABLE
 \stoptext
 
 
 How to specify rules (frame) to get the desired look?

\starttext

\setupTABLE[start][frame=off,leftframe=on,rightframe=on]
\setupTABLE[header][frame=on]
\setupTABLE[row][first][topframe=on]
\setupTABLE[row][last][bottomframe=on]


\bTABLE[split=repeat,option=stretch]
  \bTABLEhead
\bTR\bTD Head \eTD\bTD Head \eTD\eTR
  \eTABLEhead
  \bTABLEbody
\bTR\bTD 11\eTD\bTD 12\eTD\eTR
\bTR\bTD 21\eTD\bTD 22\eTD\eTR
  \eTABLEbody
\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
___


Re: [NTG-context] TABLE lines (frame)

2012-06-12 Thread Procházka Lukáš Ing . - Pontex s . r . o .

... OK, this seems good.

Actually, I need multi-line header, so two more questions:

1) Is there a way how to address rows (first, last) of the header part? 
Something like:

  \setupTABLE[header][r][1][topframe=on]
  \setupTABLE[header][r][last][bottomframe=on]

  - When I'd like to draw a line bellow the last row of the head, I have to set 
\setupTABLE[r][x][bottomframe=on] so far, where x means the number of the 
last head row. So I'm looking for a way to address the last header row WITHOUT knowing its number.

2) How to make Ctx draw the line bellow the last row printed on a page, when the table is 
continued on the next page and bottomframe (of the whole table) is on? - See 
the bottom of table on the page 1, continued on the next page.

Lukas


On Tue, 12 Jun 2012 17:41:00 +0200, Wolfgang Schuster 
schuster.wolfg...@googlemail.com wrote:


\starttext
\setupTABLE[start][frame=off,leftframe=on,rightframe=on]
\setupTABLE[header][frame=on]
\setupTABLE[row][first][topframe=on]
\setupTABLE[row][last][bottomframe=on]
\bTABLE[split=repeat,option=stretch]
  \bTABLEhead
\bTR\bTD Head \eTD\bTD Head \eTD\eTR
  \eTABLEhead
  \bTABLEbody
\bTR\bTD 11\eTD\bTD 12\eTD\eTR
\bTR\bTD 21\eTD\bTD 22\eTD\eTR
  \eTABLEbody
\eTABLE
\stoptext



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

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

t-TAB2.mkiv
Description: Binary data


t-TAB2.pdf
Description: Adobe PDF document
___
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
___

[NTG-context] TABLE with split=repeat and headings

2012-03-22 Thread Andreas Schneider
Hello,

I  have several natural tables with the split=repeat option set. Those
tables  are  directly  after  a  subsubsubject.  Every now and then it
happens,  that  the  heading stays on the previous page (as last line)
and the table slips to the next page.

Without  split=repeat  it  correctly takes the header to the next page
too. Can I consider this a bug or am I doing something wrong?

The attached example demonstrates this problem.

Testet with
ConTeXt  ver: 2012.01.02 21:59 MKIV  fmt: 2012.1.24  int: english/english

and
201200310 13:15 MKIV

-- 
Best Regards,
Andreas\starttext
\dorecurse{35}{some text some text some text some text some text\crlf}
\subsubsubject{Some Table}
\bTABLE[split=repeat]
\bTABLEhead 
\bTR \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \eTR
\eTABLEhead 
\bTABLEbody
\bTR \bTD foo \eTD \bTD bar \eTD \bTD \eTD \eTR
\bTR \bTD test \eTD \bTD test \eTD \bTD test \eTD \eTR
\eTABLEbody
\eTABLE
\stoptext

pgpn7ojpq9pjH.pgp
Description: PGP signature
___
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
___

[NTG-context] Styling of naturaltable headings

2012-03-15 Thread Steffen Fritzsche
Hi,

using the latest beta I have the following problem styling my table headings 
based on the naturaltables module. My test document looks as follows

\setupTABLE[frame=off,option=stretch]
\setupTABLE[c][each][style=\ss]% Styling 1
\setupTABLE[r][first][style={\ss},bottomframe=on]  % Styling 2

\starttext
\placetable
 [here][tab:example]
 {A very simple example of a table.}{
 \bTABLE
 \bTABLEhead
   \bTR
 \bTH col1 \eTH
 \bTH col2 \eTH
   \eTR 
 \eTABLEhead
 \bTABLEbody
   \bTR
 \bTC this \eTC
 \bTC is   \eTC
   \eTR
   \bTR
 \bTC a \eTC
 \bTC table \eTC
   \eTR
 \eTABLEbody
 \eTABLE
 }
\stoptext

Neither the line marked Styling 1 nor the line marked Styling 2 do switch 
to a sans serif font in the table head. Styling 1 does this correctly for the 
table body but not for the head.

Any ideas how I might get an sans serif font in my table heading?

Thanks!

Steffen

smime.p7s
Description: S/MIME cryptographic signature
___
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
___

Re: [NTG-context] Styling of naturaltable headings

2012-03-15 Thread Wolfgang Schuster

Am 15.03.2012 um 14:31 schrieb Steffen Fritzsche:

 Hi,
 
 using the latest beta I have the following problem styling my table headings 
 based on the naturaltables module. My test document looks as follows
 
 \setupTABLE[frame=off,option=stretch]
 \setupTABLE[c][each][style=\ss]% Styling 1
 \setupTABLE[r][first][style={\ss},bottomframe=on]  % Styling 2
 
 \starttext
 \placetable
 [here][tab:example]
 {A very simple example of a table.}{
 \bTABLE
 \bTABLEhead
   \bTR
 \bTH col1 \eTH
 \bTH col2 \eTH
   \eTR 
 \eTABLEhead
 \bTABLEbody
   \bTR
 \bTC this \eTC
 \bTC is   \eTC
   \eTR
   \bTR
 \bTC a \eTC
 \bTC table \eTC
   \eTR
 \eTABLEbody
 \eTABLE
 }
 \stoptext
 
 Neither the line marked Styling 1 nor the line marked Styling 2 do switch 
 to a sans serif font in the table head. Styling 1 does this correctly for 
 the table body but not for the head.
 
 Any ideas how I might get an sans serif font in my table heading?

\setupTABLE[header][each][style=sans]

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
___


Re: [NTG-context] Styling of naturaltable headings

2012-03-15 Thread Wolfgang Schuster

Am 15.03.2012 um 15:25 schrieb Steffen Fritzsche:

 
 Am 15.03.2012 um 14:49 schrieb Wolfgang Schuster:
 Any ideas how I might get an sans serif font in my table heading?
 
 \setupTABLE[header][each][style=sans]
 
 Thanks for your answer, but this does not work for me. I changed my 
 definition to
 
 \setupTABLE[frame=off,option=stretch] 

 \setupTABLE[c][each][style=\ss]   

 \setupTABLE[header][each][style=sans,background=color,backgroundcolor=gray]
 
 While this gives me a nice gray background, it still uses a serif font. Since 
 the background is applied I guess it somehow drops anything which is defined 
 as style.
 
 Any other ideas or is this a bug?

Don’t use \bTH when you use put the header in a \bTABLEhead … \eTABLEhead block 
because the \bTH command applies a format the the cells, when you use \bTD 
instead no formatting is applied and the \setupTABLE setting is used.

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
___


Re: [NTG-context] Styling of naturaltable headings

2012-03-15 Thread Steffen Fritzsche
Am 15.03.2012 um 15:36 schrieb Wolfgang Schuster:
 Don’t use \bTH when you use put the header in a \bTABLEhead … \eTABLEhead 
 block because the \bTH command applies a format the the cells, when you use 
 \bTD instead no formatting is applied and the \setupTABLE setting is used.

Thanks Wolfgang, this gives me the desired result.

I used TH because the wiki states on should use TH not TC when inside a 
TABLEhead, see

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

However, I wasn't aware that one might use TD inside a TABLEhead.

Steffen



smime.p7s
Description: S/MIME cryptographic signature
___
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
___

Re: [NTG-context] Styling of naturaltable headings

2012-03-15 Thread Wolfgang Schuster

Am 15.03.2012 um 15:59 schrieb Steffen Fritzsche:

 Am 15.03.2012 um 15:36 schrieb Wolfgang Schuster:
 Don’t use \bTH when you use put the header in a \bTABLEhead … \eTABLEhead 
 block because the \bTH command applies a format the the cells, when you use 
 \bTD instead no formatting is applied and the \setupTABLE setting is used.
 
 Thanks Wolfgang, this gives me the desired result.
 
 I used TH because the wiki states on should use TH not TC when inside a 
 TABLEhead, see
 
 http://wiki.contextgarden.net/TABLE#Multipage_TABLEs
 
 However, I wasn't aware that one might use TD inside a TABLEhead.

The \bTH command is only a modified version of \bTD which uses
a different color and style for the content and disables the aligncharacter
option (which can be used to align numbers on “.” or “,” etc.).

The style and color of \bTH can be changed with the “headstyle” and
“headcolor” keys but for long tables with \bTABLEhead etc. \bTD with
a special setting for the header does the same.

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
___


[NTG-context] \placelist summary alternative solution

2011-12-14 Thread Felix Ingram
I've ended up delving into the dark art that is Lua for this solution:

\define[0]\SummaryTable{%
\placetable[force, none]{}{%
\setupTABLE[frame=off]
\bTABLE
\bTABLEhead
\bTR\bTH Reference\eTH\bTH Title\eTH\bTH Page\eTH\eTR
\eTABLEhead
\bTABLEbody
\startluacode
for k, v in ipairs(structures.lists.collected) do
if v.metadata.kind == section and v.metadata.name == section then
context.bTR()
context.bTD()
context(REFREF)
context.eTD()
context.bTD()
context(v.titledata.title)
context.eTD()
context.bTD()
context(v.references.realpage)
context.eTD()
context.eTR()
end
end
\stopluacode%
\eTABLEbody
\eTABLE
}%
}%
\starttext
\section{Test}
\input{knuth}
\section{Test}
\input{knuth}
\section{Test}
\input{knuth}
\section{Test}
\input{knuth}
\section{Test}
\input{knuth}
\section{Test}
\input{knuth}
\section{Test}
\input{knuth}
\SummaryTable
\stoptext

This works to some degree though I have the following questions about it:

1. Is there a way to access a document global variable from Lua? I
will use this to replace the REFREF text.

2. v.references.realpage isn't the actual page of the title. How can I
access the page number that would have appeared in the ToC? (I've
restarted the page numbering in my master doc, the above example works
fine)

3. Is there a way to store some metadata along with my title? I'd like
something similar to this:
\myheader[author=me, date=2011-12-14]{This is my header with meta-data}
and then be able to access it from Lua again.

Thanks for any help you can give with this.

Felix
___
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
___


Re: [NTG-context] \placelist summary alternative solution

2011-12-14 Thread Hans Hagen

On 14-12-2011 17:50, Felix Ingram wrote:

I've ended up delving into the dark art that is Lua for this solution:

\define[0]\SummaryTable{%
\placetable[force, none]{}{%
\setupTABLE[frame=off]
\bTABLE
\bTABLEhead
\bTR\bTH Reference\eTH\bTH Title\eTH\bTH Page\eTH\eTR
\eTABLEhead
\bTABLEbody
\startluacode
 for k, v in ipairs(structures.lists.collected) do
 if v.metadata.kind == section and v.metadata.name == section then
 context.bTR()
 context.bTD()
 context(REFREF)
 context.eTD()
 context.bTD()
 context(v.titledata.title)
 context.eTD()
 context.bTD()
 context(v.references.realpage)
 context.eTD()
 context.eTR()
 end
 end
\stopluacode%
\eTABLEbody
\eTABLE
}%
}%
\starttext
\section{Test}
\input{knuth}
\section{Test}
\input{knuth}
\section{Test}
\input{knuth}
\section{Test}
\input{knuth}
\section{Test}
\input{knuth}
\section{Test}
\input{knuth}
\section{Test}
\input{knuth}
\SummaryTable
\stoptext

This works to some degree though I have the following questions about it:

1. Is there a way to access a document global variable from Lua? I
will use this to replace the REFREF text.


\startluacode

document.myvariables = { }

document.myvariables.whatever = SOME TEXT

\stopluacode

...

context(document.myvariables.whatever)


2. v.references.realpage isn't the actual page of the title. How can I
access the page number that would have appeared in the ToC? (I've
restarted the page numbering in my master doc, the above example works
fine)


as you're looking into the code ... search for helpers like

lists.prefixedpage

keep in mind that this is not yet an official api (although it will 
probably stay this way)





3. Is there a way to store some metadata along with my title? I'd like
something similar to this:
\myheader[author=me, date=2011-12-14]{This is my header with meta-data}
and then be able to access it from Lua again.


it's called userdata (third argument to \startchapter etc) .. it travels 
with the rest


Hans



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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
___


Re: [NTG-context] Splitting natural tables

2011-11-30 Thread Christian
  Hello,
 
  is it still not possible to split a table so that it covers one half
  page an then
  another half page?
 
  It is my understanding that splitting moves the table to the next
  page and
  then splits it to the following if it gets too long for one entire page.
  Would a manual split be possible?
 
  Examle (table is not split, but could be):
 
  \starttext
  \dorecurse{2}{\input knuth }
  \startplacetable[title={My Table}]
 
  \startplacetable[location=split,title={My table}] … \stopplacetable
 
  Thank you Wolfgang!
  For some reason I thought the option split=yes would trigger
  splitting…
 
 The “split=yes” option works only for table which aren’t aren't placed as 
 float
 because this mechanism has to know that it has to break the table into parts
 but then you don’t need the split key for \bTABLE.
 
  Now in the sample document I get table 1a and table 1b.
  In my real document I get table 3.2 and table 3.3. Is there a way to
  influence this? (btw. captions are above the table, if that matters)
 
 The location of the caption doesn’t matter. The number of the suffix for the
 subtables can be changed but without a example I can’t tell why you get
 different results in your example and in the real document.

My guess: It's because fo thecustom suffix. Example:

\setupcaption[table][location=top]
\setupcaptions[minwidth=\textwidth,width=fit,align=center,headstyle={\ss 
\tfx},style={\ss \tfx 
\setupinterlinespace[line=1.4em]},suffix={:},distance=.5em]
\starttext
\startchapter[title=Chapter]
\startsection[title=section]
\dorecurse{2}{\input knuth }
\startplacetable[title={My Table},location=split]
\bTABLE[option=stretch]
\bTABLEhead
\bTR
\bTH C1 \eTH
\bTH C2 \eTH
\eTR
\eTABLEhead
\bTABLEbody
\dorecurse{20}{\bTR
\bTD text \eTD
\bTD text \eTD
\eTR}
\eTABLEbody 
\eTABLE
\stopplacetable
\input knuth
\stopsection
\stopchapter
\stoptext

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

Re: [NTG-context] Splitting natural tables

2011-11-30 Thread Christian
  @Hans: Can you make this change in strc-flt.mkvi?
 
  \unexpanded\def\thecurrentfloatnumbersuffix
 {\doifsomething{\floatcaptionparameter\c!suffix}
{\floatcaptionparameter\c!suffixseparator
  % \floatcaptionparameter\c!suffix}}
 \floatcaptionparameter\c!suffix
 \floatcaptionparameter\c!suffixstopper}}
 
 sure

I'm sorry to press the issue, but is there a quick fix for the numbering issue? 
(where the second part of the split table gets the number 1.2b instead of 1.1b 
and the next table continues from 1.3 instead of 1.2)

Here's the example:

\setupcaption[table][location=top]
\setuplabeltext[table={Tabelle ,:}]
\starttext
\startchapter[title=Chapter]
\startsection[title=section]
\dorecurse{2}{\input knuth }
\startplacetable[title={My Table},location=split]
\bTABLE[option=stretch]
\bTABLEhead
\bTR
\bTH C1 \eTH
\bTH C2 \eTH
\eTR
\eTABLEhead
\bTABLEbody
\dorecurse{20}{\bTR
\bTD text \eTD
\bTD text \eTD
\eTR}
\eTABLEbody 
\eTABLE
\stopplacetable
\input knuth\par
\startplacetable[title={My other table},location=split]
\bTABLE[option=stretch]
\bTABLEhead
\bTR
\bTH C1 \eTH
\bTH C2 \eTH
\eTR
\eTABLEhead
\bTABLEbody
\dorecurse{5}{\bTR
\bTD text \eTD
\bTD text \eTD
\eTR}
\eTABLEbody 
\eTABLE
\stopplacetable
\stopsection
\stopchapter
\stoptext

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


[NTG-context] Splitting natural tables

2011-11-29 Thread Christian
Hello,

is it still not possible to split a table so that it covers one half page an 
then another half page?

It is my understanding that splitting moves the table to the next page and then 
splits it to the following if it gets too long for one entire page.
Would a manual split be possible?

Examle (table is not split, but could be):

\starttext
\dorecurse{2}{\input knuth }
\startplacetable[title={My Table}]
\bTABLE[option=stretch,split=repeat]
\bTABLEhead
\bTR
\bTH C1 \eTH
\bTH C2 \eTH
\eTR
\eTABLEhead
\bTABLEbody
\dorecurse{20}{\bTR
\bTD text \eTD
\bTD text \eTD
\eTR}
\eTABLEbody 
\eTABLE
\stopplacetable
\input knuth
\stoptext

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


Re: [NTG-context] Table headers and section titles

2011-09-15 Thread Felix Ingram
Some follow up notes in case anyone else is trying to do something similar

On 13 September 2011 15:30, Felix Ingram f.ingram.li...@gmail.com wrote:
 I've had another stab at converting our Word template to Context. I've
 managed to draw some pretty shapes using MetaPost (and I'd like to add
 my +1 for getting some alpha channel support for linear_shade) and I
 got really close to getting my table headings working.

Re: alpha channels - I'm now using TIKZ for the drawing and so this is
now sorted.

 I would like to have a gradient fill that runs the width of the table
 header. The following shows where I've got to:

 %% GRADIENT SETUP
 \definecolor[a][r=0.098039,g=0.223529,b=0.52549]
 \definecolor[b][r=0.098039,g=0.654902,b=0.87]

 \startuniqueMPgraphic{LinearShade}
 path p ;
 p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
 linear_shade(p,5,\MPcolor{a},\MPcolor{b}) ;
 \stopuniqueMPgraphic

 \defineoverlay[shaded][\useMPgraphic{LinearShade}]

 \setupTABLE[row][1][background={shaded},backgroundcolor=blue,foregroundcolor=white]

 \starttext
 \framed[background={shaded}, width=\textwidth, frame=off]{}
 \bTABLE
 \bTABLEhead
 \bTR \bTH 1 \eTH \bTH 1 \eTH \bTH 1 \eTH \bTH 1 \eTH \bTH Page  \eTH \eTR
 \eTABLEhead
 \bTABLEbody
 \bTR \bTD 1 \eTD \bTD 1 \eTD \bTD 1 \eTD \bTD 1 \eTD \bTD 1     \eTD \eTR
 \eTABLEbody
 \eTABLE
 \stoptext


 The output shows a framed element which is similar to what I want to
 achieve and the table shows where I've got to. I believe that there
 are only really two options as to how I can get what I want:

 1. Recalculate the gradient fill for each cell. This will require
 knowing the column width and the ability to change the cell's
 background as appropriate. I have no idea how to do either.
 2. Draw the framed fill to the width of the table and then position it
 behind the table header (which is actually how it gets done in Word).
 However, I don't know how to determine the table width, or how to
 accurately position the frame.

Still no idea about these - I will probably try to draw something with
tikz and then move it. Still not sure how to determine the table
width, but we only have a few tables and they are fairly constant in
size, so I might just fake it.

 The next problem I have is with section headings. For each section
 heading we are required to include a box that contains some meta
 information.
 This is what I have at the moment:

 \setuphead[section][color=blue, aligntitle=float]

 \definefloat[issueinfo][issueinfos] % Define our fancy boxout
 \setupcaption[issueinfo][location=none] % Define our fancy boxout
 \defineframedtext[issueinfo][]

 \starttext

 \section{My section header}
 \placeissueinfo[right, y=-2cm]{}{
 \startissueinfo[width=4cm]
 Ref: ref-1 \par
 a: Medium \par
 b: low \par
 c: 9.0
 \stopissueinfo
 }
 Short loin shank rump pork belly ball tip pig. Spare ribs shank
 tri-tip capicola strip steak. Frankfurter leberkäse filet mignon
 boudin pork belly. Capicola shankle ribeye, hamburger brisket jerky
 rump short ribs turkey ham hock andouille pork chop chicken tongue
 pork belly. Ball tip tongue corned beef shoulder bresaola. Tri-tip
 turducken salami ground round pork. Rump tenderloin pork loin ham hock
 boudin, meatball venison pastrami prosciutto.

 \stoptext

 I'd like to be able to accurately place the box alongside the title
 itself. Ideally I'd like to draw a line under the section header that
 meets the left side of the box as well, though I'll take what I can
 get at this point.

After some careful reading of the Details manual I have something that
I'm fairly happy with.


\definefloat[issueinfo][issueinfos]
\setupcaption[issueinfo][location=none] % Turn off caption
\defineframedtext[issueinfo]
\setupframedtext[issueinfo][
width=4cm, % set the width
frame=on,   % turn on the framw
framecolor=blue,  % colour it
]
\setupfloat[issueinfo]
[
default={inner, height, high, low, none}, % set up padding etc
margin=\structdepth,
rightmargindistance=2cm,
maxwidth=0.5cm,
color=blue,
]

I then place it with the following:

\movesidefloat[-5*line]
\placeissueinfo[right]{}{
\startissueinfo
...
\stopissueinfo

The movesidefloat shifts it up to where I want it to be. The only
issue is that my section headings would overlap the box if the text
was too long, so I redefined the heading like this:

\setuphead[section]
[before=\page,
aligntitle=float, % Redundant I believe, as the next option will
prevent it being required
width=12cm,   % Set the width to something that won't impact our box.
after={{\color[red] \hrule width 125mm \vskip 2em}},
]


The 'after' settings draw the line that I was looking for and 125mm
just happens to bring it to the edge of the box, so I'm a little
happier.

I hope this is useful to someone.

Felix
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl

[NTG-context] Table headers and section titles

2011-09-13 Thread Felix Ingram
Hello all,

I've had another stab at converting our Word template to Context. I've
managed to draw some pretty shapes using MetaPost (and I'd like to add
my +1 for getting some alpha channel support for linear_shade) and I
got really close to getting my table headings working.

I would like to have a gradient fill that runs the width of the table
header. The following shows where I've got to:

%% GRADIENT SETUP
\definecolor[a][r=0.098039,g=0.223529,b=0.52549]
\definecolor[b][r=0.098039,g=0.654902,b=0.87]

\startuniqueMPgraphic{LinearShade}
path p ;
p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
linear_shade(p,5,\MPcolor{a},\MPcolor{b}) ;
\stopuniqueMPgraphic

\defineoverlay[shaded][\useMPgraphic{LinearShade}]

\setupTABLE[row][1][background={shaded},backgroundcolor=blue,foregroundcolor=white]

\starttext
\framed[background={shaded}, width=\textwidth, frame=off]{}
\bTABLE
\bTABLEhead
\bTR \bTH 1 \eTH \bTH 1 \eTH \bTH 1 \eTH \bTH 1 \eTH \bTH Page  \eTH \eTR
\eTABLEhead
\bTABLEbody
\bTR \bTD 1 \eTD \bTD 1 \eTD \bTD 1 \eTD \bTD 1 \eTD \bTD 1 \eTD \eTR
\eTABLEbody
\eTABLE
\stoptext


The output shows a framed element which is similar to what I want to
achieve and the table shows where I've got to. I believe that there
are only really two options as to how I can get what I want:

1. Recalculate the gradient fill for each cell. This will require
knowing the column width and the ability to change the cell's
background as appropriate. I have no idea how to do either.
2. Draw the framed fill to the width of the table and then position it
behind the table header (which is actually how it gets done in Word).
However, I don't know how to determine the table width, or how to
accurately position the frame.

The next problem I have is with section headings. For each section
heading we are required to include a box that contains some meta
information.
This is what I have at the moment:

\setuphead[section][color=blue, aligntitle=float]

\definefloat[issueinfo][issueinfos] % Define our fancy boxout
\setupcaption[issueinfo][location=none] % Define our fancy boxout
\defineframedtext[issueinfo][]

\starttext

\section{My section header}
\placeissueinfo[right, y=-2cm]{}{
\startissueinfo[width=4cm]
Ref: ref-1 \par
a: Medium \par
b: low \par
c: 9.0
\stopissueinfo
}
Short loin shank rump pork belly ball tip pig. Spare ribs shank
tri-tip capicola strip steak. Frankfurter leberkäse filet mignon
boudin pork belly. Capicola shankle ribeye, hamburger brisket jerky
rump short ribs turkey ham hock andouille pork chop chicken tongue
pork belly. Ball tip tongue corned beef shoulder bresaola. Tri-tip
turducken salami ground round pork. Rump tenderloin pork loin ham hock
boudin, meatball venison pastrami prosciutto.

\stoptext

I'd like to be able to accurately place the box alongside the title
itself. Ideally I'd like to draw a line under the section header that
meets the left side of the box as well, though I'll take what I can
get at this point.

I hope the examples make sense. Thanks in advance for any help you can give.

Felix
___
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
___


Re: [NTG-context] Why is the \crlf needed to display the table correctly

2011-08-15 Thread Wolfgang Schuster

Am 15.08.2011 um 22:31 schrieb Cecil Westerhof:

 2011/8/15 Wolfgang Schuster schuster.wolfg...@googlemail.com
  On of the things I need to do for the manual about ConTeXt is a list of the 
  most frequently used commands. I am using some macros to display them 
  correctly in a table. Attached a strange effect I got. The second row is 
  displayed wrongly. The third is the same row, but with a \crlf added. This 
  displays correctly. But I am wondering why it is needed.
 
 Use “align=right” for the first column.
 
 I changed:
 \setupTABLE[c][1][width=.35\textwidth]
 into:
 \setupTABLE[c][1][align=right, width=.35\textwidth]
 
 But it does not change anything. (It is the right place I think, because when 
 using left, or center the formatting changes. But not in a way that is 
 satisfactory. With center the text stays in the box, but not with left and 
 right.)
 
 Also it overrides the:
 \setupTABLE[r][1][align=center, style=bold]
 (The align, not the style.)

Then set the alignment with \bTD in your \StartTable command or just use normal 
table commands.

\startsetups mytable
  \setupTABLE[header][align=middle,style=bold]
  \setupTABLE[start][align=normal]
  \setupTABLE[c][1][align=right,width=.30\textwidth]
  \setupTABLE[c][2][width=.70\textwidth]
\stopsetups

\starttext

\bTABLE[setups=mytable]
\bTABLEhead
\bTR \bTD[nx=2] The most important commands \eTD \eTR
\eTABLEhead
\bTABLEbody
\bTR
  \bTD \type{\completecontent} \eTD
  \bTD This generates a Table of Content. Should be the first statement of a 
document. \eTD
\eTR
\bTR
  \bTD \type{\startchapter[title=chapterName]} \eTD
  \bTD Starts a chapter with the named title. Is ended with 
\type{\stopchapter}. \eTD
\eTR
\bTR
  \bTD \tex{startchapter [title=chapterName]} \eTD % space needed!
  \bTD Starts a chapter with the named title. Is ended with \tex{stopchapter}. 
\eTD
\eTR
\eTABLEbody
\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
___

Re: [NTG-context] Why is the \crlf needed to display the table correctly

2011-08-15 Thread Cecil Westerhof
2011/8/15 Wolfgang Schuster schuster.wolfg...@googlemail.com

 2011/8/15 Wolfgang Schuster schuster.wolfg...@googlemail.com

   On of the things I need to do for the manual about ConTeXt is a list of
 the most frequently used commands. I am using some macros to display them
 correctly in a table. Attached a strange effect I got. The second row is
 displayed wrongly. The third is the same row, but with a \crlf added. This
 displays correctly. But I am wondering why it is needed.

 Use “align=right” for the first column.


 I changed:
 \setupTABLE[c][1][width=.35\textwidth]
 into:
  \setupTABLE[c][1][align=right, width=.35\textwidth]

 But it does not change anything. (It is the right place I think, because
 when using left, or center the formatting changes. But not in a way that is
 satisfactory. With center the text stays in the box, but not with left and
 right.)

 Also it overrides the:
 \setupTABLE[r][1][align=center, style=bold]
 (The align, not the style.)


 Then set the alignment with \bTD in your \StartTable command or just use
 normal table commands.

 \startsetups mytable
   \setupTABLE[header][align=middle,style=bold]
   \setupTABLE[start][align=normal]
   \setupTABLE[c][1][align=right,width=.30\textwidth]
   \setupTABLE[c][2][width=.70\textwidth]
 \stopsetups

 \starttext

 \bTABLE[setups=mytable]
 \bTABLEhead
 \bTR \bTD[nx=2] The most important commands \eTD \eTR
 \eTABLEhead
 \bTABLEbody
 \bTR
   \bTD \type{\completecontent} \eTD
   \bTD This generates a Table of Content. Should be the first statement of
 a document. \eTD
 \eTR
 \bTR
   \bTD \type{\startchapter[title=chapterName]} \eTD
   \bTD Starts a chapter with the named title. Is ended with
 \type{\stopchapter}. \eTD
 \eTR
 \bTR
   \bTD \tex{startchapter [title=chapterName]} \eTD % space needed!
   \bTD Starts a chapter with the named title. Is ended with
 \tex{stopchapter}. \eTD
 \eTR
 \eTABLEbody
 \eTABLE

 \stoptext


I think it is an obscure bug. If I take your code but change the following:
 \setupTABLE[c][1][align=right,width=.35\textwidth]

 \setupTABLE[c][2][width=.65\textwidth]


I have the same problem.

-- 
Cecil Westerhof
___
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
___

Re: [NTG-context] two problems with natural tables

2011-04-11 Thread Wolfgang Schuster

Am 10.04.2011 um 18:40 schrieb Florian Wobbe:

 2) How do I get a small and bold header? This does not work:
 
 \bTABLE
 \setupTABLE[style=\tfx]
 \setupTABLE[row][1][style=\bfx] % redundant w/ line 5
 \bTABLEhead
 \bTR[style=\bfx] \bTH Header \eTH \eTR
 \eTABLEhead
 \bTABLEbody
 \bTR \bTD hello \eTD \eTR
 \bTR \bTD world \eTD \eTR
 \eTABLEbody
 \eTABLE

You mix too many setups, \bTH overwrites your setting for the row 
(\bTR[style=\tfx])
and also your other setting (\setupTABLE[row][1][style=\bfx]). Here is one to 
separate
the style and the markup

\startsetups table:style
\setupTABLE[start] [style=\tfx]
\setupTABLE[header][style=\bfx]
\stopsetups

\starttext

\bTABLE[setups=table:style]
\bTABLEhead
\bTR \bTD Header \eTD \eTR
\eTABLEhead
\bTABLEbody
\bTR \bTD Body \eTD \eTR
\eTABLEbody
\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
___


Re: [NTG-context] two problems with natural tables

2011-04-11 Thread Florian Wobbe
 2) How do I get a small and bold header? This does not work:
 
 \bTABLE
 \setupTABLE[style=\tfx]
 \setupTABLE[row][1][style=\bfx] % redundant w/ line 5
 \bTABLEhead
 \bTR[style=\bfx] \bTH Header \eTH \eTR
 \eTABLEhead
 \bTABLEbody
 \bTR \bTD hello \eTD \eTR
 \bTR \bTD world \eTD \eTR
 \eTABLEbody
 \eTABLE
 
 You mix too many setups, \bTH overwrites your setting for the row 
 (\bTR[style=\tfx])
 and also your other setting (\setupTABLE[row][1][style=\bfx]). Here is one to 
 separate
 the style and the markup
 
 \startsetups table:style
   \setupTABLE[start] [style=\tfx]
   \setupTABLE[header][style=\bfx]
 \stopsetups
 
 \starttext
 
 \bTABLE[setups=table:style]
 \bTABLEhead
 \bTR \bTD Header \eTD \eTR
 \eTABLEhead
 \bTABLEbody
 \bTR \bTD Body \eTD \eTR
 \eTABLEbody
 \eTABLE
 
 \stoptext

Thanks Wolfgang,

so to make style=... also work on the header the trick was to change
  \bTH Header \eTH
to
  \bTD Header \eTD.

What is the purpose of \bTH \eTH then? BTW the Wiki says: Please take account 
of the fact, that the head cells are enclosed by \bTH and \eTH (and not 
\[be]TC).

\bTH seems to only override style=... since \bTD Header \eTD is repeated 
correctly with \bTABLE[split=repeat,setups=table:style].

Florian

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


[NTG-context] three more table questions

2011-04-11 Thread Florian Wobbe
Hi,

1) how can I auto-stretch a natural table to a defined width? The default seems 
to be the line width, which I don't want. Setting width=... will change the per 
column width, which I don't like either. I'd like to set the per table width.

\bTABLE[option=stretch,width=80mm]
\bTABLEhead
\bTR \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \bTD Col4 \eTD \eTR
\eTABLEhead
\bTABLEbody
\dorecurse{5}{\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD 4 \eTD \eTR}
\eTABLEbody
\eTABLE

Or is there maybe the possibility to enforce a certain with with \placetable?

2) In this example I'd like to have no offset between lines but an offset 
between columns. How can I achieve this without the gaps in the hline 
separating the header?

\bTABLE
\setupTABLE[frame=off,offset=0pt]
\setupTABLE[c][distance=3mm]
\bTABLEhead
\bTR[bottomframe=on] \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \bTD Col4 
\eTD \eTR
\eTABLEhead
\bTABLEbody
\dorecurse{5}{\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD 4 \eTD \eTR}
\eTABLEbody
\eTABLE

I also tried various combinations of offset=, columndistance=, 
leftmargindistance=, and rightmargindistance= for columns and rows but did not 
succeed.

3) Consider this example:

\bTABLE[option=stretch]
\setupTABLE[frame=off,offset=0pt]
\bTABLEhead
\bTR[bottomframe=on] \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \bTD Col4 
\eTD \eTR
\eTABLEhead
\bTABLEbody
\dorecurse{5}{\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD this is a long 
entry \eTD \eTR}
\eTABLEbody
\eTABLE

Is it possible to auto-stretch only the first three columns, so that this is a 
long entry is always aligned to the right margin? All columns should stay 
flushleft.

Thanks!
Florian

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


Re: [NTG-context] three more table questions

2011-04-11 Thread Wolfgang Schuster

Am 11.04.2011 um 12:44 schrieb Florian Wobbe:

 Hi,
 
 1) how can I auto-stretch a natural table to a defined width? The default 
 seems to be the line width, which I don't want. Setting width=... will change 
 the per column width, which I don't like either. I'd like to set the per 
 table width.
 
 \bTABLE[option=stretch,width=80mm]
 \bTABLEhead
 \bTR \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \bTD Col4 \eTD \eTR
 \eTABLEhead
 \bTABLEbody
 \dorecurse{5}{\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD 4 \eTD \eTR}
 \eTABLEbody
 \eTABLE
 
 Or is there maybe the possibility to enforce a certain with with \placetable?

Use \bTABLE[option=stretch,textwidth=\textwidth].

 2) In this example I'd like to have no offset between lines but an offset 
 between columns. How can I achieve this without the gaps in the hline 
 separating the header?
 
 \bTABLE
 \setupTABLE[frame=off,offset=0pt]
 \setupTABLE[c][distance=3mm]
 \bTABLEhead
 \bTR[bottomframe=on] \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \bTD Col4 
 \eTD \eTR
 \eTABLEhead
 \bTABLEbody
 \dorecurse{5}{\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD 4 \eTD \eTR}
 \eTABLEbody
 \eTABLE
 
 I also tried various combinations of offset=, columndistance=, 
 leftmargindistance=, and rightmargindistance= for columns and rows but did 
 not succeed.

\setupTABLE[start][loffset=3mm,roffset=3mm]
\setupTABLE[column][first][loffset=0mm]
\setupTABLE[column][last] [roffset=0mm]

 3) Consider this example:
 
 \bTABLE[option=stretch]
 \setupTABLE[frame=off,offset=0pt]
 \bTABLEhead
 \bTR[bottomframe=on] \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \bTD Col4 
 \eTD \eTR
 \eTABLEhead
 \bTABLEbody
 \dorecurse{5}{\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD this is a long 
 entry \eTD \eTR}
 \eTABLEbody
 \eTABLE
 
 Is it possible to auto-stretch only the first three columns, so that this is 
 a long entry is always aligned to the right margin? All columns should stay 
 flushleft.

You can exclude columns from stretching when you set a width, e.g. 
\setupTABLE[column][last][width=4cm,align=flushright]

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
___


Re: [NTG-context] three more table questions

2011-04-11 Thread Florian Wobbe
 3) Consider this example:
 
 \bTABLE[option=stretch]
 \setupTABLE[frame=off,offset=0pt]
 \bTABLEhead
 \bTR[bottomframe=on] \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \bTD Col4 
 \eTD \eTR
 \eTABLEhead
 \bTABLEbody
 \dorecurse{5}{\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD this is a long 
 entry \eTD \eTR}
 \eTABLEbody
 \eTABLE
 
 Is it possible to auto-stretch only the first three columns, so that this 
 is a long entry is always aligned to the right margin? All columns should 
 stay flushleft.
 
 You can exclude columns from stretching when you set a width, e.g. 
 \setupTABLE[column][last][width=4cm,align=flushright]

Thanks again for your suggestions! Still I have problems with the last column, 
which should be flushleft, exactly as wide as the containing text, and still 
aligned to the right page margin (the frame in this case).

I experimented:

\framed{
\bTABLE[option=stretch]
\setupTABLE[frame=off,offset=0pt]
\setupTABLE[column][last][width=2mm] % here is the difference
\bTABLEhead
\bTR[bottomframe=on] \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \bTD Col4 
\eTD \eTR
\eTABLEhead
\bTABLEbody
\dorecurse{5}{\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD 
\blackrule[height=5pt, width=30mm] \eTD \eTR}
\eTABLEbody
\eTABLE}

\framed{
\bTABLE[option=stretch]
\setupTABLE[frame=off,offset=0pt]
\setupTABLE[column][last][width=30mm] % here is the difference
\bTABLEhead
\bTR[bottomframe=on] \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \bTD Col4 
\eTD \eTR
\eTABLEhead
\bTABLEbody
\dorecurse{5}{\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD 
\blackrule[height=5pt, width=30mm] \eTD \eTR}
\eTABLEbody
\eTABLE}

In this case I know the last column width (30mm) but the output is 
unpredictable.

In case I don't know the text width, is there a way to get a dummy width equal 
to \settowidth (latex)?

Florian

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


[NTG-context] two problems with natural tables

2011-04-10 Thread Florian Wobbe
Hi,

1) I tried the following minimal example from 
http://archive.contextgarden.net/message/20110109.151431.f774696a.en.html

\placetable[split]{Test}
{\bTABLE[split=yes]
\dorecurse{60}{
\bTR \bTD hello \eTD \eTR
}
\eTABLE}

with the current context versions which works fine. However, if I insert the 
code in a big project with many setups it fails with the attached error 
message. So there are setups which cause this error. Unfortunately I couldn't 
figure out what causes the problem.

I could determine the context version at which my big document fails: 
2010.12.22 14:07. The example still works in 2010.12.21 10:50.

Anyone got an idea which setups might cause this issue?

2) How do I get a small and bold header? This does not work:

\bTABLE
\setupTABLE[style=\tfx]
\setupTABLE[row][1][style=\bfx] % redundant w/ line 5
\bTABLEhead
\bTR[style=\bfx] \bTH Header \eTH \eTR
\eTABLEhead
\bTABLEbody
\bTR \bTD hello \eTD \eTR
\bTR \bTD world \eTD \eTR
\eTABLEbody
\eTABLE

Thanks!
Florian


! Missing number, treated as zero.

system   tex  error on line 178 in file test.tex: Missing number, 
treated as zero ...

173 \placetable[split]{Test}
174 {\bTABLE[split=yes]
175 \dorecurse{60}{
176 \bTR \bTD hello \eTD \eTR
177 }
178   \eTABLE}

to be read again 
   {
\docompletefloat ...\vbox \floatcaptionattribute {
  \doifelsemainfloatbody \cu...
argument ...loat {table}{}{split}{Test}\nextbox 
  \else \docompletefloat {ta...
\thirdofthreearguments #1#2#3-#3
 
\xdocompletefloat ...afloat ,#3}{#4}\nextbox \fi }
  \else \docompletefloat {#1...
\dodowithnextbox ...tefloat {table}{}{split}{Test}
  \doifnotinset \v!text {spl...
...
l.178 \eTABLE
 }

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


  1   2   >