« Turning data into information with functions in OpenOffice Base | Main | Styles Hack: Importing a Template With Completely Different Style Names, in OpenOffice Writer »

November 09, 2006

Restarting Numbering in OpenOffice Writer: Yes, Virginia, There Is a Way to Do This Without Manual Labor

Logo_restartnumbers_1

OpenOffice Writer numbering is powerful but it lacks at least one very important feature.

(I’m not saying Word numbering doesn’t suck. I think it does. )

Now, it’s not all bad. Anyone doing a nice little shopping list like this is going to have no problem.

  1. Beer

    1. Light

    2. Dark

  2. Bread

    1. Rye

      1. Russian

      2. Scandinavian

    1. White

To get lists like this, just type the list, select the list, click the Numbering icon to turn numbering on, press Tab to indent each item as far as it needs to go, then select the whole list and in the Options tab select the numbering type you want at each level.

However, what do you do if you want this? AND let’s say you have about a hundred  of these and combine them in the same master document?

  1. Directive on Parking

    1. Parking shall be completed by 8:30 AM each morning.

    2. Parking shall be performed in the following lots

      1. Lot A, except on Mondays

      2. Lot B

      3. Lot Q on weekends

  2. Directive on After-Work Parties

    1. Parties shall follow these guidelines

      1. Parties shall last no longer than three hours

      2. Parties shall be catered for no more than $300

      3. Parties shall provide bus service home as necessary

    2. Parties shall take place no more than five times a year

When I first typed up the Directive on Parking part in OpenOffice, composing the blog before I posted it here, it actually looked like the following: the top-level numbering for the directive on parking continued from the bread list, even though it was totally separate.

Complexlist_badrestart

Imagine a 100-page document or a 100-document book where you have to go back and fuss and curse over restarting the numbering.

The trouble with using regular ol’ numbering is multi-fold.

There Are  Problems With Trying to Do Complex Numbering in Big Projects, Especially Relating to Restarting Numbering

Restarting the numbering where and when you want it is hit and miss. Sometimes it works; sometimes it doesn’t.

To restart numbering, you need to click the Restart Numbering icon, or alternately use the Paragraph formatting window. Here they are.

Restartnumberingicon

Fieldsrestartissue

NOTE however that this restart attribute is NOT available when you create a paragraph style.

Fieldsrestartissueinstyle

This all means that you cannot apply restart-iness with styles. You can only apply it manually.

[I have tested the following issue moderately with 2.1 and it does not SEEM to be a problem. Test with your documents.] Also, here’s the kicker. When you import new styles, at least some of the time, the manual settings, aka the restartiness, are kablooied and you need to set them all over again.

[I have tested the following issue moderately with 2.1 and it does not SEEM to be a problem. Test with your documents.] Did I say the kicker? That was a kicker. There’s another even bigger kicker. Importing the styles also often kablooies all the indenting you did to get, say, Rye bread down to level 3 or the party rules down to the level they’re at. You can get around this by using a separate paragraph style/numbering style combination for every level but you still end up with the problem of manual restarts.

You could consider using outline numbering; however you cannot restart the numbering if you are going to combine multiple documents in a master document. Also you have only the most basic control over the distance from the number to the text. (Tools > Outline Numbering. See also http://openoffice.blogs.com/openoffice/2006/10/in_praise_of_ou.html )

So what the heck is the solution?

There Is A Solution If You’re Willing to Do Things Completely Differently

The solution comes from my colleague Jean Weber, at www.jeanweber.com.  She has an excellent book on Writer, including high-end complex issues like this.

Here’s the link to the OOo doc, to which she contributed. http://documentation.openoffice.org/manuals/oooauthors2/

Here’s a link to her book on Amazon. http://www.amazon.com/OpenOffice-org-Writer-Free-Alternative-Microsoft/dp/0596008260/sr=8-1/qid=1163013762/ref=pd_bbs_1/002-0539644-5923228?ie=UTF8&s=books

Here’s a link to the file you’re going to be using to solve this problem. http://documentation.openoffice.org/manuals/oooauthors2/0214WG-WorkingWithFields.pdf

What you do is, you create a numbering series of your own that has nothing to do with the normal numbering.

I’ll leave the particular details to Jean’s guide; go to the section called Defining your own numbering sequences. Here’s what you need to accomplish.

1. Create a single number range for every level. For instance, if your top level is regular Arabic, your second level is Alphabetic, and your third level is lower Roman, then create a single number range for each of those called Arabic, Alpha, and Roman (or one two and three, or Larry Moe and Curly, or whatever). Choose Insert > Fields > Other, click the Variables tab, choose Number Range on the left, and the rest is pretty clear. Jean's guide provides lots of nice detail for this.

Fields1

2. Create paragraph styles with the indenting you want, one style for each level. The paragraph styles are what will take care of the indenting. You also need to set up the correct tabs since you’ll press Tab between the number range and the text.

Here are examples for levels 1, 2, and 3. In this formatting example  there’s an indent of .3 inches from the left margin of the document for all text. Also the distance from the number to the text is .3 inches.

Level 1 (plus set a .3 tab in the Tabs tab)

Paragraphsetuplevel1

Level 2 (plus set a .3 tab in the Tabs tab)

Paragraphsetuplevel2

Level 3 (plus set a .3 tab in the Tabs tab)

Paragraphsetuplevel3

3. Start inserting the numbers, just anywhere in the document. You're going to insert them, then make shortcuts so that you can insert them more easily.

Choose Insert > Fields > Other, select your top level variable such as Arabic, specify 1 in the Value field, and click Insert.

Fields2_1

Now   create your ArabicContinued field.  Press Return or just make a space or two. Still in the Fields window, delete the 1 from the Value field, and click Insert to insert another field of the same range. It’ll show up in the document as  2. Click Insert again if you want to prove it's working; it'll show up as 3.

Fields3

DO NOT set up different variables here for the regular and the restart. They need to have the same name.

Do the same for the first item and the next item at all the levels you’re using.

4. Apply the appropriate paragraph styles to each number range you're using. If you created a paragraph style called TopLevelNumbering, apply it to all the Arabic fields (or whatever you're using at the top level). Also press Tab to insert a tab after each number.

