06-12-2018, 01:36 PM | #1 |
Connoisseur
Posts: 73
Karma: 10
Join Date: Sep 2016
Device: Kindle
|
change font style of single page of html
I have an HTML book (14 files) and one of the chapters was preformatted as completely italic text with tags scattered in the HTML (not the css). It's the Prologue and it is an author-published web chapter.
In the Epub editor, I tried a simple Select on the text in the file preview pane to de-italicize it, but the Editor only seems to add Italics tags. The files wasn't too long, so I did it manually (about 20-25 occurrences). For future reference, is there a built-in way to remove the html formatting (<i ...>xxxx</i> or similar tags) while preserving the text? Ex. Here is some italicized text that I want to invert . Or is it something I need a regular expression for? The Metadata editor has a function to remove HTML formatting, so am I just overlooking it in the Epub editor? Thanks to anyone who can provide some help! Last edited by meghane_e; 06-12-2018 at 01:45 PM. Reason: more details |
06-12-2018, 02:00 PM | #2 | |
Well trained by Cats
Posts: 29,812
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Select the text, including the <i tags at both ends Ctrl-F (find): replace the text you want to keep with (.+?) set replace to \1 Set the mode to REGEX: (current file if you don't want Global) reset the cursor to The top: the click find is it a correct find click replace. Preview if needed is the replace good: Repeat: find: replace and find: |
|
06-12-2018, 05:16 PM | #3 |
Book E d i t o r
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
|
Theducks's explanation made no sense to me, but here's a way to remove italics quickly. Find the <span> class that's being used to italicize the text (example: <span class="italics">. Click on the stylesheet.css file at the left and find that class (in the example above, it would be "italics"). Then remove the line that says font style: italic; from that section. Save the file, and you're done.
Personally, I would do a find for <span class="italics"> (or whatever italics code is being used) and then replace all with blank, which will remove all occurrences of the span. Then hit Beautify Files, which will remove all the closing </span> codes. |
06-12-2018, 07:16 PM | #4 |
null operator (he/him)
Posts: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@meghane_e - The Sigil editor has a Format->Remove Formatting option, you could try that next time. IIRC, in Book View it only removes styling tags, i.e. bold, italics etc.
Bit surprised the calibre editor doesn't have a similar feature, or maybe it does and I haven't spotted it BR |
06-12-2018, 08:06 PM | #5 |
Connoisseur
Posts: 73
Karma: 10
Join Date: Sep 2016
Device: Kindle
|
Thanks for the suggestions! Was really sure I was overlooking an option in the Calibre book editor. But perhaps not. I've been going back and forth between Sigil and Calibre's book editor until I decide what my priorities are. Sigil is bit more straight forward, but Calibre is more functional and powerful. My regex knowledge (and memory capacity) was from 20 years ago so it's been really slow building it back up. So sad. But it's useful and good brain exercise.
Really appreciate the help! Last edited by meghane_e; 06-12-2018 at 08:08 PM. |
06-12-2018, 08:34 PM | #6 |
Well trained by Cats
Posts: 29,812
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Duho!
Use the Edit spans and Tags plugin. It can delete i tags among others |
06-12-2018, 09:33 PM | #7 |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
You can also try the plugin Diap's Editing Toolbag. That has a tool that will remove various tags based on class or ids. Or replace them with something else.
|
06-13-2018, 06:43 AM | #8 | |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
Update: Nevermind, I see the Edit Spans and Divs plugin is not a stand alone plugin, but installs when you add Diap's Editing Toolbag plugin. Last edited by DoctorOhh; 06-13-2018 at 06:49 AM. |
|
06-13-2018, 10:40 AM | #9 |
Well trained by Cats
Posts: 29,812
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
I read the name off th window header header when the PI was running. Never thought to check the name attached to the configured Icon
|
06-16-2018, 04:12 PM | #10 |
Connoisseur
Posts: 73
Karma: 10
Join Date: Sep 2016
Device: Kindle
|
That's excellent! I haven't used it other than try one or two small changes to a file. Definitely helpful! Thank you for suggesting it and Diap for writing it!
|
Tags |
convert html, epub editor, remove formatting |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to change font size and font style? | butterbescotch | Sigil | 20 | 09-06-2013 08:22 PM |
Unwanted page numbers and font change | SoulStyle | Conversion | 5 | 05-21-2011 04:58 PM |
ePub - Changing Font size doesn't change page numbers | higgs | Sony Reader | 46 | 03-26-2010 02:36 PM |
single HTML to ePub with fixed width font | skyfish | Calibre | 8 | 12-10-2009 01:30 PM |
change html font size ssh | nwsco | iRex | 0 | 04-26-2009 03:17 AM |