Ask Your Question

Insert spaces in caption category?

asked 2020-10-06 18:58:36 +0100

updated 2020-10-17 20:39:20 +0100


I'm wondering how to add spaces in the category? It would be weird if I don't use spaces. And if I edit manually, I will lose the category name in the cross reference link. Also it's not look good in the table of contents :(.

Can't insert space :(

I can't insert space, or any special characters on this field. Why?

Btw, yes, it's duplicate of

No, using underscore is not helping. (that would be weird in the book I write)

edit: the category naming seems directly are a variable naming, which is documented here. But it allows spaces... with brackets. Welp, maybe we can update the ODF standard?

edit: there's related question here. It's about dot instead of space. I confirmed that use dot works here. But that's not what I wanted, using dot would also be weird in the book I write.

edit: I read the git commit that resolved issue that ajlittoz reported. T̶h̶e̶r̶e̶'̶s̶ ̶a̶l̶r̶e̶a̶d̶y̶ ̶c̶o̶d̶e̶ ̶p̶a̶t̶h̶ ̶f̶o̶r̶ ̶t̶h̶i̶s̶.̶.̶.̶.̶ ̶b̶u̶t̶.̶.̶.̶ ̶w̶h̶y̶ ̶t̶h̶i̶s̶ ̶i̶s̶ ̶s̶t̶i̶l̶l̶ ̶h̶a̶p̶p̶e̶n̶i̶n̶g̶?̶ oh no, it's just replaced the contents of text box with filtered characters, but it's still allow some characters (like Décoration) but not spaces... interesting... CMIIW btw.

I haven't tried with daily builds though... Here's my current LibreOffice version, I forgot to mentioned it before.

Version: (x64)
Build ID: 7cbcfc562f6eb6708b5ff7d7397325de9e764452
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: default; VCL: win
Locale: id-ID (id_ID); UI: en-US
Calc: CL

edit: I tried with LO 3.5.5 and it doesn't allow space in category, but it allowed edit the text directly and not losing the category on cross reference. Then on LO 3.5.6, welp, same as 7.0.1 as now.

Old LibreOffice, space on cross reference link

Also there's test file if you want to try it. The category immediately gone if you editing it on LO newer than 3.5.5. The test.odt file

edit retag flag offensive close merge delete


I tried without luck with:

U+2000  en quad
U+2001  em quad
U+2002  en space
U+2003  em space
U+2004  three-per-em space
U+2005  four-per-em space | mid space
U+2006  six-per-em space
U+2007  figure space
U+2008  punctuation space
U+2009  thin space
U+200A  hair space
U+200B  zero width space
U+200C  zero width non-joiner
U+200D  zero width joiner
U+2060  word joiner
U+2063  invisible separator
U+2064  invisible plus
U+FEFF  zero width no-break space
U+202F  narrow no-break space
U+0020  space
U+00A0  no-break space (Alt+0160)
U+205F  medium mathematical space

I can only simulate it with a white underscore.

With LibreOffice (x86); OS: Windows 6.1.

Add Answer is reserved for solutions.

Press edit below your question if you want to add more information; also can comment an answer.

LeroyG gravatar imageLeroyG ( 2020-10-06 19:29:23 +0100 )edit

Can't add brackets in Category name.

LeroyG gravatar imageLeroyG ( 2020-10-06 22:47:36 +0100 )edit

Yea, I also tried forcing it by directly edit the XML inside ODT file. Tried with space, and then with space and brackets. They shows on the selection box, but cannot be inserted. It's just become blank text box when I selected it ._.

Smankusors gravatar imageSmankusors ( 2020-10-06 22:54:48 +0100 )edit

I don't understand the issue with TOC. Unless changed, all caption paragraphs are styled with a derivative of Caption, e.g. Figure if you used the Figure (number range) captioning. Such paragraphs are not entered into the TOC. You can however create a Table of Figures or an Index of Tables (these commands are equivalent) where you select your number range. If you followed the recipe in the other question answer (see link below), you'll keep the full caption, including your manually inserted category.

