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
Guru
jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.
 
jvorzimmer's Avatar
 
Posts: 54
Karma: 186734
Join Date: Jun 2013
Device: Samsung Galaxy Tab A9+
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,185
Karma: 1988646
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
Guru
jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.
 
jvorzimmer's Avatar
 
Posts: 54
Karma: 186734
Join Date: Jun 2013
Device: Samsung Galaxy Tab A9+
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
Guru
jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.
 
jvorzimmer's Avatar
 
Posts: 54
Karma: 186734
Join Date: Jun 2013
Device: Samsung Galaxy Tab A9+
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: 12,315
Karma: 7957679
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
Guru
jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.jvorzimmer can program the VCR without an owner's manual.
 
jvorzimmer's Avatar
 
Posts: 54
Karma: 186734
Join Date: Jun 2013
Device: Samsung Galaxy Tab A9+
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 174 02-16-2025 06:52 AM
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:58 AM.


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