Adding a custom caption type doesn't generate a number

I am using LibreOffice 7.3.7.2, and I am producing a document which has some formulae in.

I wanted to have a caption for the formulae so I could reference them later on.

If I use “Figure”, everything works well and I have a Figure, an automatic number and can add text, but I wanted to reference the formulae, so I entered e.g. “Formula” where “Figure” is the dialog for adding a caption.

When I finish, my formula appears with e.g. "Formula : " but no number.

I am sure I have done something really silly, but cannot figure out what, so any help would be most appreciated.

Many thanks,

Attach a sample file

When you add a new category name, Writer automatically creates a Number range of the same name. The Number range is an automatic counter. Check its existence in Insert>Field>More Fields, Variables tab, Type Number range.

Many thanks for the suggestion @ajlittoz - I was completely unaware of that.

Sadly, the Number range was identical to e.g. Figure and Table!

Any other suggestions would be most appreciated!

@TTM Attach a sample file so that I can see what went wrong.

@ajlittoz - my thanks again.

I thought your suggestion excellent, so I thought I would reduce the problem to its minimum as my document is quite chunky now!

I added a caption to each, and there was no problem! So I went back to my original document, and tried to replicate the steps, but it doesn’t work!

I am even more perplexed than I was at the start!

Many thanks for your help.

@TTM If you can’t find out by yourself, send me your real file through private mail.

@ajlittoz - my sincere thanks for your help.

My document contains commercially sensitive information, so I would not be able to send it, however, I have performed some more tests/ investigations.

I know that the document format is “layered”, and once at the level one can view the file data, the simple file is relatively easy to follow, however, the complex example, unintelligible.

I tried copying an equation from the complex document to the simple document, and was able to add a number to it.

Taking a formula from the simple document and adding it to the complex document did not allow me to add a numbered caption (there is a greyed area where the number should be).

I tried copying the entire complex document to the simple document, and I was unable to add numbered captions to custom captions.

The complex document has figures, tables and drawings - many of which have numbered captions.

If I take an equation in the complex document and add a standard caption, that works, but the custom caption doesn’t!

I am wondering if there is something in the complex document that has “upset” the document - and maybe changed the file format, which is then preventing the custom caption being usable.

If I can deduce if this is a possibility, or can identify the offending item, I will test further.

I was not expecting the file formats to be different between the two documents, hence I am wondering if that is then issue, but I expected Writer would fail if there is corruption in a file.

:face_with_monocle:

My thanks for your help.

There are several ways to upset or disturb format handling in Writer. One of them is to create conflicts between manual formatting and styling, i.e. mixing both approaches. When dealing with “professional” documents, your worst enely is direct formatting. Unfortunately some concepts in Writer are not elementary (because M$ Word conditioned us into a simplified workflow where direct formatting is almost a universal rule) and require more than basic understanding before use.


You bump into two issues: auto-numbering inside a sequence (defined by a number range), and frames (complicated by the fact you have probably “nested” frames) which must be anchored somewhere.

The solution to level off all this is to use styles and exclusively styles, even on frames (which one of the most difficult exercise in Writer). Also, if you have a company-approved graphical charter, a safe approach is to drop all courtesy “synthetic insertions”, like Insert>Caption, Insert>Page Number or dreaded so-called table “styles”, in favour of user-controlled fields and formats. All these courtesy tools are equivalent to macros which are triggered at unexpected times to ruin your later modifications.

This is not the case for captions (no macro there) but the frames are computed at time of insertion and can’t adapt to non-text contents.

Your captions seem to target formulas only. If the caption is only a formula number, you could instead create a place holder typing “fn” (without quotes) immediately followed by F3. This creates a 1-row 2-column table with a formula at left and a number at right base on Text number range. Double-click the dummy formula to edit it and replace it with your real one. The formula number can be edited to add more text to it if needed.

This is simpler than Insert>Caption. If the layout fits with your charter or specification, it is worth a try.

@ajlittoz described:

Check its existence in Insert>Field>More Fields, Variables tab, Type Number range.

You can enter a new name in that dialog as well and later delete the thereby inserted field in the document. The new name will still be available and can be used for the caption.

@Regina & @ajlittoz - many thanks for your help.

I have double checked the < Insert>Field>More Fields, Variables tab, Type Number range.> and for the formulae, it is the same as for Figures, Tables, … all of which work.

@ajlittoz - I am not sure my brain fully understood what you were saying about the styles, … however, I am rather lazy, so I cannot think of anywhere where there is the use of anything but styles.

I do have a range of tables, figures, headings… and I have indexes for them, as I cross-reference some of them in different sections of the document.

The reason for wanting to add e.g. Formulae 3 after a formula (with it autoincrementing) is that some of the formulae are referenced a number of times, and I would rather cross-reference rather than copy the formula, with the chance of making a mistake!

To the best of my knowledge - and it may be my lack of understanding of the terminology, but I think the only use of nested frames is where I have e.g. figure and have added a caption.

Would I be able to cross reference with the suggestion of using “fn” F3? If so, that may well work.

I remain confused as to why the custom captions don’t work - it is really annoying me - not understanding what I am doing wrong!

My thanks again!

I renew my offer to check your real document through private mail. I’ll delete it as soon as I have diagnosed it. Be aware there is a 5 MB limit on the size of attached documents (if I remember right; I fear the limit is lower perhaps 1 MB).

To send private mail, click on my name or avatar. A dialog pops up with a Message button.