Automation with OpenOffice.org Writer

Tutorial Level: Intermediate

At the Tata-Dhan Academy where I work, with each new batch of students, we try to promote the adoption of freeware or open-source software instead of promoting the already ridiculous levels of piracy that goes on around here. So, during our orientation, we introduce the students to OpenOffice.org—something which, unfortunately, causes many of them to groan and complain. However, I really do prefer OpenOffice.org Writer over Microsoft Word for several reasons, and one reason is that I find it very easy to automate certain document layout features that would require a lot of extra work in Microsoft Word.

Consider the following requirements:

  • You’re compiling an A5-sized booklet of stories.
  • You want each story to have its title on a right-hand (odd numbered) page, and you want this page to have a background color.
  • The story itself should also start on a right-hand page, about halfway down the page (maybe you’re planning to put a picture in the top half of the page).
  • The first paragraph of the story should have a drop-cap of two to three lines (depending on how many lines the actual paragraph takes up); the rest of the paragraphs will have normal styling.
  • When the story goes beyond its first page, you want the text to be in two columns.

So, is there a way to “automate” this to a certain extent?

With OpenOffice.org (OOo) Writer’s style options, once you’ve spent a little bit of time setting your styles up, doing something like this is not too difficult.

Here’s how we go about it.

Step 1: Page Styles

"Applied Styles" in the Styles and Formatting toolbar in OO.o

"Applied Styles" in the Styles and Formatting toolbar in OO.o. Click on image to read more.


We need at least three page styles here: (1) one for the story’s title; (2) one for the story’s first page; and (3) one for the rest of the story. So, heading over to “page styles” section of the “Styles and Formatting” panel in OOo Writer, we can go ahead and create some custom pages. We will also link these three page styles so that the program knows that first it needs to apply page style 1, then page style 2, then page style 3.

For this purpose, I’ve created three page styles: “Story Title,” “Story First Page,” and “Story Continuation.” For “Story Title” I’ve set the margins to zero all around, and applied a background color. I’ve then assigned the “next style” setting to be “Story First Page.” For “Story First Page,” I’ve set my top page margin to four inches and I’ve set the “next style” to be “Story Continuation.” For these two pages, I’ve declared that they are only “right” pages—always an odd number. For “Story Continuation,” I’ve said to turn the header and footer on (so I can put the story title in the header, and the page number in the footer), I’ve said that text on the page should be in two columns, and I’ve left the “next style” as “Story Continuation.” These pages have been declared as both right and left, so they will continue logically.

For most elements in the "Styles and Formatting" toolbar, you can define the "Next Style"

For most elements in the "Styles and Formatting" toolbar, you can define the "Next Style". Click on image to read more.

Step 2: Text Styles

For this particular document, I need at least three text styles: (1) one for the story title; (2) one for the first paragraph of the story (where we have the drop-cap); and (3) one for the rest of the story.

Because I might want to create a table of contents at some time, I will use “Heading 1” for the story title, and I’ll create two special styles for the rest of the document: “Story Text First Paragraph” and “Story Text Continuation Paragraph.” Remember, I want my story title (Heading 1) to be on the “Story Title” page, my first paragraph (Story Text First Paragraph) to be on a “Story First Page” styled page. So, when I am defining the styles for “Heading 1,” I set the next style to be “Story Text First Paragraph” and I select the options to insert a page break before, with the page style “Story Title” applied. Similarly, for “Story Text First Paragraph,” I set the next style to be “Story Text Continuation Paragraph” and I select the option to insert a page break before with the page style “Story First Page” applied.

Automatic page breaks are possible with different types of text.

Automatic page breaks are possible with different types of text. Click on image to read more.

Step 3: Start Typing

No. Really, that’s pretty much it. You can now start typing your document and have it automatically insert blank pages where it should, start pages in the right place, format text correctly for you and so on. You can do some further embellishments, like having the headers on your page automatically change according to the story you’re on. This is simple to do since you are using a heading, but I think I’ll save that lesson for another time.

Downloads

Anyway, download these two files to see exactly which styles I applied and to view the resulting PDF.


Related posts (possibly):

  1. Drop caps with OpenOffice.org Writer Tutorial Level: Elementary From time to time, I like some...
  2. Making an A6 booklet in OpenOffice.org the easy way Tutorial level: Elementary I recently had to create an A6...
  3. Pivot Tables in Excel and OpenOffice.org Calc One of the features I find useful in Excel is...
  4. 13 years On Saturday, Amy and I celebrated the 13-year anniversary of...
  5. Stylin’ CSS is fun. Really…. It’s as simple as that…. I...
This entry was posted in (all categories), Geekiness, OpenOffice.org and tagged , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.