3. Text processor

Surely everyone knows how to use a word processor. But as you will see many things can be done easier and in a more comfortable way. We will be using Libre Office.

The key thing, which we would like to teach you is to separate content from format. For example, appearance of all headers of chapters will be define once for the whole document and will not be connected with content of those headers. The headers will only know that they are headers. In particular we will be able to change appearance of all headers changing something only once in our document.

To achieve this we will be using styles — their will be the main topic in this lesson.

We will be working on this document to achieve finally this form. Let’s start.

Paragraph styles

Let us start with the title. To format the title we will use a style. We will tell a fragment of the document what it is (e.g. a title), and then we will define how a title should look like. We will need the style-list window. To see it press F11 or click Format -> Styles and formatting.

You will see a window with 5 small tabs marked with small symbols. We are interested in the first two: paragraph styles, which applies to a whole paragraph and character styles, which can apply to any selected piece of document.

You can see that right now the whole document is formatted using the Default style. We would like to have an indentation of 1cm in the whole document. To have them we can modify the Default style by clicking with right button on it and choosing Modify. In the tab Indents and spacing we write in 1cm in the First line field. Press Ok, and we are done.

Let’s deal with the title. First let us tell the first line that it is a title. Put the cursor anywhere in it and double click the Title style in the style-list. Now we modify the style. Get rid of indentation of the first line and move to the Area tab. Set colour to Orange 2. In the Font tab choose Arial Black and size 66pt. And we are done.


We change margins by clicking Format -> Page -> Page. Set all the margins to 3cm.

Document properties, header and footer

Start with adding some data about the document. File -> Properties -> Description. Insert the title: Komputer.

Now let’s generate the data which should appear in the headers an footers. Insert -> header. Fields in the header are not created manually, but generated automatically. Insert -> Field -> Title. Then press space and Insert -> Field -> Time.

Similarly we create footers. Insert -> Footer. We centre the footer horizontally using a button from the toolbar. Next click Insert -> Field -> Page number, and put hyphens around it.


Now we insert the image. Download it and save it to your home directory. Put the cursor at the start of the first paragraph and click Insert -> Image. Find the file you have saved and click Insert.

Now modify its size and position by clicking on it using right button and choosing Image. In the Type tab check keep ratio and change width to 8.71cm. Set the horizontal position to 0cm with respect to the paragraph. In the Wrap tab choose After and set spacing on the right side to 1cm.


To insert a footnote after the first word in the first paragraph click Insert -> Footnote/endnote. Leave default settings and press ok. In the footnote type: Za Wikipedią.

Headings of chapters

Let’s move to the headings of the chapters. We will use styles Heading 1, Heading 2, and so on to format them. The numbering in names in those styles does not refer to the order of the heading but to the depth of subchapters. The Heading 1 style is a style used to format the headings of main chapters, Heading 2 – of subchapters, Heading 3 – of subchapters of subchapters, and so on.

We start by telling all six main chapters’ headings that they are Header 1. In the chapter Typy komputerów we also have 6 subchapters. We set their styles to Heading 2.

Now we modify those two styles. Right-click on Heading 1 in the style -list and choose Modify. In the Area tab choose colour Chart 10, and in the Font tab change font to bold Arial.

In the Heading 2 style set the area colour to Yellow, and the Font to Arial, bold italic, 14pt.

Character styles

To create the enumeration of chapters first we need to modify one of the character styles. Find in the character styles tab in the style-list the Emphasis style and right-click on it an choose Modify. We would like to have the enumeration of the chapters sky blue, so in Font effects tab change the colour to Sky blue 6 and click ok.

Numbering of chapters

Some people type in the number of each chapter manually. It seems like an extremely bad idea, because any changes in the structure of the document generated a lot of work involving renumbering of the chapters. That is the main of many reasons why one should use the automatically generated numbering.

Click Tools -> Outline numbering. You will see a window in which you can define the details of the numbering on subsequent levels. Start with level one. Paragraph style is just the style which defines which paragraphs will be numbered, so we leave Heading 1 there. We choose numeration with arabic numbers, starting with 1. We choose the Emphasis style, which we have just modified, as a character style. It will be used to format the numbering. Finally we would like to have the word Część before the number, so we type it into the Before field with a space afterwards. After the number we would like to have a dot. We put it into the Behind field with a space again.

