Unwanted blank line in List of Figures after entry for a Caption-detailed figure with Label

I can get caption-detailed to work for Figure caption and the short caption is listed ok in the List of Figures.

But if I insert a Label in the caption (for referencing purposes) using >Insert>Link>Label, then (the label referencing works ok, but) the List of Figures includes an unwanted blank line after the entry for the relevant figure.

For information: I insert the label right at the beginning of the first field in the caption-detailed structure, i.e. the field with the long piece of text that gets displayed below the figure image.

I can reproduce this behaviour in two seperate documents.

Is there someway to prevent this? Maybe it’s a bug?

(Been trying out Texmacs for a couple of weeks now and so far I like it a lot :smile: )

I did not reproduce this. Could you share a small document where this occurs? You can open the document with a text editor and paste all of its contents in a post.

Hi, I just sent the test document contents from a text editor. (I deleted that post)

FYI
The unwanted blank line appears in the LoF (List of Figures) after the entry for Figure 1: “Olly model terms”.

I see in the text editor that there appear the characters “;” above the next line :-
“…/surround>|<pageref|auto-6>>”.

This suggest that a workaround is simply to remove those characters in the text editor.

But … I did this and it worked when the document was first opened in Texmacs.
But when I updated the document the first time the LoF entry included the whole static macro. And when I updated a second time:- the blank line appeared again.

Sorry, I think I sent you a wrong suggestion. I copied the text and TeXmacs interpret only parts of it. The correct suggestion is—I hope

paste the contents of the file inside a code block in a post.

You obtain the code block typing three backquotes alone in a line, and you close the block likewise.

Also, since you are on it, a good exercise is trying to obtain the unwanted blank line in an as small as possible document (the “minimal working example” or MWE).

Thanks. I produced a MWE as you suggested and think I have found the fault.

(Viewed in the source tree) there is (inside the caption-detailed macro) one or more hidden characters after the word ORANGE in between the two subsequent closing chevrons.

Resolution was acheived by deleting the space (in source-tree).

Viewed in a text editor, by comparison with a working caption-detailed (that for the figure of model A), the problem characters are:-
LF . . . . backslash ; LF
which occur between the word ORANGE on line 29 and the big-figure closing tag.

I dont know how they got there - probably some inadvertent text editing by me I suppose.

I will send the contents of the text file in the next reply.

Here follows the code from the text file
(editted to place three backticks before and after the code block).

START OF CODE BLOCK

<TeXmacs|2.1.1>

<style|generic>

