Quote:
Originally Posted by chaley
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, '&&', '&')
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($)')
|
Hi, chaley, very thanks for your answer, it helped me a lot.

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.