#Outline: Using an alternative to caption

18 messages · Page 1 of 1 (latest)

sacred spindle
#

Currently, if you make an outline of figures (I use i-figured for ease), the heading is the caption from the figure. For most figures (especially those showing data) the caption is super long. Is it possible to use a different name for them? Can one specify a name/title for the figure, and somehow pass that to outline?

#

This is a current example of the issue.

wooden loom
wooden loom
#

I don't get it. I tried it in a test project and there it seems to only work if I put the definitions directly in the file, not in an imported one. In the main project, it doesn't work in either case. ("Doesn't work" here always means "I get the long text in both the figure and the outline")

Does anyone know, even if in abstract, why this kind of thing could happen?

#

Btw @sacred spindle did it work for you?

uneven surge
#

the show rule would have to be "imported" through the classical template function with .with approach

wooden loom
uneven surge
#

that depends on your template

wooden loom
#

I assume you want me to do something like this in the template file:

#let flex-captions() = {
  let in-outline = state("in-outline", false)
  show outline: it => {
    in-outline.update(true)
    it
    in-outline.update(false)
  }
  
  let flex-caption(long, short) = context if in-outline.get() { short } else { long }
}
uneven surge
#

no, you can just put the definition of flex-caption() and in-outline somewhere in your template file. then, i assume, you have a general function that styles your document with set and show rules no? if yes, put the show outline in there. if not, then i would guess you have styled your document in your main file and you can just put the show outline in there or close to whereever you call outline

wooden loom
#

I have a file with a styling function that I call from main at the beginning, yes. Do you mean I should put the template code in there?

uneven surge
#
show outline: it => {
    in-outline.update(true)
    it
    in-outline.update(false)
  }

this part yea

#

the function and the state you can put wherever and import them

wooden loom
#

It worked, thanks!