<\body>
  <\list-of-figures|figure>
    <glossary-1|<\surround|<hidden-binding|<tuple>|1>|>
      O model terms.ORANGE

      \;
    </surround>|<pageref|auto-2>>

    <glossary-1|<\surround|<hidden-binding|<tuple>|2>|>
      A model terms.APPLE
    </surround>|<pageref|auto-3>>

    <glossary-1|<\surround|<hidden-binding|<tuple>|3>|>
      B model terms.BANANA
    </surround>|<pageref|auto-4>>
  </list-of-figures>

  Line of text referencing Figure (<reference|ollymodelterms>) (below) for
  the O model.

  <\big-figure|<with|gr-mode|<tuple|edit|line>|gr-frame|<tuple|scale|1cm|<tuple|0gw|0.5gh>>|gr-geometry|<tuple|geometry|0.840002par|30|center>|gr-grid|<tuple|empty>|gr-grid-old|<tuple|cartesian|<point|0|0>|1>|gr-edit-grid-aspect|<tuple|<tuple|axes|none>|<tuple|1|none>|<tuple|10|none>>|gr-edit-grid|<tuple|empty>|gr-edit-grid-old|<tuple|cartesian|<point|0|0>|1>|gr-auto-crop|true|gr-snap|<tuple|grid
  point|control point>|<graphics||<line|<point|5.55097|2.1926>|<point|4.42581690699828|2.58551064955682>|<point|3.4614036248181|1.96042796666226>|<point|3.33638708823919|1.17460973673766>|<point|3.87217224500595|0.388791506813071>|<point|4.85444503241169|0.22805595978304>|<point|5.39023018917846|0.692403095647572>|<point|6.14032940865194|1.67467588305331>|<point|5.55096573620849|2.17474202936896>>>>>
    <caption-detailed|<label|ollymodelterms> Terms of the O model.This very
    long piece of text is the caption for the diagram of the O model terms.|O
    model terms.ORANGE>

    \;
  </big-figure>

  Line of text referencing Figure (<reference|allymodelterms>) below for the
  A model.

  <\big-figure|<with|gr-mode|<tuple|edit|line>|gr-frame|<tuple|scale|1cm|<tuple|0gw|0.5gh>>|gr-geometry|<tuple|geometry|0.840002par|30|center>|gr-grid|<tuple|empty>|gr-grid-old|<tuple|cartesian|<point|0|0>|1>|gr-edit-grid-aspect|<tuple|<tuple|axes|none>|<tuple|1|none>|<tuple|10|none>>|gr-edit-grid|<tuple|empty>|gr-edit-grid-old|<tuple|cartesian|<point|0|0>|1>|gr-auto-crop|true|<graphics||<line|<point|4.99251|0.197281>|<point|5.52829408651938|2.51901706574944>|<point|6.27839330599286|0.286578912554571>|<point|5.66557944994169|1.27264956500806>|<point|4.99250892975261|0.143702870750099>>>>>
    <caption-detailed|<label|allymodelterms>A model Terms. This is a long
    caption containing lots of text which will be too long to display nicely
    in the list of figures.|A model terms.APPLE>
  </big-figure>

  Line of text referencing unlabelled Figure (below) for the B model.

  <\big-figure|<with|gr-mode|<tuple|edit|cline>|gr-frame|<tuple|scale|0.840896cm|<tuple|0.0795525gw|0.5gh>>|gr-geometry|<tuple|geometry|0.840002par|30|center>|gr-grid|<tuple|empty>|gr-grid-old|<tuple|cartesian|<point|-3|-3>|1>|gr-edit-grid-aspect|<tuple|<tuple|axes|none>|<tuple|1|none>|<tuple|10|none>>|gr-edit-grid|<tuple|empty>|gr-edit-grid-old|<tuple|cartesian|<point|-3|-3>|1>|gr-auto-crop|true|gr-snap|<tuple|curve-grid
  intersection>|magnify|0.840896415|<graphics||<cline|<point|3.15791|0.833828>|<point|3.20038937287369|-2.11832608994907>|<point|5.19681028888321|-1.94841792688443>|<point|4.89947100352009|-1.20506971347663>|<point|4.49593911624157|-0.928968948496588>|<point|4.11364574934613|-0.716583744665788>|<point|4.66584727930621|-0.546675581601149>|<point|5.19681028888321|-0.313051857387269>|<point|5.28176437041553|-0.0581896127903089>|<point|4.83575544237085|0.324103754105131>|<point|4.32603095317693|0.51525043755285>|<point|3.73135238245069|0.66392008023441>|<point|3.13667381172445|0.85506676368213>>>>>
    B model terms.BANANA
  </big-figure>

  \;

  \;
</body>

<\initial>
  <\collection>
    <associate|page-medium|paper>
    <associate|preamble|false>
  </collection>
</initial>

<\references>
  <\collection>
    <associate|allymodelterms|<tuple|2|1>>
    <associate|auto-1|<tuple|?|1>>
    <associate|auto-2|<tuple|1|1>>
    <associate|auto-3|<tuple|2|1>>
    <associate|auto-4|<tuple|3|1>>
    <associate|ollymodelterms|<tuple|1|1>>
  </collection>
</references>

<\auxiliary>
  <\collection>
    <\associate|figure>
      <tuple|normal|<\surround|<hidden-binding|<tuple>|1>|>
        O model terms.ORANGE

        \;
      </surround>|<pageref|auto-2>>

      <tuple|normal|<\surround|<hidden-binding|<tuple>|2>|>
        A model terms.APPLE
      </surround>|<pageref|auto-3>>

      <tuple|normal|<\surround|<hidden-binding|<tuple>|3>|>
        B model terms.BANANA
      </surround>|<pageref|auto-4>>
    </associate>
    <\associate|toc>
      <vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|List
      of figures> <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
      <no-break><pageref|auto-1><vspace|0.5fn>
    </associate>
  </collection>
