I occasionally need to sort headings in alphabetical order (for instance, when I write documentation, I often have 1-5 paragraphs on a long list of keywords).
Right now, I always have to export to MS Word, sort headings there, then re-import to LO...
This functionality should be integrated into the Navigator (or the currently existing sort function should be extended so you can select format styles to sort by as 1st, 2nd, 3rd sort key)
Here is how to sort by paragraph styles in MS Office:
(In reply to chris.siller from comment #1)
> Here is how to sort by paragraph styles in MS Office:
The page gives a fatal error. Any more reliable resource?
(In reply to Buovjaga from comment #2)
> (In reply to chris.siller from comment #1)
> > Here is how to sort by paragraph styles in MS Office:
> > http://word.tips.net/T000041_Sorting_by_Headings.html
> The page gives a fatal error. Any more reliable resource?
Here is the full text explaining how to sort headings alphabetically in MS Word:
************ START WEB SNIPPET ****************************
A useful trick you can use when developing some types of documents is the ability to sort the various parts of the document based on the headings you use. For instance, you can sort the document based on first-level headings (paragraphs that use the Heading 1 style) by following these steps:
1. Switch to Outline view. (Either click the Outline view button on the status bar or go to the View tab of the Ribbon and select Outline in the Views group.)
2. Using the controls on the Outlining tab of the ribbon, collapse the headings so that only the first-level headings are shown. (This step is not strictly necessary, but does make the screen a bit more readable.)
3. Place the cursor at the beginning of the first heading and press Ctrl+Shift+End to select everything through the end of the document.
4. Display the Home tab of the ribbon.
5. Click the Sort tool in the Paragraph group. Word displays the Sort Text dialog box. (See Figure 1.). Note: for versions earlier than Word 2003, the Sort tool is in the table menu.
6. Click on OK to accept the default settings in the dialog box.
Had you skipped the first two steps and performed the sort in any view besides Outline view, every paragraph would have been sorted alphabetically and therefore rearranged so that subordinate paragraphs would be separated from their headings. In other words, you would have a mess. However, in Outline view, the highest-level headings are sorted, bringing along the subordinate heading levels and body text.
If you wanted to sort by Heading 2 paragraphs, you should also use Outline view, but you would have to first select all the Heading 2 paragraphs subordinate to a particular Heading 1 paragraph and then sort. You will get the same results regardless of how many heading levels that you show on the Outline toolbar.
**********END WEB SNIPPET ************************
So in short, to sort headings in word, you switch to the outline view, then hide all levels in the hierarchy you do NOT want to have sorted, select all the entries and then use the sort tool.
More links with essentially the same procedure described:
Duplicate of bug 101252?
(In reply to Heiko Tietze from comment #4)
> Duplicate of bug 101252?
Chris: do you agree with Heiko?
Set to NEEDINFO.
Change back to UNCONFIRMED, if you don't. Change to RESOLVED DUPLICATE of 101252, if you do.
Created attachment 129300 [details]
Sorting headings alphabetically - feature suggestion demo
I don't agree with Heiko about this being a duplicate - the linked bug/enhancement wants to sort the sequence of INDEX ENTRIES (that are made from Headings) alphabetically, while leaving the actual document flow untouched.
I am suggesting to add the ability to sort the sequence of the HEADINGS THEMSELVES in the document flow (not their index entries, as requested in the other bug).
In short, my suggestion is:
add a “Sort A→Z” button to the navigator, allowing people to arrange headings of a specific hierarchy level in alphabetical order. Ideally, this would be possible over multiple hierarchy levels (e.g. sort only headings 2, OR sort first heading 1 items alphabetcially, then underneath each heading 1, sort all headings 2 alphabetically).
Alternatively, the same functionality could be achieved by extending the existing Tools-Sort menu item to allow user to sort alphabetically by headings-paragraph style (while bringing along any lower-level text like text-body etc).
For an example when/how this would be useful, see attached file.
(In reply to chris.siller from comment #7)
> I am suggesting to add the ability to sort the sequence of the HEADINGS
> THEMSELVES in the document flow (not their index entries, as requested in
> the other bug).
Such a (automatic) sort feature is a very complicated thing. Your example sorts the second level but keeps the first heading, in other cases you may want to sort only the third level or do it independently from any level. And actually it is not the task of a word processor to generate structured text. If you start to collect Grimm's work you do it in a database and export the result eventually. Of course, sometimes it is necessary to sort headings but not automatically. To do so we have the Navigator (hopefully improved sooner than later https://design.blog.documentfoundation.org/2016/07/31/how-the-navigator-may-support-object-handling-in-libreoffice-draw/).
On the other hand the request makes sense in a few situations between the structured data approach with Base and the manual processing in Writer. So my recommendation is to have this feature as an extension. Changing the component accordingly.
You can "Send Outline to Clipboard" (context menu at the Navigator) put that into a table and sort.
*** Bug 148639 has been marked as a duplicate of this bug. ***