Scribus Forums

Community => Showcase => Topic started by: PK on January 18, 2024, 09:39:12 AM

Title: Import text with style, but only the used styles
Post by: PK on January 18, 2024, 09:39:12 AM
Hi,

I import a text from on odt document. This document uses only a few number of styles, but it contains a style for all the cases, then it contains a lot of styles. When I import it in a text frame, Scribus import all the styles, and I would like to have only the used style.

First, I tried to import only the used style from a previous Scribus doc crash test and then to import the odt document as 'text only', but Scribus imports all the styles.

There is no way to destroy by hands the unused styles: they are too many... Except if it is possible by doing it with editing a configuration file by an text editor...

Is is possible to keep only my used styles?

Thanks,
Title: Re: Import text with style, but only the used styles
Post by: PatJr on January 18, 2024, 03:32:25 PM
not sure I follow everything, to import just text I usually cut and paste the text to a text editor, notepad, geany, bluefish,... and the save that or just cut and paste the text again to a scribus text frame
Title: Re: Import text with style, but only the used styles
Post by: PK on January 18, 2024, 03:44:53 PM
Quote from: PatJr on January 18, 2024, 03:32:25 PMnot sure I follow everything, to import just text I usually cut and paste the text to a text editor, notepad, geany, bluefish,... and the save that or just cut and paste the text again to a scribus text frame

This is a complex book and I need to preform it with styles with a front-end tool like LibreOffice. Scribus is a little bit poor for managing styles on a long text. My target is to spare time with getting all the styles (or almost all the style) in my Scribus document as a beginning document, that I can eventually correct by hands for having my final doc. To do a few hand modifications is feasible, not a lot ;-)
Title: Re: Import text with style, but only the used styles
Post by: Nermander on January 18, 2024, 03:51:39 PM
Maybe look for a way to remove unused styles in Libreoffice before importing?

But googling seems to indicate you can not remove the default styles, only your own unused styles...
Title: Re: Import text with style, but only the used styles
Post by: PK on January 18, 2024, 03:57:47 PM
Yes, it would be ideal. I tried, but it is full-time work  :'(

All the scripts that I found did not work... and I'm not very friendly with the LibreOffice scripting...
Title: Re: Import text with style, but only the used styles
Post by: a.l.e on January 18, 2024, 05:26:10 PM
scribus already has a "remove unused colors" and when deleting a style scribus already seems to check it is in use...

it might be easy to add a "delete unused styles": would you mind opening a ticket?
Title: Re: Import text with style, but only the used styles
Post by: PK on January 18, 2024, 05:29:32 PM
Quote from: a.l.e on January 18, 2024, 05:26:10 PMscribus already has a "remove unused colors" and when deleting a style scribus already seems to check it is in use...

yes, but when there is many styles, it is hard to do by hands.

Quoteit might be easy to add a "delete unused styles": would you mind opening a ticket?

OK. I do ASAP.

Thanks.
Title: Re: Import text with style, but only the used styles
Post by: AdmFubar on January 19, 2024, 04:14:40 AM
I've not looked at .sla file directly that contains text style, but shouldnt there be a section in the .sla that has the defined styles and one could delete them using a text editor and then re-save.
Title: Re: Import text with style, but only the used styles
Post by: Nermander on January 20, 2024, 08:15:00 AM
How would you know which ones you can delete? Say there are 70 styles and you are going to delete 50-60 of them. Will the SLA tell you which ones are used or not?
Title: Re: Import text with style, but only the used styles
Post by: a.l.e on January 20, 2024, 08:49:51 AM
i have to correct myself: i was under the impression, that when deleting styles, scribus was detecting if the style was in use or not.
that's not true: it always ask to replace it.

on the other side, for once i agree that the xml based approach might this time at least be part of a temporary solution.

but before that, i wonder why so many styles get created and if there is a way to avoid that useless styles get created.
Title: Re: Import text with style, but only the used styles
Post by: AdmFubar on January 20, 2024, 08:14:38 PM
Quote from: Nermander on January 20, 2024, 08:15:00 AMHow would you know which ones you can delete? Say there are 70 styles and you are going to delete 50-60 of them. Will the SLA tell you which ones are used or not?
I'd start with a fresh document, and check what styles are present if any, then import the text, and recheck the .sla for the differences.