Ask Your Question

Rename caption category

asked 2017-06-04 22:13:22 +0200

Carlos Cámara gravatar image

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?

edit retag flag offensive close merge delete


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

rkeech gravatar imagerkeech ( 2018-05-11 07:12:04 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2017-06-06 13:54:21 +0200

RGB-es gravatar image

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.

edit flag offensive delete link more


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)

Carlos Cámara gravatar imageCarlos Cámara ( 2017-06-08 08:47:12 +0200 )edit

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.

RGB-es gravatar imageRGB-es ( 2017-06-08 11:02:43 +0200 )edit

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

Carlos Cámara gravatar imageCarlos Cámara ( 2017-06-08 17:27:36 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-06-04 22:13:22 +0200

Seen: 919 times

Last updated: Jun 06 '17