Re: [NTG-context] Disappearing footnote in figure / tabulate

2023-03-02 Thread Hans Hagen via ntg-context

On 3/2/2023 11:49 AM, Denis Maier via ntg-context wrote:
Ok, I’ve somehow managed to isolate the issue in my real document. 
There, the issue happens only when a new paragraph starts after the 
tabulate. If there’s nothing after the tabulate, the footnotes 
appears... Also, if I’m using location=page, the footnote will also 
appear. That’s what I’m using now, so there’s no urgency for me now. 
(But does that maybe already indicate the source of the issue ?)


Anyway, I still find the behaviour somewhat weird. I’ll try to come up 
with a MWE. Any hints how to best proceed are still highly appreciated.

i need to deal with insert migrations in xtables ... will do

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 / 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] Float control

2023-03-02 Thread Denis Maier via ntg-context
Thanks everyone for your responses. That's quite a bit to digest. I'll have a 
look, read and play around.
Thanks again and all the best,
Denis

> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Alan
> Braslau via ntg-context
> Gesendet: Donnerstag, 2. März 2023 03:35
> An: Hans Hagen via ntg-context 
> Cc: Alan Braslau 
> Betreff: Re: [NTG-context] Float control
> 
> On Thu, 2 Mar 2023 00:12:53 +0100
> Hans Hagen via ntg-context  wrote:
> 
> > On 2/28/2023 11:45 AM, Denis Maier via ntg-context wrote:
> > > Hi everyone,
> > >
> > > I’ve recently had to typeset a document that gave me some headaches
> > > with the floats. The floats where jumping around, appearing in a
> > > different order than in the source file, tables ended up split up at
> > > weird points, some positioning keys had not the intended effect
> > > (e.g. top), «page» moved the float more than seemed necessary for
> > > me... I know, TeX’s float positioning algorithm should be rather
> > > reliable and stable, and it’s quite possible that I’m messing things
> > > up in my setups–especially since my source files are XML.
> > >
> > > Anyway, I’d like to learn more about the whole float issue. Is there
> > > anything particular I could read to learn more about the whole
> > > thing? Maybe I’m missing out on something fundamental...
> > Basically floats are output in order when they fit. You can use force
> > to really do that. When there is no room they will migrate. Some
> > options like top and bottom might also change the order. Normally you
> > start with just placing ('here') and see how that works out. Side
> > floats are special and anchored to the text.
> >
> > The more complex and confliuctign the demands, the harder it gets for
> > ConTeXt to fulfill all requirements. In that case shifting around the
> > text or places where you ask for a float helps. It's one of the areas
> > where 'fully automated and perfect' are complex as everything can
> > interfere.
> >
> > Btw, Mikael S is working on a tutorial that explains some neat
> > trickery with specific placements (which also triggered some
> > additional features).
> 
> A few (important) observations on floats:
> 
>   \startplacefloat
>   \stopplacefloat
> triggers a paragraph break.
> 
> I therefore locate them always at the beginning or at the end of a paragraph
> of text.
>   (A trick is to enclose them in a named buffer within a
>   paragraph, typically where a figure call -
>   \in{figure}[figureReference] - is to be located. Then to place
>   the \getbuffer at the beginning or end of a paragraph. See
>   example below.)
> 
> The keys location=top/bottom will place the float at the top or bottom of the
> page IF IT FITS, otherwise it is pushed to the following page.
> Thus, a bottom can become a top.
> 
> The key location=force will place the figure there, perhaps generating a page
> break if it does not fit.
> 
> The key location=page will put the figure on a following page. This situation
> can sometimes push figures to appear "out of order", if another figure can
> somehow fit before the figure pushed to the following page. This happens if
> another floating figure "comes too soon".
> 
> The keys location=left and location=right will also generate a page break if
> the figure does not fit.
> 
> In the end, one needs to tweak a document in final form especially if it
> contains many figures, unfortunately. This is done by moving the
> \startfigure...\stopfigure. Here, the use of buffers:
> 
> Paragraph text ...
> (see \in{figure}[myfigure]).
> \startbuffer[myfigure]
>   \startfigure[reference=myfigure,
>location=top,
>title=Title]
> \externalfigure[myfigure][width=\textwidth]
>   \stopfigure
> \stopbuffer
> More text ...\par
> \getbuffer[myfigure]
> 
> can make life easier, moving the \getbuffer[myfigure] to an optimal
> paragraph beginning or end.
> 
> Alan
> 
> P.S. It might be nice to be able to anchor a figure not to text but to a page
> location, like location=nexttop or location=nextbottom, or even
> location={nexttop,right} etc. This gets really complicated (but anything is 
> do-
> able).
> 
> P.P.S. I'm certain to learn some neat trickery from Mikael's tutorial!
> __
> _
> 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

Re: [NTG-context] Disappearing footnote in figure / tabulate

2023-03-02 Thread Denis Maier via ntg-context
Ok, I've somehow managed to isolate the issue in my real document. There, the 
issue happens only when a new paragraph starts after the tabulate. If there's 
nothing after the tabulate, the footnotes appears... Also, if I'm using 
location=page, the footnote will also appear. That's what I'm using now, so 
there's no urgency for me now. (But does that maybe already indicate the source 
of the issue ?)

