Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 03-17-2022, 07:12 PM   #1
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,089
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quotes and blockquote

I recently discovered that font-variant: small-caps; does not work in epubs used in Kobo Libra2

Now I have also noticed that quotes are a bit temperamental.

For example, when a character reads a printed document verbatim, it is usually displayed with wider margins, and maybe italicized. I tried replicating this with the following using <p class="quote"></p>
Spoiler:
.quote {
display: block;
font-size: 0.9em;
font-style: normal;
font-family: inherit;
padding-left: 50px;
padding-right: 50px;
padding-top: inherit;
padding-bottom: 0.1em;
text-indent: 0;
}


But the Libra2 completely ignored that and the quoted text just looked like the rest of the page.

The Libra2 expects <blockquote></blockquote>, then it displayed as quoted text.
Karellen is online now   Reply With Quote
Old 03-17-2022, 07:47 PM   #2
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,208
Karma: 16534692
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by Karellen View Post
I recently discovered that font-variant: small-caps; does not work in epubs used in Kobo Libra2

Now I have also noticed that quotes are a bit temperamental.

For example, when a character reads a printed document verbatim, it is usually displayed with wider margins, and maybe italicized. I tried replicating this with the following using <p class="quote"></p>
Spoiler:
.quote {
display: block;
font-size: 0.9em;
font-style: normal;
font-family: inherit;
padding-left: 50px;
padding-right: 50px;
padding-top: inherit;
padding-bottom: 0.1em;
text-indent: 0;
}


But the Libra2 completely ignored that and the quoted text just looked like the rest of the page.

The Libra2 expects <blockquote></blockquote>, then it displayed as quoted text.
It may be because you've specified the left/right increased margins as 50px, i.e absolute units. Try using em units instead, e.g. this is what I use:
Code:
  
  margin-left: 2em;
  margin-right: 2em;
but use whatever works for you.

I think a <blockquote> has default increased left/right margins even if you don't include any explicit CSS for it.
jackie_w is offline   Reply With Quote
Advert
Old 03-17-2022, 07:59 PM   #3
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,089
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Hi @jackie_w

Thanks for your feedback. I will try that change when I get back home later this afternoon.

But I suppose I should use <blockquote> anyway as that is what it is designed for. I can modify it in the css page also.
Karellen is online now   Reply With Quote
Old 03-17-2022, 08:19 PM   #4
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,208
Karma: 16534692
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by Karellen View Post
But I suppose I should use <blockquote> anyway as that is what it is designed for. I can modify it in the css page also.
Just a word of warning ... if you do use <blockquote> and you also use epubcheck to validate your epubs, it will complain about a <blockquote> element if it contains text. It expects you to wrap it around a group of child elements containing the text. e.g.
Code:
<blockquote>
    <p>Some text</p>
    <p>Some more text</p>
</blockquote>
jackie_w is offline   Reply With Quote
Old 03-17-2022, 09:04 PM   #5
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,089
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by jackie_w View Post
Just a word of warning ... if you do use <blockquote> and you also use epubcheck to validate your epubs, it will complain about a <blockquote> element if it contains text. It expects you to wrap it around a group of child elements containing the text. e.g.
Code:
<blockquote>
    <p>Some text</p>
    <p>Some more text</p>
</blockquote>
Oh, ok. I have not used the child tags. I'll fix that.
Apart from epubcheck noting it as an error, is it a requirement to use child tags for blockquote elements? That something written in the css specs and ereaders expect it?
Karellen is online now   Reply With Quote
Advert
Old 03-17-2022, 09:27 PM   #6
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,208
Karma: 16534692
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
I don't think ereaders will complain. It's just epubcheck's nitpicking. More important if you're creating ebooks to sell. Not so much if you're just creating them for yourself.
jackie_w is offline   Reply With Quote
Old 03-17-2022, 10:35 PM   #7
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
I didn't get an error from epubcheck when I made a block quote with no p tags in it.

Also, this page says they're not always needed; see the bottom paragraph:

https://www.w3.org/TR/2011/WD-html5-...e-element.html
hobnail is offline   Reply With Quote
Old 03-17-2022, 10:39 PM   #8
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
For the sake of showing another way of styling blockquote, I use a width percentage:

Code:
blockquote, div.block {
    margin-left: auto;
    margin-right: auto;
    margin-top: 1em;
    width: 85%;
}

blockquote p, div.block p {
    margin-top: 0.25em;
    text-indent: 0em;
}

blockquote + p, div.block + p {
    margin-top: 1em;
}

Last edited by hobnail; 03-17-2022 at 10:42 PM.
hobnail is offline   Reply With Quote
Old 03-18-2022, 10:16 AM   #9
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,093
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
I've always used blockquote when it is a longer quote...typically two or more paragraphs. I think that is why people are used to using the <p> tags inside of a blockquote. If it was a single paragraph then it's easier to just style the individual paragraph:

Code:
p.quote {margin:1em; text-indent:0; text-align:left; 
         font-size:.8em; font-style:italic}

<p>This is a normal paragraph before the quote.</p>
<p class="quote">Yadda yadda yadda...</p>
<p>This is a normal paragraph after the quote.</p>

vs.

blockquote        {margin:1em auto; width:50%}
blockquote p      {margin:0 0 .75em; text-align:left; text-indent:0; 
                   font-size:.8em; font-style:italic}
blockquote p.auth {margin:1.5em 0 0; text-align:right; font-style:normal}
blockquote + p    {text-indent:0}

<p>This is a normal paragraph before the blockquote.</p>
<blockquote>
  <p>Yadda yadda yadda...</p>
  <p>Also, yadda yadda yadda...</p>
  <p>But then, yadda yadda yadda...</p>
  <p>Finally, yadda yadda yadda...</p>
  <p class="auth">- Dion, circa 2022,<br />post pandemic</p>
