Difference between revisions of "Documentation/UserGuide/Formatting"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Direct format vs. styles)
(Templates)
Line 29: Line 29:
 
= Templates =
 
= Templates =
  
The immediate question after spending some time defining and modifying styles is ''how can I use these styles on a new document''?
+
The immediate question after spending some time defining and modifying styles is "''How can I use these styles in a new document''?"
  
 
{{Menu|File|Templates|Save}} will save a copy of the current document as a ''template'' that we can use on a new document with {{Menu|New|Templates and documents|Templates}} and double clicking on the needed template.  
 
{{Menu|File|Templates|Save}} will save a copy of the current document as a ''template'' that we can use on a new document with {{Menu|New|Templates and documents|Templates}} and double clicking on the needed template.  
  
{{Documentation/Note|It is important to note that not only the styles but also the ''content'' of that document will be saved on the template}}
+
{{Documentation/Note|It is important to note that both the styles '''AND''' the content of that document will be saved in the template}}
  
It is possible to do one step more and set our preferred template as the default template: {{Menu|File|Templates|Organize}}, double click on "My Templates", select the needed template and opening the {{Button|Commands}} button select "Set as Default Template" (this option is also available with doing a right click on the template on the list).
+
It is possible to go further and set our preferred template as the default template: {{Menu|File|Templates|Organize}}, double click on "My Templates", select the needed template and opening the {{Button|Commands}} button select "Set as Default Template" (this option is also available with doing a right click on the template on the list).
  
To modify an existing template, with {{Menu|File|Templates|Edit}} and browsing to the template file, or {{Menu|File|Templates|Organize|My Templates}} and selecting Edit under {{Button|Commands}}.  
+
To modify an existing template: {{Menu|File|Templates|Edit}} and browsing to the template file, or {{Menu|File|Templates|Organize|My Templates}} and selecting Edit under {{Button|Commands}}.  
  
Once the changes are ready, it is enough to save the document as a normal document.  
+
Once the changes are ready, save the document as a normal document.  
  
 
{{Documentation/Note|Once a Template is edited, if you open a document based on that template Apache OpenOffice will ask you if you want to update the styles. It is important to note that at that moment if we say "no" the association of the document with that template will be lost. For more information, see this report {{Bug|52783| - change templates for a document}}- }}
 
{{Documentation/Note|Once a Template is edited, if you open a document based on that template Apache OpenOffice will ask you if you want to update the styles. It is important to note that at that moment if we say "no" the association of the document with that template will be lost. For more information, see this report {{Bug|52783| - change templates for a document}}- }}
  
 
[[Category:Documentation]]
 
[[Category:Documentation]]

Revision as of 22:55, 4 March 2013

Template:Documentation/DraftPage


Introduction

In Apache OpenOffice it is possible to work in two different ways: applying format directly through the use of menus and toolbars, or through the use of styles.

Direct formatting seems easier, but can be problematic on complex documents. Styles seem complex, but are a really powerful tool that's easy to use once you get used to them: let's see why

Direct format vs. styles

The simplest way to understand how styles work is through a text document, but the concept is valid for all Apache OpenOffice components.

Suppose we're writing a long document with many chapters, and each chapter contains several sub-levels. The chapter heading needs to be written in a particular sans serif font (like Liberation Sans, Arimo, Arial...), in bold, and at large size. The body text must be in a particular, and smaller, serif font (tinos, times, or others).

While it is possible to do that with direct formatting, two specific problems arise: one of consistency (used 14 point instead of 16 for a heading, forgot to use bold...) and, perhaps more problematic, one of maintenance. If afterwards you decide to change the typeface, or its size, or the page margins...you'll need to do a lot of work.

Suppose that instead of setting "Liberation Sans, 16 point, bold, centered, five millimeters before the paragraph, three after..." we just use "Heading 1", and instead of "Liberation Serif, 11 points, justified..." we just use "Body text," having defined beforehand the specific parameters of "Heading 1" and "Body text." By separating the attributes applied to the text from the definition of those attributes the administration of documents becomes far easier. For example, to change the font used in the document we only need to modify the definition, not the document content, because that change in the definition will propagate without effort.

Beyond this, styles provide a lot more that just consistency and easy administration. They permit the creation of an automatic table of contents and numbered chapters, while allowing a particular set of graphical elements that use one style to display the same line style, or colour, or associated text. Finally, styles can even be used to set the format of a particular cell on Calc. Depending on its content, such formatting is more easily done through styles than direct formatting.

Styles can be "stored" on particular documents, called "Templates," that reuse the styles definitions. Defining styles is something that seldom needs to be done, but can be used a lot.

Administration and edition of styles

Beside Math, all Apache OpenOffice components make use of styles. These styles have their differences with each component, differences that will be treated on the corresponding chapters, but the workflow is always the same: opening the Stylists with  F11  or with Format → Styles and formatting it will be possible to modify an existing style or to create a new one with a simple right click. To apply one style to an element of a document, simply select that element and double click the desired style.

Templates

The immediate question after spending some time defining and modifying styles is "How can I use these styles in a new document?"

File → Templates → Save will save a copy of the current document as a template that we can use on a new document with New → Templates and documents → Templates and double clicking on the needed template.

Template:Documentation/Note

It is possible to go further and set our preferred template as the default template: File → Templates → Organize, double click on "My Templates", select the needed template and opening the  Commands  button select "Set as Default Template" (this option is also available with doing a right click on the template on the list).

To modify an existing template: File → Templates → Edit and browsing to the template file, or File → Templates → Organize → My Templates and selecting Edit under  Commands .

Once the changes are ready, save the document as a normal document.

Template:Documentation/Note

Personal tools