Anyway, I still find the behaviour somewhat weird. I'll try to come up with a 
MWE. Any hints how to best proceed are still highly appreciated.

Best,
Denis

Von: ntg-context  Im Auftrag von Denis Maier via 
ntg-context
Gesendet: Donnerstag, 2. März 2023 09:21
An: ntg-context@ntg.nl
Cc: Maier, Denis Christian (UB) 
Betreff: [NTG-context] Disappearing footnote in figure / tabulate

Hi,

I have a strange case where a footnote in a tabulate disappears. Strangely, I 
*cannot* reproduce the behaviour in the MWE below. At first, I thought it must 
have something to do with \startpostponingnotes, but it seems that this 
currently isnt't necessary anymore, or at least only for extreme tables. Is 
that correct?

I'll try to narrow it down. Any hints how I could debug that issue?

As I'm again working with XML files: Is it possible that this behaviour is 
caused by some sort of nested setups which makes the footnotes not bubble up?

Best,
Denis

\startbuffer[test]


  

  
a2
b
  

  



  
a2
b
  


  

\stopbuffer

\startxmlsetups xml:test
\xmlsetsetup{\xmldocument}{document|table-wrap|table|figure|p|footnote}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:test}

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

\startxmlsetups xml:p
  \xmlflush{#1}\par
\stopxmlsetups

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

\startxmlsetups xml:figure
  \startplacefigure[title={Test},location={force,split}]
\xmlflush{#1}
  \stopplacefigure
\stopxmlsetups

\startxmlsetups xml:table-wrap
  \startpostponingnotes
\xmlflush{#1}
  \stoppostponingnotes
\stopxmlsetups

\startxmlsetups xml:table
  \startpostponingnotes
\starttabulate[|p|p|]
  \xmlfilter{#1}{/tr/command(xml:table:tr)}
\stoptabulate
  \stoppostponingnotes
\stopxmlsetups

\startxmlsetups xml:table:tr
\xmlfilter{#1}{/td/command(xml:table:tr:td)}\NC\NR
\stopxmlsetups

\startxmlsetups xml:table:tr:td
\NC \xmlflush{#1}
\stopxmlsetups


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

\startplacetable
\starttabulate[|p|p|]
\NC a\footnote{3}\NC b\NC\NR
\stoptabulate
\stopplacetable


\startplacetable
\bTABLE
\bTR \bTD One\footnote{4} \eTD \bTD two \eTD \eTR
\bTR \bTD One \eTD \bTD two \eTD \eTR
\eTABLE
\stopplacetable


% \startpostponingnotes
\startplacetable
\startxtable
\startxrow
\startxcell a\footnote{5}\stopxcell
\startxcell b\footnote{6}\stopxcell
\stopxrow
\stopxtable
\stopplacetable
% \stoppostponingnotes

\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] Disappearing footnote in figure / tabulate

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

I have a strange case where a footnote in a tabulate disappears. Strangely, I 
*cannot* reproduce the behaviour in the MWE below. At first, I thought it must 
have something to do with \startpostponingnotes, but it seems that this 
currently isnt't necessary anymore, or at least only for extreme tables. Is 
that correct?

I'll try to narrow it down. Any hints how I could debug that issue?

As I'm again working with XML files: Is it possible that this behaviour is 
caused by some sort of nested setups which makes the footnotes not bubble up?

Best,
Denis

\startbuffer[test]


  

  
a2
b
  

  



  
a2
b
  


  

\stopbuffer

\startxmlsetups xml:test
\xmlsetsetup{\xmldocument}{document|table-wrap|table|figure|p|footnote}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:test}

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

\startxmlsetups xml:p
  \xmlflush{#1}\par
\stopxmlsetups

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

\startxmlsetups xml:figure
  \startplacefigure[title={Test},location={force,split}]
\xmlflush{#1}
  \stopplacefigure
\stopxmlsetups

\startxmlsetups xml:table-wrap
  \startpostponingnotes
\xmlflush{#1}
  \stoppostponingnotes
\stopxmlsetups

\startxmlsetups xml:table
  \startpostponingnotes
\starttabulate[|p|p|]
  \xmlfilter{#1}{/tr/command(xml:table:tr)}
\stoptabulate
  \stoppostponingnotes
\stopxmlsetups

\startxmlsetups xml:table:tr
\xmlfilter{#1}{/td/command(xml:table:tr:td)}\NC\NR
\stopxmlsetups

\startxmlsetups xml:table:tr:td
\NC \xmlflush{#1}
\stopxmlsetups


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

\startplacetable
\starttabulate[|p|p|]
\NC a\footnote{3}\NC b\NC\NR
\stoptabulate
\stopplacetable


\startplacetable
\bTABLE
\bTR \bTD One\footnote{4} \eTD \bTD two \eTD \eTR
\bTR \bTD One \eTD \bTD two \eTD \eTR
\eTABLE
\stopplacetable


% \startpostponingnotes
\startplacetable
\startxtable
\startxrow
\startxcell a\footnote{5}\stopxcell
\startxcell b\footnote{6}\stopxcell
\stopxrow
\stopxtable
\stopplacetable
% \stoppostponingnotes

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