Re: [NTG-context] weird issue with xtable

2020-08-13 Thread Pablo Rodriguez
On 8/13/20 10:11 PM, Wolfgang Schuster wrote:
> Wolfgang Schuster schrieb am 13.08.2020 um 20:47:
>> [...]
>> You can use nested frames:
>>
>> \startsetups[...]
>>      \startframed[offset=overlay,frame=off]
>>      \framed[width=.22\textiwdth]{\pinter}
>>      \framed[width=.24\textiwdth]{\latint}
>>      \framed[width=.08\textiwdth]{\pcentr}
>>      \framed[width=.24\textiwdth]{\latext}
>>      \framed[width=.22\textiwdth]{\pexter}
>>      \stopframed
>> \stopsetups
>
> To get the correct width with column change \textwidth
> to \makeupwidth or just use \hsize which is the width
> of the footer.

Many thanks for both replies, Wolfgang.

They have solved the issues I had in this thread and also the other ones
I reported today that involved error 139.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] weird issue with xtable

2020-08-13 Thread Wolfgang Schuster

Wolfgang Schuster schrieb am 13.08.2020 um 20:47:

Pablo Rodriguez schrieb am 13.08.2020 um 20:30:

On 8/13/20 6:06 PM, Wolfgang Schuster wrote:

[...]
What am I doing wrong here? (To avoid an error, I get other errors.)


There are not enough information to help you.


I discovered what was wrong: I had an xtable on the footer to set the
page numbering.

So I replaced it with the following tabulation:

\starttabulate
 [|lw(.22\textwidth)|
   cw(.24\textwidth)|
   cw(.08\textwidth)|
   cw(.24\textwidth)|
   rw(.22\textwidth)|]
 [unit=0pt]
\NC\pinter\NC\latint\NC\pcentr\NC\latext\NC\pexter\NC\NR
\stoptabulate


You can use nested frames:

\startsetups[...]
     \startframed[offset=overlay,frame=off]
     \framed[width=.22\textiwdth]{\pinter}
     \framed[width=.24\textiwdth]{\latint}
     \framed[width=.08\textiwdth]{\pcentr}
     \framed[width=.24\textiwdth]{\latext}
     \framed[width=.22\textiwdth]{\pexter}
     \stopframed
\stopsetups


To get the correct width with column change \textwidth
to \makeupwidth or just use \hsize which is the width
of the footer.

\startsetups[...]
\startframed[offset=overlay,frame=off]
\framed[width=.22\hsize]{...}
\framed[width=.24\hsize]{...}
\framed[width=.08\hsize]{...}
\framed[width=.24\hsize]{...}
\framed[width=.22\hsize]{...}
\stopframed
\stopsetups

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] weird issue with xtable

2020-08-13 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 13.08.2020 um 20:30:

On 8/13/20 6:06 PM, Wolfgang Schuster wrote:

[...]
What am I doing wrong here? (To avoid an error, I get other errors.)


There are not enough information to help you.


I discovered what was wrong: I had an xtable on the footer to set the
page numbering.

So I replaced it with the following tabulation:

\starttabulate
 [|lw(.22\textwidth)|
   cw(.24\textwidth)|
   cw(.08\textwidth)|
   cw(.24\textwidth)|
   rw(.22\textwidth)|]
 [unit=0pt]
\NC\pinter\NC\latint\NC\pcentr\NC\latext\NC\pexter\NC\NR
\stoptabulate


You can use nested frames:

\startsetups[...]
\startframed[offset=overlay,frame=off]
\framed[width=.22\textiwdth]{\pinter}
\framed[width=.24\textiwdth]{\latint}
\framed[width=.08\textiwdth]{\pcentr}
\framed[width=.24\textiwdth]{\latext}
\framed[width=.22\textiwdth]{\pexter}
\stopframed
\stopsetups

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] weird issue with xtable

2020-08-13 Thread Pablo Rodriguez
On 8/13/20 6:06 PM, Wolfgang Schuster wrote:
>> [...]
>> What am I doing wrong here? (To avoid an error, I get other errors.)
>
> There are not enough information to help you.

I discovered what was wrong: I had an xtable on the footer to set the
page numbering.

So I replaced it with the following tabulation:

\starttabulate
[|lw(.22\textwidth)|
  cw(.24\textwidth)|
  cw(.08\textwidth)|
  cw(.24\textwidth)|
  rw(.22\textwidth)|]
[unit=0pt]
\NC\pinter\NC\latint\NC\pcentr\NC\latext\NC\pexter\NC\NR
\stoptabulate

But this gave me error number 139 (the same one as reported at
https://mailman.ntg.nl/pipermail/ntg-context/2020/099113.html):

  pages   > flushing realpage 187, userpage 187, subpage 3
  mtx-context | fatal error: return code: 139
  Compilation failed.

This happened using LMTX previous to latest (2020.08.09, I think). Now I
switched to 2020.08.03 14:25, which seems to have no issues with my
documents.

This needs further investigation, I hope to do that in a not so distant
future.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] weird issue with xtable

2020-08-13 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 13.08.2020 um 16:18:

