Rename caption category

Scenario:
I am working with Writer and I have been using automatic captions for images so they are labeled Image xx. However, I made up my mind and I would like to change the category of all the already existing captions so they are called Figure xx instead. Unfortunately it is not so easy as simply renaming the caption text, as I encounter two problems:

  1. I have plenty of images and renaming one by one is quite time consuming. Since the word Image is very common I cannot perform a regular search and replace.
  2. I am using automatic images’ index, so the new and old images need to belong to the same category, as indexes only allow one category at a time.

So my question is: Is there any automated way to rename an already used caption category?

1 Like

In the caption dialog box you can simply overwrite the default category name, eg where it says ‘illustration’ and you want ‘figure’, double click ‘illustration’ and type ‘figure’, then add the caption in the field above. Subsequently when you add a caption I find that it defaults to ‘figure’.

You can do the search&replace on steps:

  1. Search for styles, picking the paragraph style used on captions
  2. Select all
  3. Turn back to normal search but pick “selection only”
  4. Now, search for Image and replace with Figure
  5. Replace all
  6. Refresh your index

That’s all.

Thank you very much for your answer! It is almost what I was looking for, as it is partially working. Although you provided an easy way to change the label, it only does that, but the category is not changed (In my example, I would have a caption saying Figure 1 instead of Image 1 but its category would still be Figure, which means that images’ index would still refer to Image category. (don’t know if I made myself clear enough)

Perfectly clear! Now I understand your problem better. Sorry, but the only way to do that that I can think of is to “hack” the .odt file. If you change the file extension from odt to zip and uncompress it, you’ll find a series of folders and xml files: on contents.xml the content is declared and with a bit of RegEx magic maybe you’ll be able to change the categories. What do you need to change I do not know for sure, but most of the time the file syntax is quite straightforward.

1 Like

Oh, what a pitty. I see your point. I tried to do what you said but I’m afraid I corrupted the file. I don’t know if it was because I used a slash as caption category or because compressing in zip format does not work well in my linux distribution. I’ll give a further try, although I adventure that would be a hard task, as I have plenty of figures and content now and editing the xml is quite cumbersome :frowning: