Is there an easier way to format table of contents ?

Previous topic - Next topic

oida

Hallo,

i just started experimenting with Scribus (1.5.8) for my project and there is one issue i have some headache, especially sorting the Table of contents. What i want: all enties sorted alphabetical and formatted as any TOC.
Well, what i do at moment is : Create the table, export the text and then i do it with cmd line "sort -k1 index.txt > indexsort.txt", the reinsert the file and format it with tabulator settings.

Is there a way to do this directly in Scribus ?

Thank you in advance for any help

a.l.e

Do you want to create an index?

Because I have never seen a TOC sorted.

Some time ago, i have been working on a script for creating an index in Scribus but I could not get to something i was happy with.

One for the reasons was, that I didn't have a real world sample to use as a reference.

If you're ready to share more details about the needs of your project and some .sla files, I might be willing to continue my exploration and, with a bit of luck, come up with something you can use.

oida

Hi,
thank you for your interest. I'm just retired and a enthusiastic Hobby Chef and some of my friends, better some of their wifes  :D asked me to share my recipes with them. And after retiring i have the time to do this.

To cut a long story short, the book will be about 50 - 80 pages and divided into usual Chapters like Starter, Main Dishes, Deserts and Snacks. These Chapters divide into "cold Dishes / hot food, green - vegan ..... In the index section all dishes should be assigned alphabetically.
I also consider using calibre to convert the pdf to ebook, so eventually a index based on the main ingredients would be an option.

On every recipe's page i will place a photo.

I am on the Linux side, my Software is Debian 12, Scribus Version 1.5.8, the used Hardware is a Lenovo Thinkpad P14s, AMD Ryzen 7, 32GB Ram

Hmm, i don't know how to attach a .sla file  ::) , so please give me a hint.

a.l.e

for your first goal (sorting the recipes alphabetically in each toc's chapter) you should indeed be able to use the TOC tool scribus provides (if your a bit of a masochist) or the TOC script i have created (https://github.com/aoloe/scribus-script-repository/tree/master/table_of_contents, if you're brave enough to want to learn how to run scripts inside of scribus), select the lines in each chapter and then use a script (i guess i will volunteer to create it) to sort the selection (so you will need to learn how to use scripts anyway...)

if you want an index with the ingredient, you will probably need to create a real index (or suffer a lot by duplicating the content in "hidden" fields and use the TOC tool provided by scribus... but i'm not sure it can do it).
but, even then, it all depends on how you want to present the result.

i don't know how much content you already have, but i would like to suggest you to start putting in three or four recipes and then manually prepare an TOC and an index the way you want them to be... and show the result.

finally, i will start a topic explaining how to share files in this forum and link it later...

oida

Quote from: a.l.e on February 26, 2024, 07:00:23 PMfor your first goal (sorting the recipes alphabetically in each toc's chapter) you should indeed be able to use the TOC tool scribus provides (if your a bit of a masochist)
Yeah, it wasn't that easy to figure out how the Scribus toc works but well, i have found that exporting the text, formating it in shell script and reimport it to Scribus is a little bit scary, but i'm on Linux for appx. 10yrs so that doesn't scare me to much  :D  :D  :D

Quoteor the TOC script i have created (https://github.com/aoloe/scribus-script-repository/tree/master/table_of_contents, if you're brave enough to want to learn how to run scripts inside of scribus), select the lines in each chapter and then use a script (i guess i will volunteer to create it) to sort the selection (so you will need to learn how to use scripts anyway...)


if you want an index with the ingredient, you will probably need to create a real index (or suffer a lot by duplicating the content in "hidden" fields and use the TOC tool provided by scribus... but i'm not sure it can do it).
but, even then, it all depends on how you want to present the result.
Hmmm, i will give it a try but if it's to hard for me i had to live without a real index (for this time)

Quotei don't know how much content you already have, but i would like to suggest you to start putting in three or four recipes and then manually prepare an TOC and an index the way you want them to be... and show the result.
for now i have about 70 recipes in plain txt, and at the beginning i struggled a bit with Scribus templates but it looks i have all i need. Just now a document with 5 recipes (each recipe on a single page) and playing around, the learning curve in my opinion is good, but some relations of functions are looking for me like a mess  :o , but at the end no big deal.
Quotefinally, i will start a topic explaining how to share files in this forum and link it later...
Yeah, great. Thank you a lot for jumping in.


a.l.e