Generalise a complex style

Previous topic - Next topic

PK

Hi,

I need to create  for a book a header style following by an image (here a vector image). I can do it by hand, but there are a few to do, so I prefer an automate method :D

I'd like to create a complex style, that is a combined style, including a text (variable) and an image (fixed). I searched a little bit, but it seems not possible to do...

Can anyone confirm?

I fear to have to script for having what I need...

Thanks and happy new year,

PK

PS : thanks for the 1.6 version. I still use the 1.5.8 one for the moment...

a.l.e

#1
i guess that the variable text is the chapter title?

a few people have requested the feature lately and i'm not sure that it will be easy to add it to scribus soon (i fear that somebody should go through the current implementation of the references and make them rock solid, probably by rewriting them from scratch)

i took some notes and i will try to write a script that can be used for running titles. based on styles.
even if that's not what you need, it might be possible to adapt it to other use cases.

PatJr

dunno, have a look at the inline graphics and the scrapbook
not automatic

PK

Quote from: a.l.e on January 10, 2024, 12:45:48 PMi guess that the variable text is the chapter title?

Yes it is. I forget to precise, but it is the case.

Nermander

I agree with PatJr here, I don't think a style is the way to go.

Break the contents up in chapters so you have the heading in a separate frame (where you can have an inline graphic).

PK

Quote from: Nermander on January 10, 2024, 05:15:54 PMI agree with PatJr here, I don't think a style is the way to go.

Break the contents up in chapters so you have the heading in a separate frame (where you can have an inline graphic).

Thanks, but this is the same solution as to deal all by hands :(

Moreover, for this particular book, the chapters are not real chapter: it is a continuous flow... The current solution is to add a graphic frame over the space between the title and the text... But it is a bit long to set up by hands and this is the reason why I search a solution more efficient (a little bit as TeX can propose).

The nicest solution should be a 'style' that proposes a glue with a text frame and a graphic frame, with the text as variable...

I will think about it with a script if it is possible. My question was if the solution still exits, for not reinventing the wheel  :o

Nermander

You can have inline graphics. Just copy the graphic and paste it in the text frame. Sure, you need to paste it at the end of every heading, but at least it will move with the heading (which a picture frame will not).

a.l.e

as said, i have an idea how to solve this with a script...

i'm going to try something this evening.

in the meantime, could you post a .sla with a couple of sample pages?

it does not need to contain the real content.
it's enought to have some dummy content, with the titles with an appropriate style (h1 would be best...) and an header in the masterpage with a simple graphics (like a square) and the first title...

PK

Quote from: a.l.e on January 10, 2024, 08:21:37 PMas said, i have an idea how to solve this with a script...

i'm going to try something this evening.

in the meantime, could you post a .sla with a couple of sample pages?

it does not need to contain the real content.
it's enought to have some dummy content, with the titles with an appropriate style (h1 would be best...) and an header in the masterpage with a simple graphics (like a square) and the first title...

OK, but how to send you this .sla?

I'm preparing the doc.

Thanks

PK

QuoteOK, but how to send you this .sla?

I'm preparing the doc.

Thanks


Ok, I found finally :)

The concerned part begins at the page 11 (that means that you can remove all the 10 first page if you want a slicer doc)

Feel free to ask me more if you need more.

Thanks you

PS: I use finaly the 1.6.1 version of Scribus, then the doc is 1.6.1

a.l.e

here is a first version of my script:

https://github.com/aoloe/scribus-script-repository/tree/master/headers_with_chapter_titles

i have modified test.sla to get it to work with an unmodified version of the script:

- i've changed the name of the frames in the master pages to running_title_Normal_gauche (and droite)
- marked the two heading frames in the master page as "not to be printed" (please take into consideration https://bugs.scribus.net/view.php?id=17117 )
- i've renamed the style Texte1_Heading 1 to h1.

both the 'running_title_' and 'h1' can be modified at the beginning of the script to suit your needs.

does the script somehow do what you need?

PK

Quote from: a.l.e on January 10, 2024, 11:06:14 PMdoes the script somehow do what you need?

First, thank a lot for your help.

I'm not sure to understand what does really this script. I run it in your doc and it changes the title of the page by adding 'Title1' in front of the current title. It does not change anything else in the document.

When I try to copy past the current text by duplicating it, the document does not apply the result: the second part of the past is still invisible. May be is it due to your h1 style?

What I need in fact is to add automatically the figure under the current style h1, without placing it by hands. What I understand by reading your script is that it changes the current h1 style in an other style.

Then my ideal script should take all the h1 paragraph, copy it again, then add a dedicated graphic frame (with the ability to place it as you want). Then the dedicated parameters of the script should be:
- the header style (here h1 in your example)
- the figure file location
- the parameter of placement (centerline (or the horizontal capabilities), height from the h1 paragraph, height before the figure)

I have an idea how to do it, but I do not know if it is possible to get enough information to place the graphic frame from the internal h1 frame (without rendering it independent, which could be a solution, but it needs to form again my doc) 

PK

Quote from: PK on January 11, 2024, 08:14:03 AMWhen I try to copy past the current text by duplicating it, the document does not apply the result: the second part of the past is still invisible. May be is it due to your h1 style?


For this, the blame for me. I copy-past with the tab. If I copy-past only the text, it is running.

Then, I could have understand what your script really does: it take the H1 style and put it in the title of the page for the whole document. It is nice, - and sure I may use it one day - but it is not what I need now. See my explanation before.

Thanks any case for this script... (ideally should replace the current title, but it seems not to be to hard to modify the current script in order to do this).

a.l.e

yes, my script does a "normal" running header.
and i'm pretty sure it will be useful for many other users : - )

i was wondering if you wanted something to be done with that image, but i could not figure out what.

i'm still not 100% sure what you really want to do (since the image only appears once in the document you uploaded.
but you might be "confusing" header and heading?
header is an "en-tête" and heading a "titre"...
you also wrote of "title", but then have "Title" in the header : - )

so, do you want the gears to appear below each chapter title in your document?
will they always be at the same height or the position will depend on the length of the title?
does every chapter have the same image?
what exactly is cumbersome there?

just a hint: if you put an item in the scrapbook, you can then double click on the scrapbook item and get it inserted at same position where it was originally (but on the current page).
since the scripter cannot (yet) access the scrapbook, there is no way (for now) to automate this.
and if you use symbols (linked scrapbook items), you can even modify the original image and see the changes applied in each "copy".

depending on what you want to achieve, there are also welded items at your disposal... but that's an experimental feature and might or not work as you expect (or even as it is intended).
then, when you move the title, the gears below would move with it.

let's hope that this time the notes above go in the right direction : - )

PK

Yes, I'm so confused: you're right. I have done a salad with the terms  >:(

I want a heading in the current text, following by the same figure all the time. The heading is variable (of course!) and the figure is still at the same position under the heading.

My scope is to set up a typographic ornament (cf. https://fr.wikipedia.org/wiki/Ornement_(typographie), sorry there is no English page: type 'ornement typographique' in your search engine and select the images).

So, the ornament is still the same, and placed all the time in the same way after the title of the paragraph.

For the moment, I use vertical rulers for setting it by hands, but there are many and many to do... And there are many books to do too :(

By an automatic insert, I will have only to correct the awkward cases by hands (like the leak of space at the end of page or the unfortunately cut (header and ornament separation)).