Quote:
Originally Posted by AstroCalibre
theduck, thanks for your ansewer!
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.
|
This footer template works for me
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:
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.
|
Do what the above template does to generate the author list in the custom column. Something like this:
Code:
program:
authors = '';
for aut in $authors separator '&':
aut = swap_around_comma(aut);
authors = list_join(' & ', authors, ' & ', aut, ' & ')
rof;
authors
EDIT: Here are simpler versions of the above templates that use list_re_group() instead of a for loop.
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, '&&', '&')
Custom column template:
Code:
program:
list_re_group($authors, ' & ', '.', '(.*)', 'program: swap_around_comma($)')