Ask Your Question

How to remove chapter number from all titles and increase them all by one heading [closed]

asked 2016-06-27 10:03:27 +0100

jasonlibreoffice gravatar image

updated 2020-08-16 12:37:38 +0100

Alex Kemp gravatar image

I have a document translated from chapter 5 of a book, so many titles and captions have 5 at the beginning, for example, 5.1, 5.2.x, figure 5.x, table 5.x. The question is how can I remove all these preceding "5."s and then increase them by one heading, because for instance, 5.x which was formerly heading 2 would have to be now heading 1 after removing the preceding "5.". I guess that would be possible via Find and Replace dialog using regular expression, but I am not much experienced with them. I can already search for the said pattern using 5.([:digit:]) in the document, but I do not know what to put in replace section. Any ideas?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-09-08 17:20:54.861735

2 Answers

Sort by » oldest newest most voted

answered 2016-06-28 11:25:47 +0100

paul1149 gravatar image

In your search text, 5.([:digit:]), the parentheses delineate an element that you can now capture. So in the Replace field you can put $1, with regular expressions enabled.

To change heading levels, you can use the Navigator as @ajlittoz mentions, or in the find/replace function you can enable paragraph styles and do it one level at a time.

edit flag offensive delete link more

answered 2016-06-28 08:57:42 +0100

ajlittoz gravatar image

The simplest way to reorganise your document is to do it from the Navigator window. However, this assumes that section numbering is inserted by LO itself (as governed by the styles or global outline numbering properties). If your section numbering is manual, you'll have to renumber everything bt yourself or, better, to erase it and then use the automatic numbering feature.

  • Display the navigator window with View->Navigator or F5. Your document outline is sketched in the window. The ammount of detail is controlled with the small triangles at left of section headings which allow you to expand or shrink a section.
  • Select the section you want to work upon by clicking once on its heading. This also selects all subordinate sections.
  • The upper right corner in the toolbar has four icons with various arrows. Clicking on one of them will "move" the selection in the indicated "direction":
    • the vertical double arrows physically move the selected sections up or down relative to the surrounding equal level sections (e.g. chapters are moved as a whole),
    • the horizontal single arrows promote or demote the selection, i.e. Heading n becomes respectively Heading n-1 or Heading n+1, and the magic of it is that subordinate sections are also simultaneously promoted or demoted.

If you consider this a correct answer, please tick it for community benefit.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-06-27 10:03:27 +0100

Seen: 186 times

Last updated: Jun 28 '16