Introduction to OpenOffice.org Styles
Most people use a Word Processor as a glorified typewriter - a typewriter where you can change the fonts, add pictures/graphics and possibly add a table or two - they just start typing away, highlighting words or paragraphs, then changing the font-family, font-size or font-weight for what they highlight. This is a very inefficient and time-consuming way to create documents using a computer. Not only that, it also forces you to focus on how the page looks instead of actually focusing on the content of the document.
Unfortunately, too many educators focus on the vast amount of features in Microsoft Word and forget the big picture of creating a document quickly and easily. They forget one thing - "Knowing how to run Microsoft Word does not make you an Author, the years and years spent in language classes and your God given talent make you an Author." A word processor is simply a tool that allows you to express and show your talent, a tool that unfortunately too many talented people simply use as a glorified typewriter.
This guide is designed to show you how to easily implement styles so you can quickly create a paper by concentrating on the content and not how it looks. We will be using the text of the United States Constitution, cleaning it up and assigning styles to different parts of the text. Later we will add Page styles, add a table of content, a footer and show you how to easily add a footnote.
To complete this tutorial you will need to download the text of the United States Constitution. You can find it at the following Internet sites: (right-click and save link as...)
This tutorial is written for OpenOffice.org Writer, however it could probably be easy to adapted for Microsoft Word (except for the page styles since Word does not offer an equivalent function). The images shown are from OpenOffice.org Writer running on Microsoft Windows XP, although the functionality is basically the same whether you are running OpenOffice.org on Windows, Mac OSX or Linux. I used screenshots from Windows XP since (currently) most desktops are running Microsoft Windows.
To begin this tutorial simply open OpenOffice.org Writer, if you are currently in another document, simply click on File -> New -> Text Document.
Saving the File
Whenever you are creating a new document using any type of word processor, the first thing you should do is save the file to your computer. You do this by simply clicking on the save button within the toolbar, clicking File -> Save or clicking File -> Save As.
Saving the file first is a very good habit to get into, it allows you to simply click on the save button to manually save the file, it allows the application to automatically save the file at certain intervals, and if something were to happen to the computer while writing a document it gives you a specific filename to recover.
Creating the Metadata
Once the file is saved, you should probably adjust the "Metadata" of the file, Metadata is simply the "Data about the Data" where you can insert the Title, Subject, etc. You can find this "Metadata" by clicking on File -> Properties.
As you can see, you can set various information regarding your document. For this tutorial, we are going to insert the title of the Document as "The United States Constitution" and are going to add a custom field called "Authors".
You can add custom fields by going to the "User Defined" tab and clicking on the "Info Fields" button. This will open a dialog box where you can modify the different User Configurable fields. For this tutorial, create a field called "Authors", close the dialog box by clicking on "OK". Then set the newly created Authors field to "Delegates Attending the Constitutional Convention 1787".
Importing the Constitution
Now that we entered all of the Metadata that we will utilize for this tutorial, it is time to import the entire text of the United States Constitution into our document. There are various different ways of importing text into OpenOffice.org, you can open the file directly, you can select the text with another application, then copy and paste it into OpenOffice.org, or you can use the Insert -> File dialog function, this is what we will use here.
So, select Insert -> File and the File Selector dialog used by your Operating System will open. Now simply locate the const.txt file you should have downloaded and hit "open". Depending on your Operating System, the text will either be inserted, or a dialog box will appear giving you more options. This dialog might appear if you are on a non-Unix based Operating System since the text file was created on a GNU/Linux system - this is due to the fact the different ways carriage returns are handled within the Operating System. Anyway, if you receive the dialog box, simply hit OK.
This section covers how to apply styles to your Document, it may seem to be a little tedious, but once you apply paragraph styles to your document you can do some really cool features. Remember that once you learn how to use styles, you don't have to "style" your whole document, you just style it as you write it.
Marking all the text as "text body"
Now that you actually have the Constitution in your document, we are going to start marking different paragraphs use different "styles". The first thing is we will want to do is mark all of the text as "text body". We do this because the majority of any text you will want to mark as "text body". So, simply click on Edit -> Select All to highlight all of the text, then apply the "Text body" style by selecting it from the "Apply Style" drop down list.
Showing the Stylist
To make it easier to work with styles, OpenOffice.org has the "Stylist", a dialog box showing all of the styles available to use. This dialog can be moved wherever you want on the page and can also be "docked" anywhere within OpenOffice.org. Go ahead and open the stylist by clicking on the "Styles and Formatting" button on the toolbar. Once the stylist is open, go ahead and move it around, then dock it along the right edge of the application.
Adding the Title and Subtitle
The next thing we will want to do is to add the Title of the document. What you will need to do is place the cursor at the very beginning of the document and hit return or enter to create a new paragraph before any of the text. Now, make sure the text entry point is in the new paragraph you just created, then find the "Title" style within the stylist and double-click it to set the new paragraph as a Title style. You may have to tell the stylist to list "All Styles" or "Chapter Styles" in order to find the Title style.
Now click on Insert -> Fields -> Title to insert the Title metadata that we entered earlier, then press return. What you will notice is that the next paragraph is created with a "Subtitle" style (I will cover why this happens later), for now insert the "Authors" metadata that you created earlier. This will be a little different than adding the Title data, here you have to select Insert -> Fields -> Other.. (or use the Control+F2 keyboard shortcut).
The dialog that appears will allow you to insert any type of "metadata" available into your document. The custom fields will be located within the "DocInformation" tab, located under the Info selections. Go ahead and enter the custom "Authors" field.
Cleaning up the text
Before we start defining all the Articles, Sections and Amendments of the Constitution to use a Headings style, we need to clean up the text a little. You may have noticed that there are blank paragraphs seperating each paragraph that has text. When you use styles for the page formatting, it is considered bad practice to include any extra paragraphs or characters for any formatting purposes.
To remove the extra blank paragraphs were are going to be using the "Find & Replace" tool to select all of the blank paragraphs to be deleted. First, go ahead and open the tool by selecting Edit -> Find & Replace, otherwise you can also use the CTL-F keyboard shortcut to open the tool.
Once it is open, we are going to search for what is called a "Regular Expression" since you cannot simply search for blank paragraphs. So, you will have to click on the "More Options" button, then select the "Regular expressions" checkbox. Now we can insert into our search for box ^$ (which is the regular expression search for a paragraph that doesn't have any characters). Once that is entered simply hit the Find All button to select all of the blank paragraphs. If you did this correctly simply hit the "delete" button on the keyboard to delete all of the selected blank paragraphs (you can also use the Edit -> Cut or CTL-X command to also get rid of the selected paragraphs).
If you work with documents that include a tab or spaces starting each paragraph you can quickly remove the extra space(s) by searching for the regular expression ^([:space:]|\t)*
Applying Styles to the Articles and Sections
Now that the text body is basically cleaned up, we will want to add a few headings to the document. Please note that we are adding these headings to convey how to use Writer, they are not a part of the original United States Constitution. So, now that's out of the way, lets add a few "Heading 1" styles before the "Preamble" aptly named "Preamble" and before the Articles start named "Articles of the Constitution".
You do this the same way as we added the Title and Subtitle, just insert a new paragraph before where you want to insert it, make sure the insertion point is in the new paragraph, then select "Heading 1" from either the dropdown apply style tool or the stylist.
Now we are going to apply the "Heading 2" style to all of the Articles. To do this we need an easy way to select just the articles that are part of a "heading". Fortunately there is an easy way to do this using Regular Expressions, so go ahead and open the "Find & Replace.." tool (CTL-F) and search for "Article [IV]" (without the quotes, also be sure that the "Regular Expression" checkbox is enabled). What this will do is select any text that is "Article I" or "Article V", since there are only 7 articles written in Roman Numerals, this will select all of them. Once they are selected, apply the "Heading 2" style using either the stylist or the dropdown apply style tool.
Once that is done, you will want to do the same for the Sections of the Articles, but you will want to apply "Heading 3" for these. To do this simply search for "Section [1-9]" using regular expressions (without the quotes) to select them all, then apply the "Heading 3" style.
The Navigator and styling the Amendments
OpenOffice.org Writer provides a tool, the Navigator, to help you navigate larger documents. To use it, simply open it by clicking on the Navigator button on the toolbar, by selecting Edit -> Navigator, or by simply pressing F5. The navigator is similar to the stylist in that it can be moved around and docked within the Application. Go ahead and open it, move it around and try to dock it above the stylist.
Now that the navigator is open, use it to quickly move past Article VII and to the beginning of the Amendments. What you will want to do is add a Header to the Amendments named "Amendments to the Constitution", and styled with the "Heading 1" style.
To apply a style to the amendments, use the "Find & Replace.." tool with the Regular Expression "Amendment [IVX]" (without the quotes) to find and select all of the Amendments. Once they are selected, apply the "Heading 2" style to them.
Applying Number Styles to Amendments
One final paragraph formatting issue we need to look into before we go on is the fact that Amendments 13-26 (with a few exceptions) utilize a numbered list. We will want to both format these as "Numbering 1" style and actually make these into a numbered list.
The first thing to do is style these as a "Numbering 1" style. To do this we will simply do a search for the Regular Expression "^[1-9]" (without the quotes), then apply the "Numbering 1" style which can be found in the "List Styles" or "All Styles" category.
That was the easy part, now we want to define all of them as numbered lists. We will do this by Amendment, so go to Amendment 13 by scrolling to it or simply use the Navigator do quickly get there. Now what you will want to do is remove the numbering from each paragraph since OpenOffice.org Writer will automatically add the numbers to Numbered Lists. Now you will want to select all the paragraphs of the Amendment that had numbers to begin with, then simply click the "Numbering On/Off" button on the toolbar.
NOTE: When selecting the paragraphs to specify the Numbered Lists, you only need to select part of the paragraph in order for the entire paragraph to be considered in the List. When selecting the paragraphs, you may find it frustrating when dragging between pages as the selection may seem to jump around, this involves a preference within OpenOffice.org. For now, if you find it annoying, simply put the Insertion cursor in the first paragraph you are selecting move down to the last paragraph and hold the shift button while clicking on the last paragraph to select all the paragraphs in-between.
If you simply want to skip adjusting the Numbered Lists to the remaining Amendments, go ahead, this was added just to familiarize you to Numbered Lists and how the "Numbering" styles do not automatically add the numbers to the list and will not have any affect on the rest of this tutorial.
Working with Paragraph Styles
Now that the "grunt work" of this tutorial is finished, we can focus on the functional things that you can accomplish because you are using Styles. The first item we will cover is automatically adding a Table of Contents to your document.
Adding a Table of Contents
Normally, if you use a Word Processor as a glorified typewriter, creating a Table of Contents can be one of the biggest wastes of time that can be done using a Word Processor. Not only do you have to get the formatting correct, but you also must find out what is on what page number, etc. and heaven forbid you actually change anything that will move things to different pages.
Thankfully, you will now use styles to format your pages and let the software format the table and keep track of all that other stuff (such as page numbers) for you. As you probably have figured out by now when you used the Navigator, we have been using different Heading Numbers to specify the importance of each Header in relation to the others, somewhat similar to an outline. Writer will use this information to automatically format your Table of Contents.
So, go back to the first page of your document where the Title and Subtitle are. Now put the insertion cursor at the end of the subtitle, now click on Insert -> Indexes and Tables -> Indexes and Tables... The Insert Index/Table dialog box will appear.
If you simply click on OK, a Table of Contents will be inserted that will list every heading - Titles, Articles, Sections and Amendments. For short documents, or documents with quite a few headers, such as this one, this is probably not what you want.
To reduce the amount of headers included in the Table of Contents, you will want to adjust the "Evaluate up to Level" number. It defaults to 10, which would probably include any header you insert into any document. Since we only have a small document, we only want the main headers, so change this to 1 then click OK.
There are quite a few other options on the "Insert Index/Table" dialog box, these will be covered in more detail in a later tutorial. Just note that if you adjust anything that moves the headers to other pages, you must also "update" the Table of Contents. To do this, simply right click on the table and select Update Index/Table. You can also update everything in the document, including the Table of Contents by selecting Tools -> Update -> Update All.
Modifying Paragraph Styles
One of the greatest strengths in creating your document to use styles is the fact that when you want to modify something with your document, such as a Chapter or Section header or simply the font of the text body, you simply modify whichever style you set for the Section and all similar objects are adjusted automatically.
Say, for instance, that you have an editor, professor or instructor that likes to change their minds on what font is used for headings or text body, or that they want the paragraph spacing to be spaced at 1.5 em instead of double spaced. If you decided not to use styles, it would take quite a bit of time to actually locate every header or select every normal paragraph just to adjust your document to fit their needs. Using styles these changes can take mere seconds and are change throughout the entire document so you don't have to worry about missing any headers/paragraphs.
To adjust paragraph styles, simply right-click on the style you want to adjust and select modify.
This will open the style's property sheet which contains a few tabs with settings you can adjust. Go ahead and find the Heading 1 style and open the property sheet for it.
The tab that should be active is the Organizer tab, this tab shows the basic usage of the styles. The Name section allows you to adjust the name that the style uses. This will only work with styles that you create, not the ones available through the template that you use.
The Next Style entry allows you to change the style that gets activated when you hit return. Remember when you set the Title style, entered the title metadata then hit return, the next style was subtitle - this is where you set that functionality.
The Linked with entry allows you to set the "parent" style. For instance, by default OpenOffice.org has Heading styles 1-9, but it also has just a "Heading" style which all of the other Heading numbered styles are linked to. What this means is that if you adjust just the "Heading" style, all of the other Heading numbered styles will reflect the change (unless it specifically sets a different value for the adjustment). For example, if you want all of the Headings to use a serif font, such as Times New Roman instead of the default san-serif font Arial, then you would adjust the font within the "Heading" style and all of the "Heading #" styles would reflect the change. However, since many of the "Heading #" styles set a specific font size, an adjustment to the font size of the "Heading" style may or may not be reflected across all of the "Heading #" styles.
Finally, the AutoUpdate checkbox allows any manual change that you make to a style (such as highlighting a Heading and adjusting the font size) to be propagated to all of the other paragraphs that are of the same style. This may or may not be what you want (I never use it as I prefer to make any style adjustments using the style property sheet).
This tutorial won't cover all of the adjustments you can make to paragraph styles, but we will show you how styles will be adjusted across the entire document. So, go ahead an open the Heading 1 style (if it is not already open) and go to the "Text Flow" tab. Here we are going to specify a Page Break before every Heading 1 style, this way every section will start on a new page.
What you will want do is simply click the Insert checkbox within the Breaks section, set the type to a Page Break, and set the position to "Before". Now click OK to apply the changes and your document should have all of your Heading 1 styles (Preamble, Aritcles, etc) at the start of a new page.
Now that the page numbers have changed for your Table of Contents, go ahead and update the table by either right-clicking on it and select update, or use the Tools -> Update -> ... menu item.
Adjusting the Title, Subtitle and Headings
Since our first page of the Constitution looks somewhat bare, you have somewhat of a basic understanding of modifying styles, go ahead and adjust the Title and Subtitle styles to allow for extra whitespace to be added above the Title and below the subtitle. Also go ahead and change the Title style to use a serif font and increase the size if you want.
Now that you have a good understanding of that, go ahead and modify all of the "Headings #" styles that we have used within this document so the change is more apparent than what the default styles reflect.
Adding Whitespace to the Text Body
Some Editors, Professors or Instructors require documents to have a "Tab" at the beginning of every paragraph of the text body. Others consider this to be a drawback from the typewriter age and consider it to be unnecessary if your document has extra space between the paragraphs. Well, since this is an older document and our text body paragraphs don't have too much extra "space" between them we are going to add the extra "Tab" before each paragraph.
Doing this with styles is quite easy, simply modify the "Text body" style and specify that it use an additional .25" space on the first line, when you apply the change all of the paragraphs within the document body will have an extra "Tab" at the beginning.
Working with Page Styles
Those coming from a Microsoft Word background may find this section pretty interesting, as Word handles page formatting across the whole document while OpenOffice.org Writer handles Page formatting only across the page style (not the whole document). This is also the reason why many people moving from Microsoft Word to Writer have a slight difficulty in adjusting the page margins using Writer as the "Property Sheet" for this function is located differently in these two programs. In Word it is located at File -> Page Setup -> Margins and in Writer it is either in Format -> Page -> Page or by Modifying the Properties of the relevant Page Style.
Assigning Page Styles
You can assign page styles in a few different ways. First you can simply right-click the status bar where it indicates which Page Style is in use for the current page. Alternatively you can locate the Page Style you want in the Stylist and double click it to activate it for the current page.
So, go ahead and change the page with the Title, Subtitle and Table of Contents to be a "First Page", keep the rest of the pages as "Default".
Modifying Page Styles
You can modify Page Styles in the same way you modify Paragraph Styles, simply right-click the style you want, then select modify
Go ahead and open the Property Sheet for the "Default" Page Style. As you can see, the Organizer tab is very similar to the same tab when modifying Paragraph Styles. The important difference however is applying the correct "Next Style" for how you want for your document layout. For small documents setting the next style to be "Default" is a sensible solution. For larger documents you may want a separate Title Page and Index Page or maybe a separate "Left Page", then a "Right Page" for duplexing.
Probably the most changed settings in reguards to Page Styles occur on the "Page" tab. Here you can specify the paper size, the orientation and the margins. You can also adjust some advanced settings under the "Layout Setting" section such as page layout and numbering styles.
Adding a Header or Footer
Adding a header/footer using Writer is tied to the Page Style Function. This means that you can have different headers depending upon the page style layout you are using. For instance, if you wanted you can create a Left Page style and a Right Page style and have different headers on each page. Also, when you add a header, all of the pages that are specified with the same page style will utilize the same header or footer.
Lets add a footer to our document, first open the "Default" page style properties. Go to the "Footer" tab. Simply check the "Footer On" checkbox and hit OK. You will see that all of the pages that are styled as "Default" should now have a footer.
Now to add text in the footer simply put the Insertion cursor within the header, now you can either type, or add Fields to your footer. Go ahead and Insert the Title Metadata field that we created, Insert -> Fields -> Title. Now add the page number by hitting Tab until the cursor is located along the right side, type in Page then Insert -> Fields -> Page Number.
Once that is done, you may notice that there really isn't anything separating the actual document text from the footer, to add a line, simply re-open the "Default" Page Style properties, then go to the borders tab. Select a .5pt border then add it along the top. Now you should have a nice line break before the Footer.
We are just about done with this tutorial, the last thing I want to show you is how to add a footnote to your document. What you will want to do is go to "Amendment 18" (quickly go there using the Navigator). Put the Cursor after the 18, then click on Insert -> Footnote.
The insert footnote dialog will come up, simply keep the settings to Automatic Numbering and the Type to Footnote and click OK. The cursor will automatically drop to the bottom of the page, just above the Footer with the Footnote number already entered. Simply type the footnote, such as that the 18th Amendment was later repealed, then click back on the text body.
If you go on to add any other footnotes, Writer will automatically keep track of the numbering for you (even if you insert one before the one we just added).
That just about wraps up this tutorial. We covered quite a lot of material, but hopefully you picked up why it is much better to use styles than simple manual formatting of the document. Once you get these basics down, it is very easy to quickly generate professional looking documents - even without a background in Page Layout Design.