Save and Apply Styles like CSS?

Using them, Making them, Finding them
Post Reply
dkaczynski
Posts: 2
Joined: Thu Mar 24, 2011 5:47 pm

Save and Apply Styles like CSS?

Post by dkaczynski »

OK, I'm trying to make the following scenario work:

1) I am writing a document, and I'm using modified versions of styles, such as Heading 1, Heading 2, Content Heading, etc.

2) I want to apply these modified styles to an existing document. The existing document is using the same style identifiers (Heading 1, Heading 2, etc.), but I want the style settings to be overridden with the modified styles from the first document.

I think a good analogy of this is how .html files use a single CSS stylesheet. As long as the html files use the same tags (such as h1, h2, etc.), any of the .html files can benefit from the same stylesheet.

Suggestions? Comments?

Thank you in advance
Dave
OpenOffice 3.3.0 on Windows XP SP3
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Save and Apply Styles like CSS?

Post by Villeroy »

F1 help on 'loading styles' wrote:Using Styles From Another Document or Template
You can import styles from another document or template into the current document.
1. Choose Format - Styles and Formatting to open the Styles and Formatting window.
2. Click the arrow next to the New Style from Selection icon to open the submenu.
3. Choose Load styles.
4. Use the check boxes at the bottom of the dialog to select the style types that you want to import. To replace styles in the current document that have the same name as the ones you are importing, select Overwrite.
In File>Templates>Organize... you can use Ctrl+Drag&Drop to copy styles between templates and loaded documents.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
rudolfo
Volunteer
Posts: 1488
Joined: Wed Mar 19, 2008 11:34 am
Location: Germany

Re: Save and Apply Styles like CSS?

Post by rudolfo »

An alternative approach would be to include the document into a master document (.odm extension). Although the aim of master documents is different you can use them as "view wrappers" around a .odt document. Style definitions in a master document will overrule the styles in the document itself (if you view/print the file inside the master).

Be careful with the analogy with Cascading Stylesheets. In html a paragraph can have multiple class attributes and can inherit from multiple places where styles are defined. That's the "cascading" part. If you know Firebug, DOM Inspector or other web inspection tools for styles you know what I mean. OpenOffice is not that flexible. Styles can inherit from parent styles (F11 Stylist in hierachical view), but when it comes to conditional formatting in a spreadsheet styles can't be merged, but you need a style on its own for each condition.
OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7
There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.
dkaczynski
Posts: 2
Joined: Thu Mar 24, 2011 5:47 pm

Re: Save and Apply Styles like CSS?

Post by dkaczynski »

I'm going to create a template so that future documents don't have this issue, but this should provide plenty of ammunition for my current situation. Thanks all
Dave
OpenOffice 3.3.0 on Windows XP SP3
Post Reply