On 8/13/20 3:11 PM, Wolfgang Schuster wrote:

[...]
With the options "split=no" and "split=repeat" ConTeXt puts the table in
a \vbox but with "split=yes" this doesn't happen.

To check is this is the problem he can put the table in a float
environment and disable the caption and counter.

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

Many thanks for your reply, Wolfgang.

These are my defaults for tables in the document:

   \setupxtable
 [frame=off,
  option=stretch,
  split=repeat,
  header=repeat]

The following avoids the reported break, but it doesn’t split the table:

\startxmlsetups xml:table:split
 \blank
 \startplacetable[location={force,none}]
 \startembeddedxtable[split=yes]
 \xmlflush{#1}
 \stopembeddedxtable
 \stopplacetable
 \blank
\stopxmlsetups

If I add "split" to \startplacetable, I get the same \prevdepth error in
the second run.

What am I doing wrong here? (To avoid an error, I get other errors.)


There are not enough information to help you.

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] weird issue with xtable

2020-08-13 Thread Pablo Rodriguez
On 8/13/20 3:11 PM, Wolfgang Schuster wrote:
> [...]
> With the options "split=no" and "split=repeat" ConTeXt puts the table in
> a \vbox but with "split=yes" this doesn't happen.
>
> To check is this is the problem he can put the table in a float
> environment and disable the caption and counter.
>
> \startplacetable[location={force,none}]
>    \startembeddedxtable
>    ...
>    \stopembeddedxtable
> \stopplacetable

Many thanks for your reply, Wolfgang.

These are my defaults for tables in the document:

  \setupxtable
[frame=off,
 option=stretch,
 split=repeat,
 header=repeat]

The following avoids the reported break, but it doesn’t split the table:

\startxmlsetups xml:table:split
\blank
\startplacetable[location={force,none}]
\startembeddedxtable[split=yes]
\xmlflush{#1}
\stopembeddedxtable
\stopplacetable
\blank
\stopxmlsetups

If I add "split" to \startplacetable, I get the same \prevdepth error in
the second run.

What am I doing wrong here? (To avoid an error, I get other errors.)

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] weird issue with xtable

2020-08-13 Thread Pablo Rodriguez
On 8/13/20 2:33 PM, Taco Hoekwater wrote:
> [...]
> I forgot to answer this. Simple explanation:
>
> * 'restricted horizontal mode' is inside an \hbox{} or something similar like 
> a header/footer,
>   where line breaks are forbidden
> * ‘horizontal mode’ is inside a paragraph, where line breaks are possible
>
> But the ‘restricted’ part is not relevant to your problem, \prevdepth
> is forbidden in horizontal mode  regardless of restrictions; it is
> only allowed in vertical mode.
Manny thanks for your explanation, Taco.

> Somehow your table ends up being typeset in a horizontal context,
> based on the error message (at least, if we assume that the error
> message was triggered by a table).
I think it is easy to trigger the error:

  \setupxtable[split=yes]
  \starttext
\ifvmode yes\else no\fi
\startxtable[align={middle,lohi},columndistance=0em]
  \startxrow
\startxcell
  \dontleavehmode
  \externalfigure[cow.pdf]
[scale=500]
\stopxcell
  \stopxrow
\stopxtable
  \stoptext

> But why that is? I do not have any other good ideas. And
> unfortunately lots of different things in ConTeXt can trigger an
> implicit horizontal context.>
> For debugging, you could try adding this to the preamble (or grouped
> around each xtable, for slightly less damage to the vertical
> spacing):>
>   \let\prevdepth\relax
>   \newdimen\prevdepth
>
> that should at least remove the error report.  The vertical spacing
> in the pdf output will be wrong (!!!), but perhaps the output can
> provide a clue about what triggered the problem.
No idea of what is going wrong here.

My setups are even simplistic:

\setupxtable
[frame=off,
 option=stretch,
 split=repeat,
 header=repeat]

\setupxtable
[split-table]
[split=yes]

\startxmlsetups xml:table:split
\blank
\startembeddedxtable[split-table]
\xmlflush{#1}
\stopembeddedxtable
\blank
\stopxmlsetups

But it seems that this cannot be fixed without investing much time.

I’m afraid I don’t have this time now.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] weird issue with xtable

2020-08-13 Thread Wolfgang Schuster

Taco Hoekwater schrieb am 13.08.2020 um 14:33:

On 13 Aug 2020, at 14:15, Pablo Rodriguez  wrote:


My questions are: what is the restricted horizontal mode (as different
from the horizontal mode)?

I forgot to answer this. Simple explanation:

* 'restricted horizontal mode' is inside an \hbox{} or something similar like a 
header/footer,
   where line breaks are forbidden
* ‘horizontal mode’ is inside a paragraph, where line breaks are possible

But the ‘restricted’ part is not relevant to your problem, \prevdepth is 
forbidden in horizontal mode  regardless of restrictions; it is only allowed in 
vertical mode.


Somehow your table ends up being typeset in a horizontal context, based on the 
error message (at least, if we assume that the error message was triggered by a 
table).

