Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 11-03-2023, 05:11 AM   #16
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Bozana View Post
But realised that this works best in Sigil and not Calibre. And this this needs to work in Calibre please.
Sigil and Calibre use different regex engines. In Calibre, you'll need to select the Regex-function mode and the predefined Lower-case text function.
Doitsu is offline   Reply With Quote
Old 11-03-2023, 05:12 AM   #17
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,577
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
↑ ↑ ↑ x-post

Quote:
Originally Posted by Bozana View Post
. . .

But realised that this works best in Sigil and not Calibre. And this this needs to work in Calibre please. Any help and suggestions would be appricated.

Thank you!
You should raise the issue in the Calibre Editor forum ==>> Calibre Editor.

BR
BetterRed is online now   Reply With Quote
Old 11-03-2023, 05:47 AM   #18
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Bozana View Post
I've tried everything above... I need to have a search and replace uppercases in the beggining of a paragrahs. Example:

<p class=subsq">SARAH SNUGGLED DEEPER into Kade’s embrace.</p>

And I need it to be:

<p class=subsq">Sarah snuggled deeper to Kade’s embrace</p>
For your very specific case, if you know you always have the first few words ALL CAPS in your book...

You could do something like:

Find: <p class="subsq">([A-Z])([A-Z’ ]{2,})
Replace: <p class="subsq">\1\L\2

This would find:
  • Grab the very first capital letter.
    • Assign to Group 1.
  • Grab all the other capital letters + apostrophes + spaces.
    • Assign to Group 2.

And then replace:
  • The very first letter as is.
  • Lowercase all the rest of the letters and shove them in.

But I would be very careful with this type of stuff, which is why I do a case-by-case basis replace.

There are TONS of capitalization exceptions that can occur, like:
  • First/Last Names
    • Sarah, Kade
  • Roman Numerals
    • King Charles VII
  • Acronyms
    • DNA, FBI, CIA
  • [...]

so you can't just "lowercase everything".

Since this ol' 2014 post, I've since explained and cover tons of ALL CAPS -> Smallcaps + Title Casing stuff:

If you type this into your favorite search engine:

Code:
smallcaps Tex2002ans site:mobileread.com
or:

Code:
acronyms Tex2002ans site:mobileread.com
you can find lots of previous discussion.

Quote:
Originally Posted by Bozana View Post
But realised that this works best in Sigil and not Calibre. And this this needs to work in Calibre please. Any help and suggestions would be appricated.
Yes, like Doitsu said...

In Calibre, there is a "Regex-Function" Mode now:

There is already a built-in "Lower-case" one.

And, in Sigil, there is now a much more powerful, bleeding-edge, List-Based Search/Replace.

I brainstormed a much faster ALLCAPS-><span class="smallcaps">Smallcaps</span> workflow back in:

but I have yet to write a tutorial on it.

(There have been lots of enhancements in the past 9 years since this original post!!!)

Last edited by Tex2002ans; 11-03-2023 at 10:32 PM.
Tex2002ans is offline   Reply With Quote
Old 11-03-2023, 08:15 AM   #19
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,097
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
There is also a regex function plug-in for Sigil that is similar to Calibre’s. It is more of a proof of concept that someone could polish and hopefully incorporate into Sigil at some point. But it should do the trick for a simple ALLCAPS to Title Case.
Turtle91 is offline   Reply With Quote
Old 11-03-2023, 08:36 AM   #20
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
If it needs to work in Calibre, then perhaps asking in that the calibre forum would be a good idea.
KevinH is offline   Reply With Quote
Old 11-03-2023, 03:54 PM   #21
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,466
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Bozana View Post
I've tried everything above... I need to have a search and replace uppercases in the beggining of a paragrahs. Example:

<p class=subsq">SARAH SNUGGLED DEEPER into Kade’s embrace.</p>

And I need it to be:

<p class=subsq">Sarah snuggled deeper to Kade’s embrace</p>

I've tired:

Find: ([[:upper:]])([[:upper:]]{1,})
Replace: \1\L\2\E

But realised that this works best in Sigil and not Calibre. And this this needs to work in Calibre please. Any help and suggestions would be appricated.

Thank you!
You do realize that you are posting in a Sigil forum? Perhaps this question would be best asked in the calibre editor subforum? Personally, I use both Sigil and the calibre editor. Sigil is my main editor but there are some tools that calibre has that I make use of.

You might also want to check the syntax difference between the PCRE2 regex used by Sigil and the Python regex used by calibre though I've seen statements that calibre uses PCRE. A useful site would be Regex101 which allows you to test regex using different engines.

And please note that in your example, you would need to manually change kade back to Kade.

Last edited by DNSB; 11-03-2023 at 03:57 PM. Reason: Perhaps I should have read the second page before replying?
DNSB is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugin to trasform database to upper case Xwang Plugins 21 08-07-2019 06:03 PM
upper case schaf Kobo Reader 2 04-10-2013 07:23 PM
upper case to sentence case conversion cybmole Sigil 8 01-20-2011 06:03 AM
Classic Little icon for page turning on the upper right gets stuck. MangaEbooker Barnes & Noble NOOK 3 10-07-2010 02:25 PM
Buy Sony PRS-505 Ornamental Plates both lower and upper pnyc Flea Market 2 05-24-2009 11:17 AM


All times are GMT -4. The time now is 06:29 PM.


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