ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Florian Wobbe <Florian.Wobbe@awi.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: two problems with natural tables
Date: Mon, 11 Apr 2011 09:57:51 +0200	[thread overview]
Message-ID: <92CD2632-CADB-4D6E-9581-E52E3C00FAF7@awi.de> (raw)
In-Reply-To: <16614D98-D85B-4AE1-B4F3-4B7FA049B0C6@awi.de>

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

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

I have to correct myself. This still does not work with interactions (\setupinteraction [state=start]).

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

I attached the changes in code in strc-flt.mkiv and tabl-tsp.mkiv that break the above split table example. I hope this helps to identify the problem so it can be fixed in the current beta...

Thanks,
Florian


[-- Attachment #2: flt-tabl.diff --]
[-- Type: application/octet-stream, Size: 7428 bytes --]

--- texmf-context/tex/context/base/strc-flt.mkiv.old
+++ texmf-context/tex/context/base/strc-flt.mkiv
@@ -21,9 +21,9 @@
 %D strc-flt.tex and page-flt.mkiv cq. page-flt.mkii.
 
 \ifdefined\addlocalbackgroundtobox\else \def\addlocalbackgroundtobox{\resetglobal\gobbleoneargument} \fi
-\f
+
 \unexpanded\def\placefloats{\doflushfloats}  % keep this one
-\f
+
 \let\currentfloat\empty
 
 \def\letfloatparameter   #1{\expandafter\let\csname\??fl\currentfloat#1\endcsname}
@@ -120,7 +120,8 @@
  % \c!separator=\@@koseparator,
  % \c!starter=\@@kostarter,
  % \c!stopper=\@@kostopper,
- % \c!suffix=\floatcaptionsuffix, % hook
+   \c!suffixseparator=, % currently rather hard coded
+   \c!suffix=\floatcaptionsuffix,
    \c!distance=1em,
    \c!conversion=\v!numbers,
    \c!command=]
@@ -301,11 +302,27 @@
 
 \installstructurelistprocessor{float}{\usestructurelistprocessor{number+title}}
 
+% \def\thecurrentfloatnumber
+%   {\ifnofloatcaption \else \ifnofloatnumber \else
+%      \ifx\currentfloatnumber\relax\else
+%        \dostarttagged\t!floattag\empty
+%        \labeltexts\currentfloat{\ctxlua{structures.lists.savedprefixednumber("\currentfloat",\currentfloatnumber)}}%
+%        \dostoptagged
+%      \fi
+%    \fi \fi}
+
+\unexpanded\def\thecurrentfloatnumbersuffix
+  {\doifsomething{\floatcaptionparameter\c!suffix}
+     {\floatcaptionparameter\c!suffixseparator
+      \floatcaptionparameter\c!suffix}}
+
 \def\thecurrentfloatnumber
   {\ifnofloatcaption \else \ifnofloatnumber \else
      \ifx\currentfloatnumber\relax\else
        \dostarttagged\t!floattag\empty
-       \labeltexts\currentfloat{\ctxlua{structures.lists.savedprefixednumber("\currentfloat",\currentfloatnumber)}}%
+       \labeltexts\currentfloat
+          {\ctxlua{structures.lists.savedprefixednumber("\currentfloat",\currentfloatnumber)}%
+           \thecurrentfloatnumbersuffix}%
        \dostoptagged
      \fi
    \fi \fi}
@@ -506,7 +523,7 @@
 
 \newconditional\retainfloatnumber
 