But why that is? I do not have any other good ideas. And unfortunately lots of 
different things in ConTeXt can trigger an implicit horizontal context.


With the options "split=no" and "split=repeat" ConTeXt puts the table in 
a \vbox but with "split=yes" this doesn't happen.


To check is this is the problem he can put the table in a float 
environment and disable the caption and counter.


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

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] weird issue with xtable

2020-08-13 Thread Taco Hoekwater

> On 13 Aug 2020, at 14:15, Pablo Rodriguez  wrote:
> 
>>> My questions are: what is the restricted horizontal mode (as different
>>> from the horizontal mode)?

I forgot to answer this. Simple explanation:

* 'restricted horizontal mode' is inside an \hbox{} or something similar like a 
header/footer, 
  where line breaks are forbidden
* ‘horizontal mode’ is inside a paragraph, where line breaks are possible

But the ‘restricted’ part is not relevant to your problem, \prevdepth is 
forbidden in horizontal mode  regardless of restrictions; it is only allowed in 
vertical mode.


Somehow your table ends up being typeset in a horizontal context, based on the 
error message (at least, if we assume that the error message was triggered by a 
table). 

But why that is? I do not have any other good ideas. And unfortunately lots of 
different things in ConTeXt can trigger an implicit horizontal context. 

For debugging, you could try adding this to the preamble (or grouped around 
each xtable, for slightly less damage to the vertical spacing):

  \let\prevdepth\relax
  \newdimen\prevdepth 

that should at least remove the error report.  The vertical spacing in the pdf 
output will be wrong (!!!), but perhaps the output can provide a clue about 
what triggered the problem.

Best wishes,
Taco

___
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] weird issue with xtable

2020-08-13 Thread Pablo Rodriguez
On 8/13/20 1:16 PM, Taco Hoekwater wrote:
>> On 13 Aug 2020, at 13:07, Pablo Rodriguez  wrote:
>> [...]
>> I get the following error message (that breaks compilation) when I add
>> \setupxtable[split=yes]:
>>
>>   You can't use '\prevdepth' in restricted horizontal mode
>> [...]
>> My questions are: what is the restricted horizontal mode (as different
>> from the horizontal mode)? Why might it be triggered with
>> \startxtable[split=yes] in the huge source, but not in the single file?
>
> At a wild guess, as I had a similar problem in my XML: try using 
> \startembeddedxtable
> instead of \startxtable. In my case, what happened was that a row of the 
> xtable
> ended up in the header/footer, generating the same error message you got.
>
> Not sure if it is actually the same problem, but switching is worth a shot.
> The \startxtable does not like to be wrapped into other environments,
> so \startembeddedxtable is much better for that.

Many thanks for your reply, Taco.

Sorry for not realizing that I was missing it: I already use
\startembeddedxtable to deal with XML.

The first time I tried to add table support to my environment for XML, I
cound’t make \startxtable work.

I wonder what triggers the error with a huge file.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] weird issue with xtable

2020-08-13 Thread Taco Hoekwater


> On 13 Aug 2020, at 13:07, Pablo Rodriguez  wrote:
> 
> Dear list,
> 
> in order to avoid a problem already reported
> (https://mailman.ntg.nl/pipermail/dev-context/2020/003694.html), I added
> to an indiviual table \startxtable[split=yes] (being the default in the
> document \setupxtable[split=repeat, header=repeat]).
> 
> But I’m experiencing a weird issue with that approach.
> 
> I get the following error message (that breaks compilation) when I add
> \setupxtable[split=yes]:
> 
>   You can't use '\prevdepth' in restricted horizontal mode
> 
> The single document (actually, an XML file) compiles just fine, but when
> combined together to generate a PDF document over 1000 pages, I get the
> error above.
> 
> My questions are: what is the restricted horizontal mode (as different
> from the horizontal mode)? Why might it be triggered with
> \startxtable[split=yes] in the huge source, but not in the single file?

At a wild guess, as I had a similar problem in my XML: try using 
\startembeddedxtable
instead of \startxtable. In my case, what happened was that a row of the xtable
ended up in the header/footer, generating the same error message you got. 

Not sure if it is actually the same problem, but switching is worth a shot.
The \startxtable does not like to be wrapped into other environments, 
so \startembeddedxtable is much better for that.


Best wishes,
Taco


___
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] weird issue with xtable

2020-08-13 Thread Pablo Rodriguez
Dear list,

in order to avoid a problem already reported
(https://mailman.ntg.nl/pipermail/dev-context/2020/003694.html), I added
to an indiviual table \startxtable[split=yes] (being the default in the
document \setupxtable[split=repeat, header=repeat]).

But I’m experiencing a weird issue with that approach.

I get the following error message (that breaks compilation) when I add
\setupxtable[split=yes]:

   You can't use '\prevdepth' in restricted horizontal mode

The single document (actually, an XML file) compiles just fine, but when
combined together to generate a PDF document over 1000 pages, I get the
error above.

My questions are: what is the restricted horizontal mode (as different
from the horizontal mode)? Why might it be triggered with
\startxtable[split=yes] in the huge source, but not in the single file?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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
___