2

My goal is to display floats (a custom type, but I don't think this is relevant) without caption, but to still be able to list them all at the end of my document via their title.

I'm using the following code (using figure instead of my custom float):

\starttext

    \startbodymater

        \startplacefigure[location=none,title="title1"]
            ...
        \stopplacefigure

        \startplacefigure[location=none,title="title2"]
            ...
        \stopplacefigure

    \endbodymater

    \startbackmatter
        \completelistoffigures
    \stopbackmatter

\stoptext

The floats are indeed displayed without caption, but the list in the back matter is empty.

Conversely, if I remove the location=none option, the list is correctly filled, but each float has a caption.

Is there a way to both hide the captions and list all the floats?

4

First of all, your code is not valid ConTeXt. Second, it does not represent a minimal working example (MWE) which makes it a little harder to answer. Especially the definition of myfloat was missing so I just made something up.

To display a float but hide its caption, we can use \setupfloatcaption with the option location=none. This is similar but not equivalent to \startplacefloat with location=none, because in \startplacefloat all other options affecting the caption will then be ignored. To still have the title in the list, use list=... in the \startplacefloat command.

To be honest, I don't see the point of listing floats when there is no way to identify them. I mean, when I look in the table and think “I want to see the float with title1”, how am I supposed to find it? What if there are multiple floats on one page? Do I count which one is which? Please, do your readers a favour and display the caption.

\definefloat
  [myfloat]
  [myfloats]

\setupfloatcaption
  [myfloat]
  [location=none]

\starttext

\startbodymatter

  \startplacemyfloat[list="title1"]
    ...
  \stopplacemyfloat

  \startplacemyfloat[list="title2"]
    ...
  \stopplacemyfloat

\stopbodymatter

\startbackmatter
  \completelistofmyfloats
\stopbackmatter

\stoptext

enter image description here

  • I've edited the code to use figure instead of myfloat. As for your remark regarding the absence of caption, the thing is the new floats I'm creating are examples, i.e. text in a frame. I insert the caption content as a "title" on the first line of the framed text, therefore I do not want it to appear a second time outside of the frame. Maybe there is a way to directly put the caption inside the frame but, since I did not know whether that was possible, I opted for the other option, i.e. removing the caption and "manually" inserting the title inside the frame. – Silverspur Dec 18 '17 at 11:29
  • @Silverspur So does my code solve your problem? – Henri Menke Dec 18 '17 at 21:37
  • Yes it perfectly does. – Silverspur Dec 18 '17 at 21:56

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.