View Single Post
Old 01-10-2023, 05:50 AM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by stumped View Post
i am using a cribbed formula which adds series name to front of title, so on kindle or kobo the book will appear as series name - series number - title

that works but for some series,on the device the series name bit fills the whole line, obscuring the actual title ( esp on kobo where only short single lines are allowed ?

so whats the syntax please for adding a shortened version of the series name and what trim options are available - as I am not sure what will work best

i could just shrink all my series names in calibre but that is a long and tedious process, I'd prefer NOT to change those. but if i do, I could not see how to block change old series name 1 to n into new series name 1 to n without the numbering going awry
There are two built-in functions for this, substr() and shorten(). You use substr() if you want a single slice out of the name, for example the first 10 characters. You use shorten() if you want more control, for example the first 8 characters and the last 4 characters separated by a '-'.

Examples in basic single-function mode:
  • {series:substr(0,10)} Gives the first 10 characters of the series name. If the name length is less than 10 it is returned unchanged.
  • {series:shorten(8,-,4)} -- gives the first 8 characters of the series name, a dash, then the last 4 characters of the name. If the length of the name is less than 13 (8 + 4 + 1) then it is returned unchanged.
chaley is offline   Reply With Quote