ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Hans Hagen <pragma@wxs.nl>
Subject: Re: two problems with natural tables
Date: Mon, 18 Apr 2011 19:16:34 +0200	[thread overview]
Message-ID: <CD222D29-D756-43F6-A80A-D7121534984E@googlemail.com> (raw)
In-Reply-To: <16614D98-D85B-4AE1-B4F3-4B7FA049B0C6@awi.de>


Am 10.04.2011 um 18:40 schrieb Florian Wobbe:

> Hi,
> 
> 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. However, if I insert the code in a big project with many setups it fails with the attached error message. So there are setups which cause this error. Unfortunately I couldn't figure out what causes the problem.

The error comes from the \floatcaptionattribute and \destinationattribute commands. \destinationattribute expects a number as argument (which is stored in the \currentfloatattribute macro) but with a split float it gets a empty argument.

A split float sets \usesamefloatnumber to true and there \currentfloatattribute is \empty.

\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
   % prepare structure data
   %
   % \dofloatcomponent[\c!name=#1,\c!reference=#2,\c!bookmark=,\c!title={#4}][]% ifnofloatnumber ifnofloatcaption \tracefloatnumber{#1}%
   %
   \ifconditional\usesamefloatnumber
      \globallet\currentfloatnumber     \previousfloatnumber
      \globallet\currentfloatattribute  \empty
      \globallet\currentfloatsynchronize\relax
   \else
   …


As simple fix is to check for a split float when the attribute is set:

\setupinteraction[state=start]

% original defintion from strc-flt.mkiv
%
%\def\floatcaptionattribute
%  {\iflocation \ifnofloatnumber \else \ifnofloatcaption \else
%     attr \destinationattribute \currentfloatattribute
%   \fi \fi \fi}

% patched definition with check for split float

\def\floatcaptionattribute
  {\iflocation \ifnofloatnumber \else \ifnofloatcaption \else \ifinsidesplitfloat \else
     attr \destinationattribute \currentfloatattribute
   \fi \fi \fi \fi}

\starttext
\placetable[split]{Caption}
  {\bTABLE\dorecurse{60}{\bTR\bTD text\eTD\eTR}\eTABLE}
\stoptext


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


  parent reply	other threads:[~2011-04-18 17:16 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
2011-04-18 17:16 ` Wolfgang Schuster [this message]
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=CD222D29-D756-43F6-A80A-D7121534984E@googlemail.com \
    --to=schuster.wolfgang@googlemail.com \
    --cc=ntg-context@ntg.nl \
    --cc=pragma@wxs.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).