![]() |
#46 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
Quote:
I found a thread of yours on the Sigil forum from about 10 years ago where you asked about converting these clumps of ALL CAP words to sentence case. Have you found anything that works well in Calibre? |
|
![]() |
![]() |
![]() |
#47 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,131
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Not quite. I think the creators of Sigil are contemplating having some kind of sentence case/title case option... Right now I think Calibre has the regex functions which could do it but I haven't practiced enough with it to feel competent. I use the following regex to get it mostly done:
find: <p class="first">([A-Z])([A-Z ]+)* replace: <p class="first">\1\L\2\E I put the class="first" to designate the first paragraph in a chapter...you'll have to adjust. I roll through the ePub one at a time in case it tries to change proper names or 'I' to lower case. Not completely automatic...but 130 chapters shouldn't take more than a few minutes. |
![]() |
![]() |
Advert | |
|
![]() |
#48 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
and more recently in: There were a few other discussions in there:
But honestly, proper Title Casing is a very hard problem, and all tools I've tested have flaws. "Edge cases" wrong like:
(For example, I do not recommend CapitalizeMyTitle anymore. Whatever algorithm they used years ago has progressively gotten worse, I believe ever since they got purchased by that rotten Grammarly.) There are a few python libraries, like: but this, too, has serious flaws. Calibre does a decent job with ALL CAPS -> Titlecase... definitely one of the better ones. What you would need is a custom TitleCasing plugin where you can check options (like what to do after hyphens). - - - Side Note: Personally, what I do when having to work on hundreds/thousands of chapter titles, is:
Then I could easily map: Code:
<h2>ALL CAPS TITLE</h2> Code:
<h2>All Caps Title</h2> This means I could also have an "All Caps" title in the TOC while still keeping the "ALL CAPS" visually in the book itself (just like I described in Post #15). Quote:
To this date, I still haven't found a satisfactory tool for me. One of the best capitalizers I've found is in TeXStudio. It has an Edit > Text Operations > To Titlecase (smart) which is quite good. So sometimes, I even copy/paste text into there, then run it, then paste back where needed. ![]() Last edited by Tex2002ans; 09-06-2022 at 07:47 PM. |
||
![]() |
![]() |
![]() |
#49 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
Quote:
EDIT: An example of what I get as a result: Code:
W\LHAT EMBLEMS\E https://regex101.com/ \L and \E are specific to "PCRE (PHP <7.3)" and Calibre's editor is Python based. I can't find an equivalent. Last edited by enuddleyarbl; 09-06-2022 at 09:23 PM. |
|
![]() |
![]() |
![]() |
#50 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,131
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
If you are already using Calibre then I would just look up Regex Functions in the Calibre User's Guide. There is an example in there for Title Case, but that could just be slightly modified for Sentence case.
Sorry... I haven't used Calibre's Editor since Sigil came alive again, so I'm not as proficient with it. If you have issues you may find some smart Calibre people on their forum...although there are a few that poke their head's in here occasionally! Last edited by Turtle91; 09-06-2022 at 09:56 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#51 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,131
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
I did a google and found this...might help point you in the general direction if you don't want to try the regex functions.
find: ([\.\r\n][ ]*)([A-Za-z\r])([^\.^\r^\n]+) replace: \1\U\2\L\3 |
![]() |
![]() |
![]() |
#52 |
the rook, bossing Never.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,978
Karma: 88000007
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
Not all style guides agree on nuances of Title case. Also German is different to English anyway with nouns in sentences and if doing pre-20th C book or replicated style they had different rules then.
|
![]() |
![]() |
![]() |
#53 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,213
Karma: 4949904
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Those full uppercase first few words of a chapter are pretty annoying. They are ugly and very intrusive when trying to read.
I pieced together this regex that works well in most cases, except for the usual "I" and proper nouns. I can flick through a hundred chapters in a couple of minutes, only stopping when I have to re-capitalise a name. Find... </span>\b\s?[A-Z’]+(?:\s+[A-Z\.’,\s]+)*\b Replace... regex function - Lower case (ignore tags) |
![]() |
![]() |
![]() |
#54 | |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,468
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
And it still requires that you have a device that can work with embedded fonts and certain CSS. Hitch |
|
![]() |
![]() |
![]() |
#55 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
|
![]() |
![]() |
![]() |
#56 | |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,468
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
H |
|
![]() |
![]() |
![]() |
#57 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,131
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Smallcaps can be used with lowercase AND uppercase letters - and the uppercase glyph is used while still maintaining a font-size difference. It is also using a font that looks like a telegram or an old typewriter.
It looks really nice actually! |
![]() |
![]() |
![]() |
#58 | |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,468
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Hitch |
|
![]() |
![]() |
![]() |
#59 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,103
Karma: 131686272
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
To do smallcaps, the characters have to be lowercase. Hence text-transform: lowercase;. If you are converting smallcaps done with a font size to real smallcaps, then you don't need to edit the uppercase text to make it lowercase.
|
![]() |
![]() |
![]() |
#60 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,131
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
Please take the time to actually read what was written previously before making these blanket statements that are demonstrably false. Here's an exercise for you: Show us the html you would use to create the following (make sure you keep the difference in font size between the upper and lower case letters) and you must use the upper-case glyph for all the lower-case letters: "Now Is The Time For All Good Men To Come To The Aid Of Their Countries." Here's mine: Code:
.sc {font-variant:small-caps} <p class="sc">Now Is The Time For All Good Men To Come To The Aid Of Their Countries.</p> |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Concept] Telegram Bot for converting epubs to kepubs (and transferring) | Tommalka | Kobo Developer's Corner | 2 | 01-01-2022 04:03 AM |
Recipe request: Worcester Telegram | NSILMike | Recipes | 0 | 12-31-2020 08:52 AM |
Worcester Telegram Recipe request | NSILMike | Recipes | 0 | 10-11-2020 07:39 AM |
Green Island - Telegram-channel for authors and writers of books | Phil J. Parker | Self-Promotions by Authors and Publishers | 0 | 06-26-2018 02:23 PM |
E-readers chat (telegram, whatsapp)? | Mochy | Android Devices | 4 | 07-28-2015 08:46 AM |