Now we switch to the second level. Choose capital letters as the numbering. As before use the Emphasis style. We would also like to see the number of the chapter in the subchapter numbering, so we increase Show sublevels to two. And we an a dot with a space to the Behind field. Click ok, and enjoy effects.


Sometimes we would like to refer to a different place in the document, e.g. chapter or page. Inserting numbers manually in the such references is a very bad idea since they may become false after further changes in your document. That is why we should always generate them.

In our document we would like to refer to the last chapter and its page after mentioning Turing in the first chapter. Type in “patrz rozdział na stronie”, and generate the numbers by clicking Inster -> Cross-reference and choosing chapter and page respectively.

Creating new styles

We will need two more styles, a paragraph style an a character style. There are two methods of creating new styles. Let’s use both.

First create a new character style named Numbers, which will be used to format numbers appearing in the text. First move to the character styles tab in the style-list. We have to choose a style which modified version we will save as the new style. In our case it is convenient to use the Emphasis style. Right-click on it and choose New. In the first tab type in its name: Numbers. In the Font effects tab choose colour Grey 8 and click Ok. The new style will appear in the style-list. To use it select a number in the text and double-click the new style in the style-list.

Now a paragraph style. We want to make the two pieces of text which look like a code of a computer program to actually look like it. We will create a new style: Program. Find a line 1+2+3+…+n = n(n+1)/2, we will start with it. Click Format -> Paragraph and in the Indent and spacing tab set indent before text to 3.25 cm and spacing before and after the paragraph to 1cm. Click ok. Let us save those setting into a new style. Select the paragraph styles tab in the style list and click on the far right button on the bar of the style-list. Choose New style from selection. Name it Program and click ok.

Finally modify the new style changing the font to Courier New and size to 10 pt.

Line breaking inside a paragraph and using tabs

Now we would like to set this style to a bigger piece of code in the text. But simply adding it there will not give the desired effect, because each line of the code is a separate paragraph. That is because each line ends with a paragraph break (enter). Replace all of them by a line break without breaking the paragraph which is can be inserted by pressing shift+enter.

Now we can set the style of this paragraph (now it is only one paragraph) to Program.

Definitely we also need to change multiple spaces in this paragraph to a tab. On the ruler above the page you can specify the length of a tab.

Bullets and numbering

The last tab in the style-list consists of bullet and numbering styles. We start by making a list from the items in the chapter Podstawowe elementy komputera. Select all three elements and set style List 1 for them. Next modify this style choosing arrows as bullets and in the Position tab inserting an indent of 1cm.

We use the same style to the list of computers at the end of the document.

Finally we would like to enumerate the famous people in the last chapter. Set style Numbering 1 for them and modify it choosing numbering in parenthesis. Set indent to 1cm and add additional text indent of 3cm.

Finding and replacing

We would like to replace now all instances of word “istnieją” with “są”. Click Edit -> Find and replace. In the Find field insert “istnieją” an in the Replace field “są”. Click Replace all.


We would like to create an alphabetical index at the end of the document. It will consist of two words: computer and PC. First find as before occurrences of word komputer. But it would be great to include also some grammatical forms of this word. We will use regular expressions, which should be checked in the additional options. Type in “komputer(a|y)? ” which means that all words komputer with optional additional letter a or y will be found. The space at the end guarantees that no longer words will be matched. Click Find all. Next click Insert -> Indexes -> index entry. Choose alphabetical index and press ok.

Similarly we add PC, but this time we do not need regular expressions. Instead we need to make sure to search for whole words only – an appropriate checkbox has to be checked.

Finally add the index itself. Place the cursor at the end of the document and click Insert -> Indexes -> index. Choose alphabetical index, give it a name and press Insert.

Table of contents

Finally it is time to create a table of contents. Place the cursor at the place where the table of contents should be inserted and click Insert -> Indexes -> indexes and choose Table of contents.

If you have changed the document after creating the table of contents, it can be easily updated. Right-click on it and choose Update.

Exporting to .pdf

You will find an appropriate button on the toolbar.