-\def\preparefloatnumber#1%
+\def\preparefloatnumber#1% use in special case see below
   {\xdef\floatcaptionnumber{#1}%
    \doifelsenodelocation{\v!float\@@thenumber{#1}}
      \donothing {\nodelocationmode\zerocount}%
@@ -755,6 +772,8 @@
      attr \destinationattribute \currentfloatattribute
    \fi \fi \fi}
 
+\newconditional\usesamefloatnumber
+
 \long\def\docompletefloat#1#2#3#4#5% #1:floatclass #2:reference #3:optionlist #4:caption #5:box number
   {\presetfloatvariables{#1}{#3}{#2}{#5}% check this one
    \bgroup
@@ -762,24 +781,32 @@
    %
    % \dofloatcomponent[\c!name=#1,\c!reference=#2,\c!bookmark=,\c!title={#4}][]% ifnofloatnumber ifnofloatcaption \tracefloatnumber{#1}%
    %
-   \dostructurecountercomponent
-     {float}%
-     \getcaptionparameters
-     \floatcaptionparameter
-     \detokenizedcaptionparameter
-     \relax
-     \relax
-     \relax
-     [\c!name=\currentfloat,\s!counter=\@@thestructurecounter\currentfloat,%
-      \s!hascaption=\ifnofloatcaption \v!no\else\v!yes\fi,%
-      \s!hasnumber=\ifnofloatnumber   \v!no\else\v!yes\fi,%
-      \s!hastitle=\ifemptyfloatcaption\v!no\else\v!yes\fi,%
-      \c!reference=#2,\c!title={#4},\c!bookmark=]%
-     []%
-   \globallet\currentfloatnumber     \laststructurecounternumber
-   \globallet\currentfloatattribute  \laststructurecounterattribute
-   \globallet\currentfloatsynchronize\laststructurecountersynchronize
+   \ifconditional\usesamefloatnumber
+      \globallet\currentfloatnumber     \previousfloatnumber
+      \globallet\currentfloatattribute  \empty
+      \globallet\currentfloatsynchronize\relax
+   \else
+     \dostructurecountercomponent
+       {float}%
+       \getcaptionparameters
+       \floatcaptionparameter
+       \detokenizedcaptionparameter
+       \relax
+       \relax
+       \relax
+       [\c!name=\currentfloat,\s!counter=\@@thestructurecounter\currentfloat,%
+        \s!hascaption=\ifnofloatcaption \v!no\else\v!yes\fi,%
+        \s!hasnumber=\ifnofloatnumber   \v!no\else\v!yes\fi,%
+        \s!hastitle=\ifemptyfloatcaption\v!no\else\v!yes\fi,%
+        \c!reference=#2,\c!title={#4},\c!bookmark=]%
+       []%
+     \globallet\previousfloatnumber    \laststructurecounternumber
+     \globallet\currentfloatnumber     \laststructurecounternumber
+     \globallet\currentfloatattribute  \laststructurecounterattribute
+     \globallet\currentfloatsynchronize\laststructurecountersynchronize
+   \fi
    %
+   \global\setfalse\usesamefloatnumber % one shot
    % check float box
    \setnaturalfloatdimensions#5%
    \global\setbox\floatbox\vbox{\floatparameter\c!command{\box#5}}%
@@ -833,7 +860,7 @@
    \fi}
 
 \appendtoks
-  \let\rightorleftpageaction\doifrightpagefloatelse
+    \let\rightorleftpageaction\doifrightpagefloatelse
 \to \everyinsidefloat
 
 \newif\ifextrafloatactions \extrafloatactionstrue
--- texmf-context/tex/context/base/tabl-tsp.mkiv.old
+++ texmf-context/tex/context/base/tabl-tsp.mkiv
@@ -13,14 +13,11 @@
 
 \writestatus{loading}{ConTeXt Table Macros / Splitting}
 
-%D The code in this file is move here from other places.
+%D The code in this file is move here from other places and needs
+%D a mkiv cleanup.
 
 \unprotect
 
-% only to be used with single tokens (will be prim)
-
-\ifx\htdp\undefined \def\htdp#1{\dimexpr\ht#1+\dp#1\relax} \fi
-
 %D Although the name resembles floats, and therefore this should be
 %D a page module, we decided to make it core functionality because the
 %D table code depends on it. Othrwise there would be too much
@@ -29,12 +26,9 @@
 
 % \splitfloat [settings] {\placetable[optional args]{test}} {content}
 
-% \def\s!noftablesplits{nofsplittables}
+% there is no need for a tracked structure number here
 
-\definenumber % we need a nicer name like nofsplittables, we then also need to set \s!parent
-  [\??si]
-  [\c!way=\v!by\v!text,
-   \c!conversion=\@@siconversion]
+\newcount\noffloatssplits
 
 \unexpanded\def\setupfloatsplitting
   {\dodoubleargument\getparameters[\??si]}
@@ -59,8 +53,8 @@
    \insidefloattrue
    \insidesplitfloattrue
    \getparameters[\??si][#1]%
-   \resetnumber[\??si]%
-   \def\floatcaptionsuffix{\convertednumber[\??si]}%
+   \global\noffloatssplits\zerocount
+   \def\floatcaptionsuffix{\convertnumber\@@siconversion\noffloatssplits}%
    \let\extrasplitfloatlines\@@silines
    \the\everysplitfloatsetup
    \def\splitfloatcommand{#2}%
@@ -114,14 +108,19 @@
       \dontcomplain
       \global\settrue\splitfloatdone
       \nodelocationmode\zerocount % bypass auto-renumbering
-      \incrementnumber[\??si]%
-      \ifcase\rawnumber[\??si]\or \ifconditional\onlyonesplitofffloat
-        \let\floatcaptionsuffix\empty
-      \fi \fi
+      \global\advance\noffloatssplits\plusone
+      \ifcase\noffloatssplits\relax
+      \or
+        \ifconditional\onlyonesplitofffloat
+          \let\floatcaptionsuffix\empty
+        \fi
+      \else
+        \global\settrue\usesamefloatnumber % one shot
+      \fi
       \bgroup
       \ifconditional\somenextplitofffloat
         \settrue\retainfloatnumber
-\notesenabledfalse % best here, experimental, brrr; test with note in caption
+        \notesenabledfalse % best here, experimental, brrr; test with note in caption
       \else
         \setfalse\retainfloatnumber
       \fi

[-- Attachment #3: Type: text/plain, Size: 485 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2011-04-11  7:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-10 16:40 Florian Wobbe
2011-04-11  7:18 ` Wolfgang Schuster
2011-04-11  7:37   ` Florian Wobbe
2011-04-11  9:12     ` Wolfgang Schuster
2011-04-11  7:57 ` Florian Wobbe [this message]
2011-04-18 17:16 ` Wolfgang Schuster
2011-04-18 19:14   ` Hans Hagen
2011-04-20  7:30     ` Florian Wobbe
2012-01-18  4:19       ` Brian Landy
2012-01-18  5:31         ` Wrong placement parameter (Was: two problems with natural tables) Vladimir Lomov
2012-01-18  8:48           ` Hans Hagen
2012-01-18 11:29             ` luigi scarso
2012-01-18  8:47         ` two problems with natural tables Hans Hagen
2012-01-18 17:54           ` Brian R. Landy

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=92CD2632-CADB-4D6E-9581-E52E3C00FAF7@awi.de \
    --to=florian.wobbe@awi.de \
    --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).