View Single Post
Old 12-20-2022, 05:11 AM   #6
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,520
Karma: 8065528
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Req13 View Post
I do want all the authors with no transforms. I tried this code in the edit template box, but it wouldn't work. It comes up with this error in the template value box:

EXCEPTION: Formatter: Failed to scan program. Invalid input '& ' - ' & t' near the end of the program

I'm not sure if I needed to change something in the code or not.
You must be running an older calibre version, before calibre 5.40. Assuming you want to/must stay on the older calibre version, the code should be:
Code:
program:
# The authors
	a = $authors;
# Do any transforms you want to authors
# For example, to get the first author
#	a = list_item(a, 0, '&');

# The title
	t = $title;
	t = re(t, '\?', '');
	t = re(t, ':', ';');
# Add any more changes that you want.

# Construct the final output
	strcat(a, ' - ', t)
chaley is offline   Reply With Quote