I am using the following to style floating tables and am having some
difficulties with footnotes in the tables.

    \enableregime[utf]
    \setupbodyfont[modern]
    \setupbodyfont[11pt]

    \setupfloats[location=middle,spacebefore=0ex,spaceafter=8ex]
    
\setupcaptions[location=top,inbetween={\blank[0cm]},spaceafter=2ex,spacebefore=1ex,headstyle=\sc]
    \setupTABLE[frame=off,offset=0ex]
    \setupTABLE[c][distance=0.6em]
    \def\tableheadrulethickness{1.0pt}
    
\defineframed[footnoteframed]\setupframed[footnoteframed][width=\hsize,frame=off,align=right,top=\hbox\bgroup,bottom=\egroup]
    % Use the set of symbols that has become customary in many publications for 
footnote marks, whose
    % origin seems to be lost in the misty dawn of history:
    \defineconversion[tablefootnoteconversion][*,†,‡,§,\textbar\textbar,¶]

    \starttext
    %%% Begin title page.
    \startalignment[center]
            {\ssb Title}
    \stopalignment
    %%% End title page.

    Hello.

    {
        \placetable[top,page][table]{
            Caption 1.
        }{
                \bTABLE%
                \bTR{}\bTD{}X \eTD\bTD{}Y\eTD\eTR%
                \bTR{}\bTD{}1 \eTD\bTD{}2\eTD\eTR%
                \eTABLE%
        }
    }

    {
            \setupfootnotes[conversion=tablefootnoteconversion] % MkII
            % 
\setupnotation[footnote][numberconversion=tablefootnoteconversion] % MkIV
            \startlocalfootnotes
        
\setupTABLE[r][1][bottomframe=on,align=low,rulethickness=\tableheadrulethickness]
        \setupTABLE[r][each][align={flushleft,verytolerant,hyphenated}] % 
Hyphenate words in table body
        \setupTABLE[r][1][align={flushleft,low,verytolerant,nothyphenated}] % 
but not in header row.
        \placetable[top,page][table]{
            Table 2 caption.\footnote{Footnote in caption. Footnote in caption.
            Footnote in caption. Footnote in caption. Footnote in caption. 
Footnote in caption.
            }\footnote{Second footnote in caption.}
            \placelocalfootnotes
        }{
            \placelegend{
                \bTABLE%
                \bTR{}\bTD{}A\note[Footnote_mark_1] 
\eTD\bTD{}B\note[Footnote_mark_2]\eTD\eTR%
                \bTR{}\bTD{}1 \eTD\bTD{}2\eTD\eTR%
                \eTABLE%
                \footnotetext[Footnote_mark_1]{Footnote to column A. Footnote 
to column A. Footnote to column A. Footnote to column 
A.}\footnotetext[Footnote_mark_2]{Footnote to column B.}
            }{
                \footnoteframed{\placelocalfootnotes}
                \stoplocalfootnotes
            }
        }
    }

    \stoptext

MkII --- this comes close to what I want.

- Captions are centered above the TABLE, more or less, and long captions
  are constrained to a width having reasonable relationship to the width
  of the TABLE.
- Footnotes in the caption appear in a block of reasonable width at the
  bottom of the caption above the TABLE.
- Footnotes in the TABLE appear in a block below the TABLE whose left
  margin matches the TABLE's left margin.
- Symbols are being used for footnote marks.

Problems:

- I'd like the very short caption of the first table to be centered above
  the TABLE, but what I actually get seems to be paragraph with an
  invisible right margin that is centered over the TABLE, but at the text
  does not reach the paragraph's right margin, it looks misaligned. The
  same misaligment occurs in the second table's caption, though it is
  not so objectionable there as the footnotes' texts fill the width.
- The block of footnote texts of the TABLE is not wrapped at a reasonable
  width --- they seem to be left-aligned, but their right margin runs off
  the page.
- I'd like one numbering scheme for the for the whole table (caption and
  TABLE), such that the caption's notes are numbered *, † and the TABLE's
  notes are ‡, §. What I actually get is *, † for both, i.e., the
  numbering resets between caption and TABLE.
- I'd like commas separating multiple footnote marks next to each other,
  as in the caption in the example.
- Minor: I'd like to suppress the table from being placed on the the first
  page of the document as it floats above the title block, confusingly. A
  minor problem as realstically a table is unlikely to be placed this early
  in a real document.

MkIV (with change from \setupfootnotes to \setupnotation[footnote] as
noted) --- there are several new problems.

- The caption's footnotes are not printed, though their marks are.
- The TABLE's footnote marks are not printed (unknown references), but the
  notes themselves are (though wrongly).
- The texts of all the footnotes in the TABLE are run together into a
  single line that doesn't break at all.
___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to