7 Steps to Better Tables of Contents in OpenOffice.org Writer
Like other word processes, OpenOffice.org Writer makes creating tables of contents (ToCs) quick and easy. Unfortunately, it also works with unaesthetic defaults and allows you to make choices that complicate your work flow rather than improving it.
Fortunately, Writer is also flexible enough to allow you to produce useful, aesthetic ToCs if you follow a few basic steps.
However, before you read about these steps, you might want to refer to "OpenOffice.org Off-the-Wall: ToCs, Indexes and Bibliographies in OOo Writer," which covers the basics of how to create a ToC. The general procedure is not difficult: first. you create the markers to use in the ToC via Insert -> Indexes and Tables -> Entry -> Index -> Table of Contents, then you generate the ToC through Insert -> Indexes and Tables -> Indexes and Tables. If you want, all you need to do is click the OK button to generate the ToC, but you can customize it in just about every way imaginable, so you might want to refresh your mind about the details before looking at these steps.
Create from outline
Instead of adding your own markers for the ToC, write the document from its very beginning using Heading styles to mark off sections of your work, then select Create from -> Outline as you generate the ToC. You'll not only save time, but help readers to find exactly what you are referring to when they follow a reference in the ToC.
Change the outline numbering if you want to use other styles
Usually, Writer ToCs use Headings 1 through 10 paragraph styles. If you want to include a Title, SubTitle, or Chapter Style in the ToC automatically, go to Tools -> Outline Numbering and change the paragraph style for the first and maybe the second level headings.
Limit yourself to 3 levels of headings
Old engineering documents often had half a dozen heading levels or more. Many heading levels are a document designer's nightmare, because there are only so many ways to differentiate headings - - chiefly typeface, size, indentation -- and using all the possible connections quickly looks cluttered.
Even more importantly, keeping track of where you are in the document is nearly impossible.
Three is a rather arbitrary number of headings, but it is usually enough to organize your document without being confusing aesthetically or practically. And that's three in total, including any title, sub-title, or chapter title that will be listed in the ToC. If you think that a subject needs more headings, ask yourself whether a re-organization can keep the number down -- almost always, it will.
Protect against manual changes
On the Index/Table tab for generating ToCs, you will find a check box labeled "Protect against manual changes." Always check this box. It will force you to work through styles and Writer's other automated features. At first, if you aren't in the habit of using styles regularly, you may think that this work flow is a nuisance, but you will soon find that it helps you regularize your work habits. Besides, if you make manual changes, you will lose them every time you update the fields in your documents and have to redo them. Edit the Contents styles instead (see below).
Avoid dot leaders
Dot leaders are the characters (usually periods) that separate the ToC entry from the page number on the right side of the margin. For some reason, dot leaders have become standard in word processor ToCs, despite the fact that professional typographers generally avoid them. As Robert Bringhurst writes in The Elements of Typographic Style, "Dot leaders (lines of dots leading the eye from one word or number to another) are rarely beneficial in tables." They are both ugly and inefficient.
The reason that dot leaders are seen as necessary is that the page number is always on a tab aligned to the right, which places the page number against the right margin. Most of the time, this position is so far from the ToC entry it refers to that you can hardly see the relation between the page number and the entry, especially in a crowded ToC.
The simplest way to eliminate any need for dot leaders is to change the tab setting. Go to the Entries tab, and select the first level of heading. Find the Tab stop building block for the entry, and set the fill character to a blank (it's hard to see, but at the top of the combo box). Then uncheck the Align Right box, and add a small tab -- no more than two or three centimeters -- and click the All button to apply your changes to all levels of headings. Now, when you generate the ToC, the page numbers will be close to the entry, and you will have no need for dot leaders.
Alternatively, if you find the result unaesthetic (as I do), consider placing the page number first in the entry. Follow the page number building block with a tab and the Entry, and click the All button. The result is not only easy on the eye, but has the advantage of placing the information that you really want when looking at the ToC -- the page number -- first.
Avoid unnecessary decoration
Eliminating unnecessary formatting is a major element in professional design. Just as dot leaders should be avoided because you can do without them, so should any other formatting that doesn't serve the purpose of helping readers use the ToC. For this reason, I suggest avoiding altogether the Column and Background tabs for ToCs.
Multiple columns rarely make reading ToCs easier -- particularly when the page number is to the right of the entry -- because they can force a long entry to spill over into two lines and slow down reading. Sometimes, you may be tempted to use multiple columns so that the ToC takes up less room, but, even then, more than two is going to look sloppy unless you greatly reduce the font size.
In the same way, an unusual background color is only going to call undue attention to itself and do nothing to make the ToC more readable. You don't need it, so leave it out.
Edit contents styles
ToC entries use the Contents paragraph styles. If you look at the Hierarchical view of styles in the Styles and Formatting floating window, you will see that these styles are the children of the Index style, which in turn is the child of the Default style. In other words, the default ToC is going to look much the same as the rest of your document.
This resemblance is not a bad thing. After all, common formatting shows that two pieces of text are related. However, some changes in formatting, such as a change in text size, may be practical. Others, such as the use of a different font weight or another typeface, can make the ToC easier to identify at a glance.
For such reasons, you might want to edit the Contents styles used in your ToC. These styles will appear in the Styles and Formats listing after you generate the ToC for the first time. Editing these styles is quicker than manual editing, and any changes won't be lost when you update the ToC.
Conclusion
Use Writer's defaults for ToCs, and you risk looking design-illiterate. Modifying them will take time, but the result will be a document that is better-looking and more useful to your readers.
Still, nobody likes to do the same work over and over again. Instead, make your changes to ToC structure in your most basic template -- the one that you base other templates on. Then, you can make the changes once and, with luck, never have to edit them again.
-- Bruce Byfield (nanday)
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- New Products
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- Web & UI Developer (JavaScript & j Query)
- UX Designer
- Designing Electronics with Linux
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Nice article, thanks for the
3 hours 6 min ago - I once had a better way I
8 hours 52 min ago - Not only you I too assumed
9 hours 9 min ago - another very interesting
11 hours 2 min ago - Reply to comment | Linux Journal
12 hours 55 min ago - Reply to comment | Linux Journal
19 hours 49 min ago - Reply to comment | Linux Journal
20 hours 6 min ago - Favorite (and easily brute-forced) pw's
21 hours 57 min ago - Have you tried Boxen? It's a
1 day 3 hours ago - seo services in india
1 day 8 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?



Comments
Four Heading Levels, Excepting Title and Sub-Title, Are Good
"Three is a rather arbitrary number of headings, but it is usually enough to organize your document without being confusing aesthetically or practically. And that's three in total, including any title, sub-title, or chapter title that will be listed in the ToC. If you think that a subject needs more headings, ask yourself whether a re-organization can keep the number down -- almost always, it will."
This opinion is incorrect in fact and may be misleading in practice.
- Title and sub-title, while technically "heading" derived styles, are not included in the Table of Contents (TOCs), at least in Standard English. Further, OpenOffice.org does not include these styles in TOCs, by default.
- My experience, starting with FrameMaker twenty years ago, leads me to believe that four sub-levels in a technical document is reasonable, commonly necessary, and effectively differentiable. Separate chapters require a fifth hierarchical level and additional page styles to start chapters at the top of the right page.
Your opinion, expressed as expert advice above, would result in a document with a title and subtitle and only one level of heading. With the delineation of chapters, that would leave no levels of sub-heading available, resulting in an continuous block of text, broken only by paragraphs. This is not an effective design for any document longer than a page or so.
TOC vs Styles
I chose OO Writer over other options (MS Word and others) since I could more accurately format a document as required for a piece of academic writing. I have come across several issues which I have had to work around.
I have not been able to keep TOC item styles completely separate from document body styles. Adding numbering in the TOC also adds numbering in the document body, so if you don't want numbering on chapter titles but want numbering on the TOC then you need to find a workaround. My only option was to create a hidden header which was used as an outline style. Each chapter had 2 chapter titles, one with the normal visible header as I wanted it to be shown and not part of the outline, the other using the new hidden heading. When I need to update the TOC I "unhide" the hidden heading, update the TOC, "hide" the heading again, and export to pdf. The TOC has numbering, the content headings do not.
Also, I have not found a way to handle line spacing such that when a level changes the spacing is double, but if it remains the same the spacing is single. An example of this:
Chapter 1 Section 1.1 Section 1.2 Section 1.3 Section 1.3.1 Section 1.3.2 Section 1.3.3 Section 1.4 Section 1.4.1 Section 1.4.2 Section 1.5 Section 1.6If there is a way to do that, it would be good to know for the future. I wish I could protect against manual changes, but given the arbitrary nature of the document format I've been limited to write in and OO Writer's own limitations, I can't.