</auxiliary>

END OF CODE BLOCK

I am glad that it worked!

This time I did not try to copy the file contents from your message Unwanted blank line in List of Figures after entry for a Caption-detailed figure with Label, as they are not yet all in the same code block and so pieces of them might be interpreted by the forum software and “eaten away”.

You get a code block with three backquotes on their own in a line, and close it likewise.

Many thanks for your help!

Just for tidiness I went back and editted my previous post to enclose the TeXmacs code with three backquotes before and after. It looks much nicer now.

The problem occured again twice.

I think it was caused by inserting the label in a bad place (in front of the caption-detailed macro).

It was fiddly to rectify so I found it easier to delete the figure and start again.

The safe method I found is to insert the caption-detailed first and fill in both fields and press enter. And then insert a label inside the first field of the caption-detailed macro and right in front of the long caption text.

Here is a more-detailed description:-
= = = = = = = =
Safe Process for inserting a caption-detailed and a label for a Figure.
do >Insert>Image>big figure
type “backslash caption-detailed [ENTER]”
(in field 1) type or paste your long caption text then press [ENTER]
(in field 2) type or paste your short caption text then press [ENTER]

to insert a label:- position cursor directly in front of the long caption text
do >Insert>Link>Label
type or paste the label text into the field
click on the HIDE button to hide the label
click on the HIDE button to hide the caption-detailed
do >Document>Update>All a few times
check that entry looks ok in the list of figures.
= = = = = = =

I think it would be interesting to give instructions to replicate the malfunctioning. We could either report a bug in the bug tracker at https://savannah.gnu.org/bugs/?group=texmacs or write a small blog post about it.

I have been trying to write instructions but it is hard to make it fail consistently. I’ll get back to you tomorrow :slight_smile:

If you still have one document where the blank line appears, that might be enough.

Below is such a document

(Filename=Test_List_of_Figures_MWE_v05D_with_1_BUG_unwanted_LoF_Line.tm)

It contains one unwanted blank line after the first entry (ORANGE) in the List of Figures.

EDIT: I found that even if I edit this in TeXmacs and delete the List of Figures there is something (visible in text editor at the bottom of the file) tagged
<\auxiliary><\collection><\associate|figure>
which contains an extra line after ORANGE which seems to put in the unwanted line when I create a new List of Figures.

And even if, in text editor, I delete all the hidden collection data at the end of the file and then insert a new List of Figures - the unwanted line appears in the LoF.

<TeXmacs|2.1.1>

<style|generic>

