![]() |
#1 |
Enthusiast
![]() Posts: 27
Karma: 10
Join Date: Nov 2019
Device: Android smartphone
|
Author in cover image
Hi
When I generate the cover image of a book, the author's name appears at the bottom of the cover in the form "Last Name, First Name" (e.g. "Asimov, Isaac"). I want it in the form "First Name Last Name", without a comma and with the Last Name First Name reversed (e.g. "Isaac Asimov"). How can I do? Thanks for attention, Regards |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,048
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Your Authors column must be in that format
And your author-sort must be set to copy. The template is on the Text tab of The Generate cover: Customize but any thing you do there is going to be fragile as it handles many conditions of Authors |
![]() |
![]() |
![]() |
#3 | |
Enthusiast
![]() Posts: 27
Karma: 10
Join Date: Nov 2019
Device: Android smartphone
|
Quote:
I hoped that it could be done without changing the ordering of the authors (I want to leave it in the form "Asimov, Isaac"), by modifying, for example, the template in Generate cover. Alternatively, I tried to do this: I created a custom column (#myauthors) and manually inserted the authors' names into it in the form that I want (e.g. Isaac Asimov & Arthur Clarke). Then I edit the template in Generate cover replacing the word "authors" with "#myauthors". It works but I was wondering if it is possible to create a custom column that generates automatically the names of the authors, without comma between surname and name, with surname and name inverted, and separated by an ampersand. |
|
![]() |
![]() |
![]() |
#4 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,749
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#5 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,446
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
program: # Show at most two authors, on separate lines. authors = ''; for aut in sublist($authors, 0, 2, ' & ') separator '&': aut = swap_around_comma(aut); authors = list_join(' & ', authors, ' & ', aut, ' & ') rof; authors = list_re(authors, ' & ', '(.+)', '<b>\1'); authors = re(authors, ' & ', '<br>'); re(authors, '&&', '&') Quote:
Code:
program: authors = ''; for aut in $authors separator '&': aut = swap_around_comma(aut); authors = list_join(' & ', authors, ' & ', aut, ' & ') rof; authors Cover template: Code:
program: # Show at most two authors, on separate lines. authors = list_re_group($authors, ' & ', '.', '(.*)', 'program: swap_around_comma($)'); num = count(authors, ' & '); authors = sublist(authors, 0, 2, ' & '); authors = list_re(authors, ' & ', '(.+)', '<b>\1'); authors = re(authors, ' & ', '<br>'); re(authors, '&&', '&') Code:
program: list_re_group($authors, ' & ', '.', '(.*)', 'program: swap_around_comma($)') Last edited by chaley; 10-28-2023 at 11:31 AM. Reason: Added simpler templates |
||
![]() |
![]() |
![]() |
#6 | |
Enthusiast
![]() Posts: 27
Karma: 10
Join Date: Nov 2019
Device: Android smartphone
|
Quote:
![]() I have tried both code (cover template and custum column template). The code for custom column works perfectly also with multiple authors. The code for Generate cover works well with single author, but with multiple authors such as "Asimov, Isaac & Clarke, Arthur" produce "Isaac Clarke & Arthur Asimov", or something like that. |
|
![]() |
![]() |
![]() |
#7 |
Enthusiast
![]() Posts: 27
Karma: 10
Join Date: Nov 2019
Device: Android smartphone
|
|
![]() |
![]() |
![]() |
#8 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,446
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
The book's metadata: The generated cover (using the second template): Don't know why it isn't working for you. What version of calibre are you running? |
|
![]() |
![]() |
![]() |
#9 | |
Enthusiast
![]() Posts: 27
Karma: 10
Join Date: Nov 2019
Device: Android smartphone
|
Quote:
I don't understand why it was giving me the wrong output before. Thanks for your help! ![]() |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can I get metadata from cover image? The image is correct but all other data is wrong | mydjtl | Library Management | 1 | 12-14-2017 05:15 PM |
paste cover image changes image's size | pipistrelosone | Editor | 1 | 10-07-2016 09:10 AM |
Cover Image? | MerlinMama | Editor | 9 | 06-18-2016 08:47 PM |
Cover image isn't displaying as cover image | Eugene88 | Sigil | 3 | 08-15-2012 04:05 PM |