ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Willi Egger <w.egger@boede.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: [Fwd: problem with context]
Date: Thu, 29 May 2008 13:49:09 +0200	[thread overview]
Message-ID: <6BD2B72B-2913-44F5-B0C7-4CB486F02E59@boede.nl> (raw)
In-Reply-To: <115224fb0805282343w1a21ff0cm99ecc670d17e6a21@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 26 bytes --]

Hi,

Of course...

Wili



[-- Attachment #2: rotatedtable-notrotatedcaption.tex --]
[-- Type: application/octet-stream, Size: 1481 bytes --]

% Context file
% Filename: rotateedtable-notrotatedcaption.tex
% Willi Egger
% 03-06-2007
% Copyright (c) 2007 BOEDE. All rights reserved.
% Question on rotated and split table with caption not rotated with the table (Henning Hraban Ramm)
% Answered by Wolfgang Schuster

\setupoutput[pdftex]
\input rotatesplit
\enableregime[utf]

\startsetups caption:rotatedcaption
	\setupcaptions
	  [location={middle,left},
	   command={\rotate[rotation=-90]},
	   width=max,
	   align=middle]
\stopsetups

\startsetups caption:normalcaption
	\setupcaptions
	  [location=bottom,
	   command=,
	   width=fit,
	   align=]
\stopsetups

\def\rotatedcaption
  {\ifnum\floatrotation=90
     \setups{caption:rotatedcaption}
   \else\ifnum\floatrotation=270
     \setups{caption:rotatedcaption}
   \else
     \setups{caption:normalcaption}
   \fi\fi}

%\setupfloats[before=\rotatedcaption]

\showframe

\starttext

\dorecurse{10}{\input knuth\relax}

\chardef\floatrotation=90

\rotatedcaption

\placetable
  [90,split]
  [tab:religionen]
  {Götter}
  {\bTABLE[width=5cm]
   \dorecurse{100}{\bTR\bTD Text\eTD\eTR}
	\bTR\bTD Ende nach 100 Zeilen \eTD\eTR
   \eTABLE}

\chardef\floatrotation=0

\rotatedcaption

\placetable
  [split]
  [tab:religionen]
  {Götter}
  {\bTABLE[width=5cm]
   \dorecurse{100}{\bTR\bTD Text\eTD\eTR}
	\bTR\bTD Ende nach 100 Zeilen \eTD\eTR
   \eTABLE}

\dorecurse{10}{\input knuth\relax}

\stoptext

[-- Attachment #3: rotatesplit.tex --]
[-- Type: application/octet-stream, Size: 5803 bytes --]

% This file is most probably built by Wolfgang Schuster!
\unprotect

\def\floathack#1%
  {\globallet\floatrotation\!!zerocount
   \ifparfloat
   \else
     \processallactionsinset
       [#1]
       [ 90=>\globallet\floatrotation\commalistelement,%
        180=>\globallet\floatrotation\commalistelement,%
        270=>\globallet\floatrotation\commalistelement]%
   \fi
   \setbox\scratchbox\hbox{\floatrotation}%
   \floatparameter\c!before}

\def\dodocomplexplacefloat[#1][#2][#3]#4%
  {\flushnotes
   \flushsidefloats % here !
   \ifsomefloatwaiting
     % this was \checkwaitingfloats spread all over
     \doifinsetelse\v!always{#2}
       {\showmessage\m!floatblocks5\empty}
       {\expanded{\doifcommonelse{#2}{\flushfloatslist}}\doflushfloats\donothing}%
     % but which should be done before using box \floatbox
   \fi
   \ifmargeblokken
     \doifinset\v!margin{#2}\endgraf
   \fi
   \global\insidefloattrue
   \begingroup % **
   \ifmargeblokken
     \doifinset\v!margin{#2}{\hsize\@@mbwidth}%
   \fi
   \the\everyinsidefloat
   \let\@@extrafloat\empty
   \presetmorefloatvariables{#2}%
   \dowithnextboxcontent % better a \the\everyfloattoks
     {\setlocalfloathsize
      \floatparameter\c!inner
      \fuzzysnappingfalse
      \postponenotes} % new
     {\doifsomething{\floatparameter\c!criterium}
        {\ifdim\wd\nextbox>\floatparameter\c!criterium\relax
           \edef\forcedfloatmethod{\executeifdefined{\??fl\currentfloat\c!fallback}\v!here}%
         \fi}%
       \xdocompletefloat{#1}{#3}{#1}{#2}{#1}{#4}% ** not yet done
       % we need to carry over the par because of side floats
      \doifnotinset\v!text{#2}{\carryoverpar\endgroup}%
      \global\sidefloatdownshift \zeropoint
      \global\sidefloatextrashift\zeropoint
      \ifparfloat
        \doifinset\v!reset{#2}\forgetsidefloats
        \doinhibitblank
      \fi}% better move this to side floats
     \vbox}

\def\splitrotation
  {\ifnum\floatrotation=90
     \scratchdimen\textwidth
   \else\ifnum\floatrotation=270
     \scratchdimen\textwidth
   \else
     \scratchdimen\textheight
   \fi\fi}

\def\handletsplit
  {\analyzesplitfloatcaption\tsplitcontent
   \global\setfalse\tsplitfirstdone
   \testpage
     [\tsplitminimumfreelines]
     [\dimexpr\tsplitminimumfreespace+\extrasplitfloatlines\lineheight\relax]%
   \setbox\scratchbox\vbox{\tsplitinbetween}%
   \edef\tsplitinbetweenheight{\the\htdp\scratchbox}% etex
   \!!doneafalse
   \doloop
     {\ifinsidecolumns
        % brrr, assumes empty columns
        \global\setfalse\tsplitfirstdone
        \splitrotation
        \!!donectrue
      \else
        \ifconditional\tsplitfirstdone
          \splitrotation
          \!!donectrue
        \else\ifdim\pagegoal<\maxdimen
          \scratchdimen\dimexpr\pagegoal-\pagetotal\relax
          \!!donecfalse
        \else
          \splitrotation
          \!!donectrue
        \fi\fi
      \fi
      \scratchdimen\dimexpr\scratchdimen-\tsplitinbetweenheight-\tsplitminimumfreespace-\extrasplitfloatlines\lineheight\relax
      \ifdim\htdp\tsplittail>\zeropoint
        \advance\scratchdimen-\htdp\tsplittail
      \fi
      \setbox\tsplitresult\vbox
        {\ifdim\ht\tsplithead>\zeropoint
           \unvcopy\tsplithead
           \tsplitinbetween
         \fi}%
      \if!!donea\else\ifdim\ht\tsplitnext>\zeropoint
        \setbox\tsplithead\box\tsplitnext
      \fi\fi
      \!!doneatrue
      \ifdim\ht\tsplitresult>\zeropoint
        \!!donedtrue  % table head
      \else
        \!!donedfalse % no tablehead
      \fi
      \splittopskip\zeropoint
      \doloop
        {\setbox\scratchbox\vsplit\tsplitcontent to \onepoint % \lineheight
         \setbox\scratchbox\vbox{\unvbox\scratchbox}%
         \ifdim\dimexpr\scratchdimen-\htdp\scratchbox-\htdp\tsplitresult\relax>\zeropoint
           \setbox\tsplitresult\vbox
             {\unvbox\tsplitresult
              \tsplitinbetween
              \unvbox\scratchbox}%
           \ifvoid\tsplitcontent \exitloop \fi
         \else\if!!doned
           % we only have a tablehead so far
           \setbox\tsplitresult\vbox{\unvbox\tsplitresult\unvbox\scratchbox}%
           \exitloop
         \else\if!!donec
           % we have text height available, but the (one) cell is too
           % large to fit, so, in order to avoid loops/deadcycles we do:
           \setbox\tsplitresult\vbox
             {\unvbox\tsplitresult
              \tsplitinbetween
              \unvbox\scratchbox}%
           \exitloop
         \else
           \setbox\tsplitcontent\vbox
             {\unvbox\scratchbox
              \tsplitinbetween
              \ifvoid\tsplitcontent\else\unvbox\tsplitcontent\fi}%
           \exitloop
         \fi\fi\fi
         \!!donedfalse
         \!!donecfalse}%
      \postprocesstsplit
      \dochecksplitofffloat\tsplitcontent
      \ifvoid\tsplitcontent
        \setbox\tsplitresult\vbox
          {\unvbox\tsplitresult
           \tsplitinbetween
           \unvcopy\tsplittail}%
        \dowithsplitofffloat{\tsplitbeforeresult\box\tsplitresult\tsplitafterresult}%
        \doifnotinsidesplitfloat\tsplitafter
        \endgraf
        \exitloop
      \else
        % hack
        \ifdim\pagegoal<\maxdimen
          \global\pagegoal\dimexpr\pagegoal+\lineheight\relax % etex
        \fi
        % brrr
        \ifdim\ht\tsplitresult>\zeropoint
          \setbox\tsplitresult\vbox
            {\unvbox\tsplitresult
             \tsplitinbetween
             \unvcopy\tsplittail}%
          \dowithsplitofffloat{\tsplitbeforeresult\box\tsplitresult\tsplitafterresult}%
          \doifnotinsidesplitfloat\tsplitafter
          \endgraf
        \fi
        \ifinsidecolumns
          \doifnotinsidesplitfloat\goodbreak
        \else
          \doifnotinsidesplitfloat\page
        \fi
      \fi}}

\protect \endinput

[-- Attachment #4: Type: text/plain, Size: 1096 bytes --]


On May 29, 2008, at 8:43 AM, Wolfgang Schuster wrote:

> Hi Willi,
>
>> A somewhat similar question came from Henning Hraban Ramm some time
>> ago. Wolfgang Schuster prepared a solution...
>> I will send you an example-file and the necessary macro-file off- 
>> line.
>
> Can you send the solution also to the list, it's hard to remeber  
> things
> after a long time and it will also help other users with the same  
> problem.
>
> I don't know what his problem is with the table but
> \placetable[90]{caption}{my table code} should work.
>
>> Willi
>
> Greetings
> 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  : https://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ______________________________________________________________________ 
> _____________


[-- Attachment #5: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

      reply	other threads:[~2008-05-29 11:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-28 14:34 Hans Hagen
2008-05-28 15:29 ` Willi Egger
2008-05-29  6:43   ` Wolfgang Schuster
2008-05-29 11:49     ` Willi Egger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6BD2B72B-2913-44F5-B0C7-4CB486F02E59@boede.nl \
    --to=w.egger@boede.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).