</blockquote>
<p>This is a normal paragraph after the blockquote.</p>
Click image for larger version

Name:	Screenshot 2022-03-18 101428.png
Views:	133
Size:	67.1 KB
ID:	192830


I only use classes when there is something different about that particular thing...otherwise I simply define the base tag...that keeps the code view nice and clean, reducing bloat. It drives me nuts when I see things like this on every paragraph:

<p style="margin:0.00% 0.00%; text-indent:1.2em; text-align:justify; widows:0; orphans:0"> <span style=" font-size:1.0rem">Hello.</span> </p>

when it could be just:

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

<p>Hello.</p>
Turtle91 is online now   Reply With Quote
Old 03-18-2022, 10:31 AM   #10
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,093
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
Quote:
Originally Posted by Karellen View Post
But the Libra2 completely ignored that and the quoted text just looked like the rest of the page.
I would bet that the Libra2 is like some other devices and either completely ignores the publisher/author css included in the book preferring it's own, internal css, OR, in order to allow the user to select their own margin/font/font-size/alignment, etc. it ignores those styles when used on <p>. That might be why it displays properly when using the blockquote.

Does the Libra2 have an option to use the "Publisher's styling" or something similar ??
Turtle91 is online now   Reply With Quote
Old 03-18-2022, 11:07 AM   #11
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,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by hobnail View Post
I didn't get an error from epubcheck when I made a block quote with no p tags in it.
They're not needed in epub3 books that contain HTML5 files
Doitsu is offline   Reply With Quote
Old 03-18-2022, 12:34 PM   #12
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,208
Karma: 16534692
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by hobnail View Post
I didn't get an error from epubcheck when I made a block quote with no p tags in it.
Quote:
Originally Posted by Doitsu View Post
They're not needed in epub3 books that contain HTML5 files
@Doitsu is correct - epubcheck v4.2.6 gives an error (actually 2 errors) if a <blockquote> tag in an EPUB2 contains text, but no error, for the same markup, if it's in an EPUB3.

Calibre's Check Book utility doesn't show an error for either EPUB2 or EPUB3. To the best of my knowledge, calibre tries to pay more attention to flagging errors that may cause actual problems in actual ereader apps than whether the (over-fussy???) rules of epubcheck are strictly followed.
jackie_w is offline   Reply With Quote
Old 03-18-2022, 03:29 PM   #13
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: 73,897
Karma: 128597114
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 Karellen View Post
I recently discovered that font-variant: small-caps; does not work in epubs used in Kobo Libra2

Now I have also noticed that quotes are a bit temperamental.

For example, when a character reads a printed document verbatim, it is usually displayed with wider margins, and maybe italicized. I tried replicating this with the following using <p class="quote"></p>
Spoiler:
.quote {
display: block;
font-size: 0.9em;
font-style: normal;
font-family: inherit;
padding-left: 50px;
padding-right: 50px;
padding-top: inherit;
padding-bottom: 0.1em;
text-indent: 0;
}


But the Libra2 completely ignored that and the quoted text just looked like the rest of the page.

The Libra2 expects <blockquote></blockquote>, then it displayed as quoted text.
I cannot stand those fake blockquotes. The following CSS code is what I use for blockquotes.

Code:
blockquote {
  margin-top: 1em;
  margin-right: 1.5em;
  margin-bottom: 1em;
  margin-left: 1.5em;
}
If the blockquote ends at the bottom of the page, I use the following code.

Code:
.blockquote {
  margin-top: 1em;
  margin-right: 1.5em;
  margin-bottom: 0;
  margin-left: 1.5em;
}
Code:
<blockquote class="blockquote">
<p>"This is at the end of the chapter"</p>
</blockquote>

Last edited by JSWolf; 03-23-2022 at 11:11 AM.
JSWolf is offline   Reply With Quote
Old 03-18-2022, 03:32 PM   #14
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,460
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by jackie_w View Post
It may be because you've specified the left/right increased margins as 50px, i.e absolute units. Try using em units instead, e.g. this is what I use:
Code:
  
  margin-left: 2em;
  margin-right: 2em;
but use whatever works for you.

I think a <blockquote> has default increased left/right margins even if you don't include any explicit CSS for it.

♪ Hello blockquotes my old friends,
I've come to use you once again...♫

Dang, I love blockquotes and I remember when we used to stack 'em, for old MOBI (KF7) format, to try to create any sort of indent, lol. One for the first-level indent, stacked for the 2nd...

Yeah, yeah, I know, this is the ePUB forum, but...just a quick trip down memory lane.

Oh, right the actual question--we slap paragraph tags around them inside the blockquote for safety (fallback, etc.). We figure, it doesn't hurt.

FWIW.

Hitch
Hitch is offline   Reply With Quote
Old 03-18-2022, 03:35 PM   #15
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: 73,897
Karma: 128597114
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 Hitch View Post
Oh, right the actual question--we slap paragraph tags around them inside the blockquote for safety (fallback, etc.). We figure, it doesn't hurt.
I agree. This makes things more compatible with less risk of breakage.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
change British quotes to American quotes lumpynose Sigil 3 08-28-2019 12:20 PM
Quotes/smart quotes in S&R MerlinMama Editor 7 07-19-2016 11:00 PM
How to convert straight quotes to smart 'curly' typographer's quotes bookman156 ePub 52 06-20-2016 03:09 PM
Change single quotes to double quotes Elfwreck Workshop 16 04-26-2013 10:06 AM
convert straight quotes to curly quotes alansplace Calibre 3 09-25-2010 03:51 PM


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


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