Importing LO Writer text without over-writing existing styles

Previous topic - Next topic

henrylaw

I am managing production of a newsletter which has contributions from various sources. All the contributions come in as Microsoft Word documents, and use a standard template with named styles, which allow the writers to see what their text will look like before they send it.

My job is to assemble all the copy into a Scribus document for publication.  I have a set of agreed paragraph styles which currently have the same name as those in the Word template.

I can import the copy by saving it as LibreOffice writer and then importing the resulting file.  That works well, but is a maintenance nightmare.  If I change the definition of a style within Scribus, which I occasionally do, then when the contributors' text is imported Scribus promptly replaces any changes I've made with the original formatting from the Word styles.  Sending out a new template to the Word users is difficult: they don't necessarily have the skill to install it properly; and I don't have MS Word anyway so I'd be trusting that a converted LO template would work correctly.

My current plan is to change the names of my Scribus styles, and then when each contribution is imported, using the existing style names, I can do a bulk change from a Word style names to my new Scribus style names. 

Yes, I know I can import just as plain text and then apply my own styles; that's laborious.  And I know I can import so as to give the imported styles a prefix relating to the name of the text box: I'd need to change each text box separately, and in a 24-page document that's tedious and error-prone.

Is there any better way?

a.l.e

I think that, for now, the only good way to do that is by using a Python script inside of Scribus.

If you provide me with a bit more details, I think I should be able to create something that can generally be used for similar cases.

I think that -- as an example -- you might want to provide:

  • three .odt files the three styles as you are getting them, and just a bit of text (one paragraph for each style, ...)
  • a .sla file with the three style already defined, and three text frames where the three .odt files are already loaded and manually formatted the way the should be; please remove any style that should not be in the final .sla
  • if any local formatting (italic, ...) should be imported, please make sure that they appear in the .odt
  • try to keep all the document as short as possible, but with enough content to allow to understand your task

henrylaw

Thank you for helpful reply. I'll work on a small but comprehensive test case along the lines you describe, but it will take me a little while to do properly ...

henrylaw

I'm attaching two files: I don't think more are required to show what I'm trying to do and what happens.  To reproduce the problem:

1. Load testcase01.sla into Scribus. Observe the formatting produced by defined styls "TestCase01"

2. Open the test Writer file testcase01.odt. It has a style with the same name, but it has different formatting.

3. In the Scribus document, open a new text frame and import testcase01.odt into it.  You'll see that the formatting from the Writer document comes in as it was in Writer, and the formatting of the existing text frame is changed to match it.


What I want is for the imported text in style "TestCase01" to be formatted according to the style defined in Scribus, not as imported.

henrylaw

BTW Scribus 1.7.1svn on Mint 22, fully up to date.