Recent posts

#51
General Discussion / Re: [TOC] get an attribute dir...
Last post by a.l.e - March 23, 2024, 10:18:46 AM
hi craig

hard to say something...

your announcement was "Scribus now has a style based TOC"...
and since scribus already had a TOC that the team seemed to like, seeing a style based TOC that basically replicates the old one (with almost all the drawbacks mirrored) gave me bad vibes.

sorry, if i misunderstood your goals.

it might be useful if, the next time, you could also announce the work you still plan to do.



i made a second quick test this morning and, while i see some improvements (the massive duplication is gone):

  • the UI is... well... a polite german would call it "gewöhnungsbedürftig" (i guess it can be translated with "there is room for improvement")
  • the order of the titles in the toc is not what most users will probably expect.
  • chained frames are not correctly processed.
  • frame and column breaks really need to be stripped from the toc entries (to be honest, the way those breaks work should be fixed instead; but that's probably not going to happen (soon)).
  • number placement must probably be a per level setting (not because one would want to place left or right on each level, but because one might want to exclude the number from some levels! and a wild guess: left placement might be necessary for RTL text)
  • "Default Paragraph Style" is now missing from the list of document styles for the TOC.
  • the styles in the "Heading styles" are alphabetically sorted (they should be at least in insert order; but, at the end of the day, it should be possible to sort them manually; and the toc styles should follow; sane people will call their styles h1, h2, ... but you can't assume that!)
  • it should be possible to add multiple times the same TOC style (and the "Paragraph Style" at the top should be disabled when the TOC is style based)
  • in the styles list, the "Delete" button does not work correctly (it stay disabled when all styles have been removed)

no idea which of those points are already clear to you and where the feedback is useful.

i attach another simple test file and a screenshot of the UI (since most people won't be able to try this out...)
#52
Beginner Talk / Re: adding pdf's or images to ...
Last post by Nermander - March 23, 2024, 08:19:49 AM
How much RAM do you have?
#53
Beginner Talk / adding pdf's or images to Scri...
Last post by John - March 23, 2024, 04:33:00 AM
Adding pdfs or images to document slows down typing in text frame considerably.
Troubleshooted versions 1.6.1 and 17x. Tried using MacOS 2016 and Mac Studio 2024.
Resolution set to 'Normal'
Adding just 2 images to MacOS 2016 slows it down.
Adding 9 images to Mac Studio slows typing down. i.e. I type and there is a delay for the letter to appear on the screen.

Any suggestions.
I am very new to Scribus.
#54
General Discussion / Re: [TOC] get an attribute dir...
Last post by MrB - March 22, 2024, 10:45:14 PM
A lot of those things were already in the works.
I already committed a fix for the duplicate lines a couple of days ago
I've now added styles per heading.
I've never seen a TOC with different page number placement (ie start or end)
- Removed the [Default...] style
- rearranged doc setup ui
- Added remove line breaks code but not enabled yet.. it means joining separate paragraphs.. still to do.
- Removed the 1 from the first TOC naming
#55
Scripts and Plugins / Re: problem with execution off...
Last post by utnik - March 22, 2024, 12:25:47 PM
hi loudo

unfortunately i can't help here.
i hope craig bradney will find a way to solve the tkinter-macOs-problem in the near future...

utnik
#56
Scripts and Plugins / Re: problem with execution off...
Last post by loudo - March 22, 2024, 09:45:26 AM
Hi Utnik,

Ok, so maybe I need to ask scribus to search this folder.
Do you know if this is possible and how to do it?
#57
Scripts and Plugins / Re: problem with execution off...
Last post by utnik - March 22, 2024, 04:55:26 AM
hi loudo

you're right. i found a folder called 'tkinter' inside of the 'scribus.app'.



i don't know, why scribus should search for another version...

utnik
#58
Scripts and Plugins / Re: problem with execution off...
Last post by loudo - March 21, 2024, 04:21:25 PM
But I don't install Tcl package.
Scribus don't use its own package ?
#59
General Discussion / Re: [TOC] get an attribute dir...
Last post by a.l.e - March 21, 2024, 11:02:32 AM
Today, I have a bit more time.
Here my first impressions about the TOC in Scribus:



The Config > Tables of Contents dialog is not comfortable to use and some important features are missing.
(Some of the issue might already have been there before introducing the styles in the TOC...)

The top half of the dialog is by default empty and stays most of the time almost empty:
the huge majority of document with a TOC will only have one single TOC.
And when the user gets for the first time into this dialog, the goal is to define a table of contents!

I'm suggesting to pre-fill the list of TOCs with "Table of Contents" (without the "1"! The second one gets a "2") and make the list much smaller.
I guess that the TOC should only be saved in the .sla, if it has a minimal definition (at least one level defined...).

On the other side, the most "important" part of the dialog is probably the matching of heading and toc paragraph styles.

For each level we need (at least):

  • the heading paragraph style,
  • the toc paragraph style (yes, we need different toc styles for each level!),
  • the page number placement.

So the first suggestion is to make the list of TOCs a simple list with two "icon buttons" (+, trashcan) and let the user change the name of the TOC by double clicking the entry in the list (no input field needed).
This list would be shown in the left part and on the rights side the TOC's settings.
The lower part would be for adding the levels with styles (or alternatively the attributes, if after having implemented a "usable" style based TOC you still think that somebody would want to use that...)

It could look somehow like that:

                                                                                                               
++---------------------------+-+-+-+-----------------------+-+                                                 
||table of contents         || |+| | type: [style |v]      | |                                                 
||                          || +-+ | source: [frame |v]    | |                                                 
||                          || +-+ | [ ] non printing      | |                                                 
||                          || |-| |                       | |                                                 
|+---------------------------+ +-+ +-----------------------+ |                                                 
|+---------------------------------------------------------+ |                                                 
||[h style |v] [toc style |v] [page number |v]             | |                                                 
||                                                         | |                                                 
||                                                         | |                                                 
||                                                         | |                                                 
||                                                         | |                                                 
||                                                         | |                                                 
|+---------------------------------------------------------+ |                                                 
|+-+ +-+                                                     |                                                 
||+| |-|                                                     |                                                 
|+-+ +-+                                                     |                                                 
+------------------------------------------------------------+                                                 
(https://textik.com/#153e79c2edb01a7a)

By the way, as you might have noticed, my TOC Python script does not have a UI.
The main reason for it, is that it's indeed not easy to create a good UI and opted for default values and using the attributes.
But here now we have a UI and, as it is now, it forces lot of unnecessary mouse movements and scrolling that can be avoided.



One further important issue: picking the destination frame!
Do you really expect the user to know the name?
I see two possible solutions (which are not mutually exclusive):

  • If a frame is selected when opening the settings, propose or use that frame as the target one
  • If a frame is selected when running "Generate TOC" rename the menu entry to "Generate TOC in this frame" (or add such an entry)
  • (Adding a "pick a frame" button is probably way to complicated and -- while being a nice idea -- it's way to complicated to implemented for its use)



I leave it open, if the TOC definition should stay in the document configuration, or if it should be moved to a separate dialog that can be triggered when a frame (the one containing the table of contents!) is selected.

In my script, I went for defining the TOC as a set of attributes on the target frame, so it seems to be possible to define it outside of the settings and it might be even easier to do so!

It might also be necessary to individually update the TOCs, which might be easier with a separate dialog.



Still the UI: the "Generate Table of Contents" menu entry is disabled by default.
I'm not sure if would be a good idea to start the Document Settings, since the user then would expect to use that menu entry for modifying the settings.

It might be worth exploring the idea to add tooltips to menu entries that are deactivated for non trivial reasons (we do not need to explain why you can't load an image on a text frame...).

This seems to to be possible with Qt 6 (not tested):

https://stackoverflow.com/questions/60484006/how-to-include-tooltips-for-menu-items-in-qt

(This is probably not needed if we get two menu entries, one for defining the current TOC, the other for generating all TOCs.)



On top of that, there are features that have been requested and are implemented in the script:

  • Optionally, remove the end of lines from the title (per level or for the whole TOC; strip them or truncate after the first one).
  • Remove the end of frame / end of column signs from the titles (yes, depending on how you define them, they will be part of the title)-
  • It should be possible to create the paragraph styles from the TOC dialog (it's not necessary to  define them, just ask for the and create the style; maybe ask for a base style, since it might be painful to change it later; the script creates a set of pre-defined styles)



Finally, a few bugs I stumbled upon:

  • In my screenshots you see that -- for reasons that are unknown to me -- some entries are repeated multiple times.
  • In the settings dialog, the first (and default) entry is "[Default Paragraph Style]" and when hitting "Add" while it's selected, an empty entry is added to the list styles (i guess that the list should only contain real styles...)
  • The frames are read in z-order: by default they should be read top down and left to right (of course in an official tool we should consider RTL...)
  • For linked frames, the order on the page should be ignored (what comes first, shows up first: what counts is the position of the first frame of the chain on the given page).



Lot of text, sorry... Probably, just reading the README, the code and the other thread would have been shorter : - )
#60
Scripts and Plugins / Re: problem with execution off...
Last post by utnik - March 21, 2024, 04:52:15 AM
hi loudo

i never managed to run one of the tkinter related scribus scripts under mac os. there are some open bug reports on this topic and a request to include tkinter in the dmg.
it looks as your version of tcl is not exactly the one scribus is looking for to run the script.

Quote from: loudo on March 20, 2024, 11:05:44 PM...version conflict for package "Tcl": have 8.6.13, need exactly 8.6.12
    while executing
"package require -exact Tcl 8.6.12"

utnik