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, 06: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,640
Karma: 23191067
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, 06: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: 21,006
Karma: 27620706
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 offline   Reply With Quote
Advert
Old 11-03-2023, 06: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,304
Karma: 12587727
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 11:32 PM.
Tex2002ans is offline   Reply With Quote
Old 11-03-2023, 09: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,225
Karma: 19000635
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/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, 09: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: 8,160
Karma: 5450818
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 online now   Reply With Quote
Advert
Old 11-03-2023, 04: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: 40,579
Karma: 157444380
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, 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 04:57 PM. Reason: Perhaps I should have read the second page before replying?
DNSB is offline   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 07:03 PM
upper case schaf Kobo Reader 2 04-10-2013 08:23 PM
upper case to sentence case conversion cybmole Sigil 8 01-20-2011 07:03 AM
Classic Little icon for page turning on the upper right gets stuck. MangaEbooker Barnes & Noble NOOK 3 10-07-2010 03:25 PM
Buy Sony PRS-505 Ornamental Plates both lower and upper pnyc Flea Market 2 05-24-2009 12:17 PM


All times are GMT -4. The time now is 12:57 PM.


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