<\body>
  xxxx

  Filename=Test_List_of_Figures_MWE_v05D_with_1_BUG_unwanted_LoF_Line.tm

  <\list-of-figures|figure>
    <glossary-1|<\surround|<hidden-binding|<tuple>|1>|>
      ORANGE

      \;
    </surround>|<pageref|auto-2>>

    <glossary-1|<\surround|<hidden-binding|<tuple>|2>|>
      DUO.
    </surround>|<pageref|auto-3>>

    <glossary-1|<\surround|<hidden-binding|<tuple>|3>|>
      TRE.
    </surround>|<pageref|auto-4>>
  </list-of-figures>

  xxxx

  \;

  Line of text referencing Figure (<reference|ollymodelterms>) (below) for
  the Orange model.

  <\big-figure|<with|gr-mode|<tuple|edit|line>|gr-frame|<tuple|scale|1cm|<tuple|0gw|0.5gh>>|gr-geometry|<tuple|geometry|0.840002par|30|center>|gr-grid|<tuple|empty>|gr-grid-old|<tuple|cartesian|<point|0|0>|1>|gr-edit-grid-aspect|<tuple|<tuple|axes|none>|<tuple|1|none>|<tuple|10|none>>|gr-edit-grid|<tuple|empty>|gr-edit-grid-old|<tuple|cartesian|<point|0|0>|1>|gr-auto-crop|true|gr-snap|<tuple|grid
  point|control point>|<graphics||<line|<point|5.55097|2.1926>|<point|4.42581690699828|2.58551064955682>|<point|3.4614036248181|1.96042796666226>|<point|3.33638708823919|1.17460973673766>|<point|3.87217224500595|0.388791506813071>|<point|4.85444503241169|0.22805595978304>|<point|5.39023018917846|0.692403095647572>|<point|6.14032940865194|1.67467588305331>|<point|5.55096573620849|2.17474202936896>>>>>
    <caption-detailed|<label|ollymodelterms> Terms of the OO_model. This very
    long piece of text is the caption for the diagram of the O-range model
    terms.a|ORANGE>

    \;
  </big-figure>

  xxx

  <\big-figure|>
    <caption-detailed|ddd dd<space|1em>d d d<space|1em>ddd d<space|1em>d
    d<space|1em>d<space|2em>dd dd ddd ddddd d d dddddd dd<space|1em>ddddddddd
    d ddddd dddddd d d d d d dd<space|1em>dddddd d<space|1em>d.|DUO.>
  </big-figure>

  xxx

  <\big-figure|>
    <caption-detailed|tttttt t ttt<space|2em>ttttttt t tttt t ttttt ttt ttttt
    ttt ttt tttt ttttt ttttttt tt ttt t ttttt tt tt tttt t ttttttt t tttttttt
    t ttttttt tt.|TRE.>
  </big-figure>

  Last line of text.
</body>

<\initial>
  <\collection>
    <associate|page-medium|paper>
    <associate|preamble|false>
  </collection>
</initial>

<\references>
  <\collection>
    <associate|auto-1|<tuple|?|1|..\\..\\Users\\mandy\\AppData\\Roaming\\TeXmacs\\texts\\scratch\\no_name_1.tm>>
    <associate|auto-2|<tuple|1|1|..\\..\\Users\\mandy\\AppData\\Roaming\\TeXmacs\\texts\\scratch\\no_name_1.tm>>
    <associate|auto-3|<tuple|2|1|..\\..\\Users\\mandy\\AppData\\Roaming\\TeXmacs\\texts\\scratch\\no_name_1.tm>>
    <associate|auto-4|<tuple|3|1|..\\..\\Users\\mandy\\AppData\\Roaming\\TeXmacs\\texts\\scratch\\no_name_1.tm>>
    <associate|ollymodelterms|<tuple|1|1|..\\..\\Users\\mandy\\AppData\\Roaming\\TeXmacs\\texts\\scratch\\no_name_1.tm>>
  </collection>
</references>

<\auxiliary>
  <\collection>
    <\associate|figure>
      <tuple|normal|<\surround|<hidden-binding|<tuple>|1>|>
        ORANGE

        \;
      </surround>|<pageref|auto-2>>

      <tuple|normal|<\surround|<hidden-binding|<tuple>|2>|>
        DUO.
      </surround>|<pageref|auto-3>>

      <tuple|normal|<\surround|<hidden-binding|<tuple>|3>|>
        TRE.
      </surround>|<pageref|auto-4>>
    </associate>
    <\associate|toc>
      <vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|List
      of figures> <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
      <no-break><pageref|auto-1><vspace|0.5fn>
    </associate>
  </collection>
</auxiliary>```

Hi again.

I have found the probable cause of the unwanted line in the List of Figures.

It happens when I accidentally insert a new empty line - after the caption - but still inside the figure.

If I delete that empty line then the List of Figures (after updating) will no longer show the unwanted blank line.

Thanks for all your help and sorry for wasting your time on this.

I need to go through things to figure them out. This said, it is not possible to waste someone’s time on the forum :slight_smile: : people answer if they want to.

From a different point of view, if something is clear now it does not imply that it had to be clear in the past. But this is in my opinion a less sharp reason why on a forum noone can waste someone else’s time.

Thanks for your kind words!