Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 11-19-2021, 12:18 PM   #1
jvorzimmer
Enthusiast
jvorzimmer began at the beginning.
 
jvorzimmer's Avatar
 
Posts: 46
Karma: 10
Join Date: Jun 2013
Device: Samsung Galaxy Tab A 8"
Template Language Question

I have a quick question for the forum about calibre template language.

When saving my epubs to disk to match Calibre Companion's template I have:
{authors:sublist(0,1,&)}/{title:re([—®™],_)} - {authors:re(\.\,,)}

But I noticed that if an author's name ends in a period e.g., "Jr." CC ignores the period, not even replacing with an underscore, in creating a subdirectory based on the author's name.

My question is how can I use both a sublist and re when creating my subdirectory in the above template?

Thanks in advance for your expertise.
jvorzimmer is offline   Reply With Quote
Old 11-20-2021, 11:25 AM   #2
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,122
Karma: 1954138
Join Date: Aug 2015
Device: Kindle
Code:
 {:'re(sublist($authors, 0,1,'&'), '\.', '_')'}/{title:re([—®™],_)} - {authors:re(\.\,,)}
capink is offline   Reply With Quote
Advert
Old 11-20-2021, 12:40 PM   #3
jvorzimmer
Enthusiast
jvorzimmer began at the beginning.
 
jvorzimmer's Avatar
 
Posts: 46
Karma: 10
Join Date: Jun 2013
Device: Samsung Galaxy Tab A 8"
Quote:
Originally Posted by capink View Post
Code:
 {:'re(sublist($authors, 0,1,'&'), '\.', '_')'}/{title:re([—®™],_)} - {authors:re(\.\,,)}
I get: EXCEPTION: Formatter: missing closing parenthesis near authors

But I don't see any missing parenthesis.

Jeff
jvorzimmer is offline   Reply With Quote
Old 11-20-2021, 12:54 PM   #4
jvorzimmer
Enthusiast
jvorzimmer began at the beginning.
 
jvorzimmer's Avatar
 
Posts: 46
Karma: 10
Join Date: Jun 2013
Device: Samsung Galaxy Tab A 8"
I got it. It should be:

{authors:'re(sublist($, 0, 1, '&'), '\.$', '')'}/{title:re([—®™],_)} - {authors:re(\.$,)}

Thanks! Much appreciated.

Last edited by jvorzimmer; 11-20-2021 at 01:27 PM. Reason: correction
jvorzimmer is offline   Reply With Quote
Old 11-20-2021, 01:01 PM   #5
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: 11,799
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by jvorzimmer View Post
I get: EXCEPTION: Formatter: missing closing parenthesis near authors

But I don't see any missing parenthesis.

Jeff
Works fine for me.

What version of calibre are you running? If it is before version 5 then you need
Code:
{authors:'re(sublist($,0,1,'&'), '\.', '_')'}/{title:re([—®™],_)} - {authors:re(\.\,,)}
chaley is offline   Reply With Quote
Advert
Old 11-20-2021, 01:26 PM   #6
jvorzimmer
Enthusiast
jvorzimmer began at the beginning.
 
jvorzimmer's Avatar
 
Posts: 46
Karma: 10
Join Date: Jun 2013
Device: Samsung Galaxy Tab A 8"
Sorry, I should have mentioned that I'm 4.23.
jvorzimmer is offline   Reply With Quote
Reply

Tags
language, template, title


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Template language changes chaley Library Management 132 03-03-2024 06:34 PM
Template Language phossler Calibre 8 01-12-2016 04:37 PM
Help with template language Pepin33 Calibre 8 11-11-2012 08:32 AM
Template language question BookJunkieLI Library Management 7 02-02-2012 06:55 PM
Stupid question about calibre language template Cammagno Calibre 1 01-08-2011 08:00 AM


All times are GMT -4. The time now is 01:53 AM.


MobileRead.com is a privately owned, operated and funded community.