3

In LaTeX we have \listoftables, \listoffigures, and so on (at least thats the name as far as I remember).

Is there something to achive similar in ConTeXt?

My first thought was to define a register for tables and one for figures and one for each other type of float I need, and use it together with every single \placetable, \placefigure, \placeSOMETHING, and put a corresponding \completeregister in the appendeix, but to use the register with every \place… is easy to forget. Also the ordering would be wrong, since I want to order floats in the corresponding list by occurence, not by “name” or “label” or what ever.

  • Search the manual for \placelistof<<floats>> and \completelistof<<floats>>. – Philipp Gesang Nov 15 '13 at 17:20
  • OK, thats giving a list at least, but how can I modify the behaviour? So it gets a \chapter instead of a title? I will alter the question as soon as I have the time for it. \…listof… isn't documented very well, neither in contextref.pdf nor in the wiki :( – NobbZ Nov 15 '13 at 17:58
  • 1) Use \place... instead of \complete... and supply your own heading. 2) \setuplist should get you started. – Philipp Gesang Nov 15 '13 at 18:20
5

In Context, all commands derived from \definefloat receive their own list that behaves just like a normal list created by \definelist. For example, for a floating object foo the corresponding setup would be \setuplist[foo]. In order to output the list in your document, use \placelist[foo] or \placelistoffoo.

\useMPlibrary [dum]
\definefloat [foo]
\setuplist [foo] [style=italic]
\starttext
  \placelistoffoo \page
  \dorecurse {10} {
    \startplacefoo [title=Some Foo Float]
      \externalfigure [dummy] [width=42mm]
    \stopplacefoo
  }
\stoptext

Another command, \completelistoffoo, auto-inserts a \title heading with the list name first.

Since \placefigure and \placetable are derived using the same mechanism, they also each come with a list predefined:

\setupexternalfigures [location=default]
\setuplist [figure] [style=slanted]
\starttext
  \placelist[figure]
  \dorecurse{4}{
    \startsection [title=Some Section]
      \input knuth \endgraf
      \startplacefigure [title=A Dutch Cow]
        \externalfigure [cow] [width=4.2cm]
      \stopplacefigure
      \input ward \endgraf
    \stopsection
  }
\stoptext
  • \completelistoftables does NOT insert a \chapter heading, it is inserting a \title heading, so it is not numbered and not in the TOC. edit Also I just realised, that the tables are numbered 1.1, 1.2, 2.1, etc in the text, but 1.I, 1.II, 2.I, etc in the list. – NobbZ Nov 15 '13 at 19:49
  • @NobbZ you’re correct, of course. Regarding the numbering, I cannot reproduce your result with either of my examples, anyways have a look at conversion sets. – Philipp Gesang Nov 15 '13 at 20:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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