5. If you have a lot more work to do, you want all this inserting stuff to be easier so make AutoTexts.

5.a. Select the first top-level numbering item, the Arabic one that equals 1 and the tab. (Not crucial, but as long as you're saving yourself some work, you can make the tab show up automatically, too.) Be sure the appropriate style is applied so that you can bundle the number and the correct style into one convenient autotext.

5.b. Choose Edit > AutoText. Type a name like ArabicRestart, make the shortcut something obvious like AR for ArabicRestart. Click and hold down on the Autotext button and choose New.

Autotext

5.c. Repeat the steps for the next number at that level, the one that doesn’t have 1 as the value. So select the field that shows 2 in your document, choose  Edit > AutoText,  and call this one just Arabic or ArabicContinued. Make the shortcut something like A or AC.

5.d. Repeat those  steps for every level.

6. Now just keep on formatting or typing your list by inserting numbers. Type AR F3 (the shortcut plus the key that says "insert the autotext with that shortcut" to insert a numeral 1 plus a tab. Type AC F3 to insert a sequential continuous number.   

Note on inserting: You can't have the cursor immediately next to any existing text or the AutoText tool will get confused about what you want to do. There has to be at least a space between the cursor and any other text.

Alternately, if your list already exists, copy and paste the appropriate restart and continuous number variables to the appropriate spots, rather than using the shortcut keys.

In Conclusion

Is it wildly different from normal numbering? Yes. Is it complicated to set up? No more than any other complex numbering.

Does it offer much more reliability and control than other numbering in OpenOffice Writer, for complex lists? Yes, yes, oh god, yes.


TrackBack

TrackBack URL for this entry:
http://www.typepad.com/t/trackback/551685/6756445

Listed below are links to weblogs that reference Restarting Numbering in OpenOffice Writer: Yes, Virginia, There Is a Way to Do This Without Manual Labor:

Comments

Thank you, thank you so much for your informative blog!

I'm not very adept and this numbering issue is one I'll have to study and absorb in more detail. But at least now I have can see a glimmer of light at the end of the tunnel.

I volunteer some of my time with a small NGO in Uganda. One thing I do is to edit some documents. All the documents come in as MS Docs. Most of the time there's not problem with my using Writer, but numbering issues have been a real headache.

Hi,

Yes, numbering is....interesting. I'm going to write an article at some point with exact, step-by-step details about how to do this and a template. I like this better for anything beyond a basic one-off list, and of course thanks to Jean Weber for writing it up in the first place.

Good luck with your NGO!

Solveig

I wonder why did I ever leave LaTEX...

Same here. This was exactly what I though after two days of fiddling with that numbering stuff. I just dont understand how it works - and Solveig's numbering hints (though being an interesting idea, thanks!) really seem to be more a workaround for somehting that should work much easier

I'm pretty sure this is not in The Book, so since searching for a solution brought me to this entry, let me mention it:

In 2.0.2, OpenOffice's list formatting breaks when you have more than 9 items.

"What?" Simple: If you aren't following the hanging indent style the software tries to enforce (to get around it: "Indent" = 0, "Spacing to text" = 0, "Minimum spacing to text" = see below), moving from single digits to double digits pushes your indent over the width of the extra digit character.

This is not obvious if you're using a really wide 'spacing to text,' but it becomes really obvious if you're trying to do, say, contracts with a particular format.

What's missing? Simple: The ability to insert a tab in the 'after' field. I think this worked at one point if you could cut-and-paste one, but it doesn't with the version I'm using tonight.

An obvious workaround is to use the 'right' alignment, but that's not so hot if you wanted numbers aligned to the left and paragraphs starting with an indent to the next tab stop.

...

Another thing that confuses people is precedence: Section styles can sneak in indents not visible in paragraph styles, and paragraph styles control the left indent for numbering (useful if you want a first-line indent only, with the recipe above). You end up seeing 0" in the first two places you look, with no explanation as to why your text is six inches in and bleeding past the right margin. OO.o has "show nonprinting characters," but since indents and such are 'properties' instead of characters, there's nothing to see.

Corel WP has a cute (though easily confused) feature that tries to show where formatting has been applied with symbols in the left margin. I wonder if there'd be a way to add something similar and more deterministic to OO.o -- some sort of gadget, not unlike a ruler, that would try to detect areas of differing formatting and would pop up an overview of everything ("Bullets & Numbering," "____ Paragraph Style," "The following character styles are in use within this block:"...) in one place. And/or they could just stack up like toolbars, one for blocks of paragraph style, another for character, another for numbering, etc.

This probably belongs in the OO.o bugtracker now, but I'll leave it here for a sanity check. :)

Hi Joe,

The size of the 10 does complicate things if you're not doing the hanging indent. You might want to try this entirely different approach to numbering, using fields.

http://openoffice.blogs.com/openoffice/2006/11/restarting_numb.html

It starts off with a lot of blathering on but gets to the point of how to use fields instead. Then you can put a tab between the number and the text.

Solveig

Post a comment