Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I need to include a \footnote inside a tabulation environment. I adapted the example from ConTeXt wiki, but at compiling the content between \starttabulatehead and \stoptabulatehead doesn't show up and the content appears aligned to the left:

\starttext
\placetable[here]{Tabla.}
{\startlocalfootnotes\placelegend
{\starttabulatehead
\NC A \NC B \SR
\stoptabulatehead}
{\starttabulate[|l|l|]
\NC C\footnote{Nota al pie.} \NC D \NR
\stoptabulate}
{\placelocalfootnotes}
\stoplocalfootnotes}
\stoptext

Am I missing something here? Thanks!

share|improve this question
    
The syntax of \placelegend has changed. See my comment to Marco's answer. –  Aditya Oct 3 '12 at 21:33
add comment

1 Answer 1

up vote 2 down vote accepted

The following should do what you want:

\starttext

\startplacetable [title=Tabla]
  \startlocalfootnotes

    \starttabulatehead
      \NC A \NC B \SR
    \stoptabulatehead

    \starttabulate[|l|l|]
      \NC C \footnote{Nota al pie.} \NC D \NR
    \stoptabulate

    \placelocalfootnotes
  \stoplocalfootnotes
\stopplacetable

\stoptext

To prevent the table from floating add the location=here option. If you want the table to be centred use \midaligned:

\startplacetable [title=Tabla, location=here]
  \startlocalfootnotes

    \starttabulatehead
      \NC A \NC B \SR
    \stoptabulatehead

    \midaligned{\vbox{%
      \starttabulate[|l|l|]
        \NC C \footnote{Nota al pie.} \NC D \NR
      \stoptabulate}}

    \midaligned{\placelocalfootnotes}
  \stoplocalfootnotes
\stopplacetable

result

Edit:

As Aditya mentioned in the comment, a better solution than the \midaligned is to use the new legend mechanism. Here an example:

\startplacetable [title=Tabla]
  \startlocalfootnotes

    \starttabulatehead
      \NC A \NC B \SR
    \stoptabulatehead

    \startplacelegend [location=top] %% default is bottom
      \startcontent
        \vbox\bgroup
          \starttabulate[|l|l|]
            \NC C \footnote{Nota al pie.} \NC D \NR
          \stoptabulate
        \egroup
      \stopcontent
      \startcaption
        \placelocalfootnotes
      \stopcaption
    \stopplacelegend

  \stoplocalfootnotes
\stopplacetable
share|improve this answer
    
Thanks, it did the trick! –  acidrums4 Oct 3 '12 at 20:19
    
You can also use \startplacelegend[location={...}] \startcontent <table> \stopcontent \startcaption \placelocalfootnote \stopcontent \stoplegend instead of \midaligned{...}. This gives you more structure (important when you think in terms of exporting to other formats), and also gives a easier way to control the location of the notes). –  Aditya Oct 3 '12 at 21:32
    
Semantically that would be a better solution, indeed. But \placelegend is very brittle, it fails if you directly place the tabulate inside the content pair, you need to put the content in a box. Or a newline after \placelegend fails as well as \placelegend[location=left]. –  Marco Oct 4 '12 at 8:36
    
I'd call the current behavior (need to include the material in a vbox) as an implementation bug. –  Aditya Oct 7 '12 at 0:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.