Insert spaces in caption category?

Hello,

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 Insert spaces in captions category

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: 7.0.1.2 (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.

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

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 6.3.6.2 (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.

Can’t add brackets in Category name.

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 ._.

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.

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.

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.

EDIT 1

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

AskLOUserCaption.odt

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.

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

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?

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

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 6.4.6.2 (which is > 6.4.5) doesn’t fix the issue.

typing manually is… not hard, but I’m just lazy to be honest :sweat_smile:… I need to additionally manual setup cross reference link for every “not accepted category name by LO 7”.

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

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.

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

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.

That’s fine, I appreciate your responses :grinning_face_with_smiling_eyes:

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?

Since “Program Segment” is not part of the autocaption parameters, you can’t get “Program Segment 6.3” through cross-reference, only “6.3”. This is a shortcoming I mentioned in the bug report.