ajlittoz gravatar imageajlittoz ( 2020-10-07 13:51:33 +0100 )edit

TOC is no problem if I "manually added spaces". The cross reference link inside document is the main problem, I want the entire category plus numbering as link automatically.

Smankusors gravatar imageSmankusors ( 2020-10-07 14:13:09 +0100 )edit

1 Answer

Sort by » oldest newest most voted

answered 2020-10-07 11:19:14 +0100

ajlittoz gravatar image

updated 2020-10-07 17:09:06 +0100

This is similar question to 241962/cant-type-dot-in-caption-category. I submitted bug report tdf#132626 for the issue which is supposed to be fixed in 6.4.5 and 7.0.0. I haven't tested it yet because these versions have not yet bubbled up in my distro.

My answer to the aforementioned question provides a workaround. There are limitations related to automatic cross-references but it should do in most cases.


Here is an example of the workaround. The number range is name mine so that it does not interfere with the built-in ones.


EDIT 2 Uploaded a modified sample file

To show the community your question has been answered, click the ✓ next to the correct answer, and "upvote" by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.

edit flag offensive delete link more


I see, the dot works. But the space not, unfortunately. And I would say it's directly related, but not really duplicate though... haha

Smankusors gravatar imageSmankusors ( 2020-10-07 12:22:18 +0100 )edit

The workaround avoids completely the issue of non-ASCII, non-allowed-in-variable-names characters: it uses the [None] category instead of user-Program Segment. The Program Segment prefix is manually inserted once you've done Insert>Caption. Have you followed the recipe step by step?

ajlittoz gravatar imageajlittoz ( 2020-10-07 12:29:44 +0100 )edit

I tried and lose the category name in cross reference link. I suppose it's [None] category after all :(

Smankusors gravatar imageSmankusors ( 2020-10-07 12:46:33 +0100 )edit

You've hit the limit of the work around: read what I wrote in the bug report. But it is not that hard to type it before the cross-reference. I'm waiting for the 7.0.x version in my distro. Apparently (which is > 6.4.5) doesn't fix the issue.

ajlittoz gravatar imageajlittoz ( 2020-10-07 13:35:18 +0100 )edit

typing manually is... not hard, but I'm just lazy to be honest 😅... I need to additionally manual setup cross reference link for every "not accepted category name by LO 7".

Smankusors gravatar imageSmankusors ( 2020-10-07 14:18:50 +0100 )edit

Have you looked at the sample file I attached to my answer?

ajlittoz gravatar imageajlittoz ( 2020-10-07 14:26:44 +0100 )edit

yes, I just tried. TOC is not the main problem on this Q (although I hope I can remove "Prog segment" automatically, but that's different issue). The cross reference is, and.... well you said "Category and Number just returns the number because category was set to [None] and is thus equivalent to Numbering". This is the problem I mean.

Smankusors gravatar imageSmankusors ( 2020-10-07 16:14:07 +0100 )edit

btw what Linux distro do you use? Why not just... skip it and download .rpm/.deb from

Smankusors gravatar imageSmankusors ( 2020-10-07 16:14:43 +0100 )edit

Apologies, I read criss-cross your comment. I modified the sample file to show a cross-reference where I use the full caption. Does it fit your purpose or do you explicitly need a shortened reference?

My Linux distro is Fedora 32 with KDE Plasma desktop. For stability and maintenance reasons, I'll stick with distro releases and won't install unmanaged (by bistro) applications.

ajlittoz gravatar imageajlittoz ( 2020-10-07 17:12:18 +0100 )edit

That's fine, I appreciate your responses 😄

I explicitly need shortened one. For example if the caption is "Program Segment 6.3 This Code Something", then the one I wanted for cross reference is "Program Segment 6.3".

Fedora 32... I see... Hmm it seems you need to wait until Fedora 33 released to get Libreoffice 7.x?

Smankusors gravatar imageSmankusors ( 2020-10-07 17:46:25 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-10-06 18:58:36 +0100

Seen: 64 times

Last updated: Oct 17