Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 05-16-2016, 12:39 PM   #1
larysa
Zealot
larysa began at the beginning.
 
Posts: 124
Karma: 10
Join Date: Feb 2016
Device: iPad mini 4
add rules into all paragraph

when i build my new ebook it's possible add rule <p class=body>text</p> on all paragraph of my page??? (with calibre)

Last edited by larysa; 05-16-2016 at 01:10 PM.
larysa is offline   Reply With Quote
Old 05-16-2016, 01:41 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,914
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by larysa View Post
when i build my new ebook it's possible add rule <p class=body>text</p> on all paragraph of my page??? (with calibre)
You could

but Why?
in the CSS just set
p { your style stuff here}

Then think 'Exception' to the standard 'p' for those special cases

those get a p class=
theducks is offline   Reply With Quote
Advert
Old 05-17-2016, 05:20 AM   #3
larysa
Zealot
larysa began at the beginning.
 
Posts: 124
Karma: 10
Join Date: Feb 2016
Device: iPad mini 4
I use ocr software to convert my scan page into text page, after import text into calibre.
But on each paragraph i have to add my p class at the beginning and /p at the end...
For each paragraph!! I want add this with one rule....
larysa is offline   Reply With Quote
Old 05-17-2016, 05:28 AM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,224
Karma: 145488788
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by larysa View Post
I use ocr software to convert my scan page into text page, after import text into calibre.
But on each paragraph i have to add my p class at the beginning and /p at the end...
For each paragraph!! I want add this with one rule....
You don't need to add <p class="someclassname">. For most paragraphs, just use <p> and in css, something like this...

p {
margin-top: 0;
margin-bottom: 0;
text-indent: 1.2em;
}

You just change p as you want and you won't need a class for most p.
JSWolf is offline   Reply With Quote
Old 05-17-2016, 05:34 AM   #5
larysa
Zealot
larysa began at the beginning.
 
Posts: 124
Karma: 10
Join Date: Feb 2016
Device: iPad mini 4
You don't understand my problem...
I have css, but i copy and paste from ocr software into calibre...the text is flatten, without nothing, only simple text. I must add pclass at beginning and /p at the end for each paragraph....I want one rule for this!
larysa is offline   Reply With Quote
Advert
Old 05-17-2016, 05:44 AM   #6
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by larysa View Post
You don't understand my problem...
I have css, but i copy and paste from ocr software into calibre...the text is flatten, without nothing, only simple text. I must add pclass at beginning and /p at the end for each paragraph....I want one rule for this!
What formats can the OCR export to? If it will export to HTML or Word, use that. Then add it to calibre and do a conversion. Other formats can be used successfully, but avoid PDF if you can.
davidfor is offline   Reply With Quote
Old 05-17-2016, 05:47 AM   #7
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by larysa View Post
You don't understand my problem...
I have css, but i copy and paste from ocr software into calibre...the text is flatten, without nothing, only simple text. I must add pclass at beginning and /p at the end for each paragraph....I want one rule for this!
You shouldn't be copying and pasting into the Calibre editor. If your OCR software exports as text, load the text file into Calibre, and then use Calibre to convert the text to HTML. That will add the tags for you. Then edit the HTML/CSS to tidy it up.
HarryT is offline   Reply With Quote
Old 05-17-2016, 11:03 AM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,914
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
sorry, but You don't seem to understand HTML/CSS

You don't NEED "class= " for HTML tags. None of the responses are wrong, just different. But they all have 1 thing in common K.I.S.S.

For years, Baen (you've heard of them?) shipped ebooks with 3 tiny CSS
1 of those was even blank (the conversion scripts required it to be included. so it was empty rather than break other stuff)

Here is the BASE CSS I use all the time. 2 entriers (for simple TXT files that I import)

I sometimes add a Chapter Number (CN) treatment, Opening Paragraph treatment (FP)
theducks is offline   Reply With Quote
Old 05-17-2016, 02:56 PM   #9
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Quote:
Originally Posted by larysa View Post
I use ocr software to convert my scan page into text page, after import text into calibre.
But on each paragraph i have to add my p class at the beginning and /p at the end...
For each paragraph!! I want add this with one rule....
When you import your text, does it NOT have any <p> and </p> tags around each block of text?
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	212
Size:	164.3 KB
ID:	148724  
phossler is offline   Reply With Quote
Old 05-18-2016, 05:40 AM   #10
larysa
Zealot
larysa began at the beginning.
 
Posts: 124
Karma: 10
Join Date: Feb 2016
Device: iPad mini 4
@ phossler
Yes, when import text I don't have any tag (I copy from ocr on clipboard and paste into calibre...if save html from ocr when import I have various ( much more) different tag...then I copy only with right click and paste into calibre, clean of any tag)
I want save my clipboard on txt file, then import to calibre and have for each paragraph only one tag (the same) for each paragraph. Then with find function i replace this tag whit my tag pclass=body....
larysa is offline   Reply With Quote
Old 05-18-2016, 06:15 AM   #11
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
As I said earlier, larysa, this is not a good approach. It would be much better to add your text file into Calibre, and then use Calibre to convert the text to HTML.
HarryT is offline   Reply With Quote
Old 05-18-2016, 12:46 PM   #12
larysa
Zealot
larysa began at the beginning.
 
Posts: 124
Karma: 10
Join Date: Feb 2016
Device: iPad mini 4
Ok then i save my document as txt file (without any tag) and then add this txt into calibre (and him add tag). Ok this solved my question...but how to calibre import txt file ???
larysa is offline   Reply With Quote
Old 05-18-2016, 12:51 PM   #13
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
The same way you'd import any other book into your Calibre library. Either use the "Add Book" menu item in Calibre, or just drag and drop the file onto the Calibre window.
HarryT is offline   Reply With Quote
Old 05-18-2016, 01:05 PM   #14
larysa
Zealot
larysa began at the beginning.
 
Posts: 124
Karma: 10
Join Date: Feb 2016
Device: iPad mini 4
Ok tonight I try! Thanks for your support!
larysa is offline   Reply With Quote
Old 05-19-2016, 05:11 AM   #15
larysa
Zealot
larysa began at the beginning.
 
Posts: 124
Karma: 10
Join Date: Feb 2016
Device: iPad mini 4
Ok work. But when i save txt file and after import into calibre, more character are modify: è with ė, á with ä and this for each vocal with accent...also ' isn't recognized...the easy way would be copy and past into a blank page of calibre ebook and insert tag at the beginning and at the end to all paragraphs...!!
larysa is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add automatically paragraph tag hifi25nl Sigil 20 05-12-2015 04:40 AM
Problem: Merge two ebooks paragraph by paragraph... akayacik80 Workshop 5 09-23-2014 09:05 AM
3 suggestions: merge on add, cleanup on add, sorting changeling Calibre 5 08-24-2013 06:35 AM
Preference: Paragraph indent or a little paragraph spacing? 1611mac General Discussions 48 11-11-2011 12:43 AM


All times are GMT -4. The time now is 03:22 PM.


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