ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Splitting long floats
@ 2018-10-17 15:45 Henri Menke
  2018-10-17 16:58 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Henri Menke @ 2018-10-17 15:45 UTC (permalink / raw)
  To: Mailing list for ConTeXt users

Dear list,

motivated by https://tex.stackexchange.com/questions/455484 I was trying
to split a long float across several pages.  It also works but instead
of the caption I see “there is nothing to split” at the end of the
listing.  The source file documentation of \splitfloat suggests that
this is intended for tabular material.  Is is possible to split other
material as well?

Cheers, Henri

---

\definefloat[listing]

\starttext

\startplacelisting[title={math.h},location=split]
  \typefile{/usr/include/math.h}
\stopplacelisting

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

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

* Re: Splitting long floats
  2018-10-17 15:45 Splitting long floats Henri Menke
@ 2018-10-17 16:58 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2018-10-17 16:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Henri Menke

On 10/17/2018 5:45 PM, Henri Menke wrote:
> Dear list,
> 
> motivated by https://tex.stackexchange.com/questions/455484 I was trying
> to split a long float across several pages.  It also works but instead
> of the caption I see “there is nothing to split” at the end of the
> listing.  The source file documentation of \splitfloat suggests that
> this is intended for tabular material.  Is is possible to split other
> material as well?

A splitter has to talk to the split mechanism ...

% goes into cont-new.mkiv

\unprotect

\def\handlesplittext#1%
   {\setbox\tsplitresult\vbox
      {\vsplit\tsplitcontent to \dimexpr#1-\lineheight\relax}}

\unexpanded\def\startsplittext
   {\begingroup
    \resettsplit
    \let\tsplitminimumfreelines\!!zerocount
    \let\tsplitminimumfreespace\!!zeropoint
    \let\extrasplitfloatlines  \!!plusone
    \let\tsplitdirectsplitter  \handlesplittext
    \setbox\tsplitcontent\vbox\bgroup
    \insidefloattrue}

\unexpanded\def\stopsplittext
   {\egroup
    \handledirecttsplit
    \endgroup}

\protect

\usemodule[scite]

\setupbodyfont[dejavu,8pt]

\starttext

\splitfloat
   {\placefigure{some caption}}
   {\startsplittext
    \typefile[option=TEX,before=,after=]{oeps.tex}
    \stopsplittext}

\stoptext


> Cheers, Henri
> 
> ---
> 
> \definefloat[listing]
> 
> \starttext
> 
> \startplacelisting[title={math.h},location=split]
>    \typefile{/usr/include/math.h}
> \stopplacelisting
> 
> \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
> ___________________________________________________________________________________
> 


-- 

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

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

end of thread, other threads:[~2018-10-17 16:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-17 15:45 Splitting long floats Henri Menke
2018-10-17 16:58 ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).