09-04-2014, 08:00 AM | #541 |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
09-04-2014, 08:04 AM | #542 |
creator of calibre
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You could probably get it to use one of the various unicode spaces like the non-breaking space or the thin space/thick space. I doubt those space characters are compressed.
|
Advert | |
|
09-04-2014, 11:56 AM | #543 |
Zealot
Posts: 116
Karma: 10
Join Date: Jun 2011
Location: Stockport, UK
Device: ipad, iphone, kindle
|
Aaaargh!! Thought you had cracked it then but....
PLUGBOARD TEMPLATE ERROR format: type d requires an integer.. Can't handle my 0.25 series numbers :-( I give up :-( |
09-04-2014, 12:30 PM | #544 | |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
{series_index:_>7.2f} |
|
09-05-2014, 06:31 AM | #545 |
Zealot
Posts: 116
Karma: 10
Join Date: Jun 2011
Location: Stockport, UK
Device: ipad, iphone, kindle
|
FINALLY
WOOOOOO I owe you a pint |
Advert | |
|
09-05-2014, 06:34 AM | #546 |
Zealot
Posts: 116
Karma: 10
Join Date: Jun 2011
Location: Stockport, UK
Device: ipad, iphone, kindle
|
OK, now I know it can be done - is there any simple, easy way to swap plugboards so I can use the simple setup for most books and then use this for those awkward series?
|
09-05-2014, 11:23 AM | #547 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Use a custom column to set which ones deserve the new template (or tag them) and do a list lookup to determine which template to use. When I get on the computer I will work out a general program mode template to do it, assuming no one beats me to it.
|
09-05-2014, 03:16 PM | #548 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Okay, so assuming you want "Series Name [03] Book Title" as per post #533.
series_index should be prepended with underscores, to bump it up to 4 digits. If the custom column "#complex_series" is set to true -- I'll just test if it has any value -- it will add two decimal places. Mark each awkward series with this. (This would be easier if I could figure out how to test within a template for a numer with decimals.) Template should be: Code:
program: ser_num = test( field('#complex_series'), finish_formatting( field('series_index'), '_>7.2f', ' [', '] ' ), finish_formatting( field('series_index'), '_>4d', ' [', '] ' ), ); strcat( field('series'), ser_num, field('title') ) Last edited by eschwartz; 09-05-2014 at 03:18 PM. |
09-06-2014, 05:41 AM | #549 |
Zealot
Posts: 116
Karma: 10
Join Date: Jun 2011
Location: Stockport, UK
Device: ipad, iphone, kindle
|
O.....K......
Mind officially blown At moment I am using metadata plugboard which allows me to email any book to my kindle and get it formatted as I want. So, idiot instructions please. Where does this code go and how do I alter my workflow to use it?? |
09-06-2014, 06:10 AM | #550 | |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
program: sindex = raw_field("series_index"); cmp(format_number(sindex, '{0:d}'), format_number(sindex, '{0:f}'), 'not int', 'int', 'not int') |
|
09-06-2014, 07:09 AM | #551 |
Zealot
Posts: 116
Karma: 10
Join Date: Jun 2011
Location: Stockport, UK
Device: ipad, iphone, kindle
|
Chaley, if that checks on a per-item basis it won't trigger for all the books in the series, just those with fractions?
|
09-06-2014, 03:14 PM | #552 | |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
I have a python "script" that puts the correct format for a series into a custom column. It looks at all books in the series, figures out whether it needs decimals and how many leading zeros (could be underscores) are required, and then writes the correct format for "format_number" to the custom column for each book in the series. The script is run from the command line with calibre-debug -e. I mention this mostly to agree that I was being dense, especially as I had already solved this problem in a different way, but if you are comfortable with this sort of thing you are welcome to use the script appropriately modified. The script is: Spoiler:
|
|
09-07-2014, 12:17 AM | #553 | |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
And I didn't think of this either. So it was not you who was confused, chaley. Last edited by eschwartz; 09-07-2014 at 12:21 AM. |
|
09-07-2014, 01:28 AM | #554 |
Resident Curmudgeon
Posts: 73,943
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
delete post
Last edited by JSWolf; 09-07-2014 at 01:34 AM. |
09-09-2014, 12:13 PM | #555 |
Hack
Posts: 34
Karma: 12
Join Date: Dec 2009
Device: Kobo Aura HD, Kindle Paperwhite
|
composite column template TRUE if ONLY format = PDF
I thought this would be easy, but I am totally lost.
I know how to do a search for only PDF by excluding other formats, but I don't know how to use the template language to do the same... Can someone give me a quick pointer? |
Tags |
custom column, tag, tags |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
custom column i need a little help | shinken | Calibre | 3 | 09-15-2010 03:41 AM |
Using Custom Metadata in Save Template | EJvdH | Calibre | 1 | 07-02-2010 06:06 AM |
Accessories Decalgirl Kindle 2 custom skin template | srmalloy | Amazon Kindle | 6 | 04-09-2010 09:55 PM |
Donations for Custom Recipes | ddavtian | Calibre | 5 | 01-23-2010 04:54 PM |
Help understanding custom recipes | andersent | Calibre | 0 | 12-17-2009 02:37 PM |