Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 06-12-2020, 06:28 AM   #16
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: 74,037
Karma: 129333114
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 Sarmat89 View Post
h element is useless.
It was intended for manuals, which use hierarchical headers, like
0.1 Introduction
Books, even non-fiction, do not use hierarchical headers; headers in books are complex structures which span several paragraphs. p is the only logical choice.

Also, div is used instead of p to fix the extra space between paragraphs.
The h element is useful in Calibre's editor and Sigil for easily generating a ToC.
JSWolf is online now   Reply With Quote
Old 06-12-2020, 06:48 AM   #17
Sarmat89
Evangelist
Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.
 
Posts: 482
Karma: 2267928
Join Date: Nov 2015
Device: none
You don't use the heading textual content for ToC, as they differ. There is a weird solution of creating an empty h# element, and assigning its title attribute to the manually created text.
Sarmat89 is online now   Reply With Quote
Advert
Old 06-12-2020, 07:48 AM   #18
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: 74,037
Karma: 129333114
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 Sarmat89 View Post
You don't use the heading textual content for ToC, as they differ. There is a weird solution of creating an empty h# element, and assigning its title attribute to the manually created text.
That weird solution is not a solution. It's sloppy code.
JSWolf is online now   Reply With Quote
Old 06-12-2020, 08:59 AM   #19
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,462
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 Sarmat89 View Post
h element is useless.
It was intended for manuals, which use hierarchical headers, like
0.1 Introduction
Books, even non-fiction, do not use hierarchical headers; headers in books are complex structures which span several paragraphs. p is the only logical choice.
Sez you. We've done many books in which we have hierarchal headers.

Quote:
Also, div is used instead of p to fix the extra space between paragraphs.
What? That's a ridiculous "solution." How about using CSS, as it was intended? Using Div instead of p? So, what, use the wrong coding, because somebody doesn't know the right coding? Hell, why not just use /b between paragraphs--hey, that works TOO!

Oh, yeah, that's a great solution. /sarcasm.

Hitch
Hitch is offline   Reply With Quote
Old 06-12-2020, 09:06 AM   #20
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: 74,037
Karma: 129333114
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
Sez you. We've done many books in which we have hierarchal headers.



What? That's a ridiculous "solution." How about using CSS, as it was intended? Using Div instead of p? So, what, use the wrong coding, because somebody doesn't know the right coding? Hell, why not just use /b between paragraphs--hey, that works TOO!

Oh, yeah, that's a great solution. /sarcasm.

Hitch
What I want to know is why so many publishers have no idea how to properly use <p> and have to stick in a class for the most use paragraph style instead of just coding for <p> in CSS?

As for <div> where <p> should be, I find that very sloppy and that does get fixed. There's a lot of things that could be done, but a lot of it is sloppy have violates the keep it simple rule.

When I fix up a sloppy ePub, it's a lot neater. It may not be perfect as there could be excess lines in the CSS and I don't change <p> in chapter headers for h?, but when I am done, the code can be much neater.

The other thing I find atrocious is when there are hundreds of extra classes that never get used in the CSS/HTML.
JSWolf is online now   Reply With Quote
Advert
Old 06-12-2020, 09:22 AM   #21
Sarmat89
Evangelist
Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.
 
Posts: 482
Karma: 2267928
Join Date: Nov 2015
Device: none
In books, headings are not hierarchical. Everything over the chapter layer is usually something manually created and fancy, like a picture.
The chapter headers are usually going like that:
ONE
[some fancy graphics]
It Begins
while in the ToC something like that is put:
Chapter one. It Begins
HTML hierarchic headers are useless here.
Sarmat89 is online now   Reply With Quote
Old 06-12-2020, 10:12 AM   #22
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,462
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 Sarmat89 View Post
In books, headings are not hierarchical. Everything over the chapter layer is usually something manually created and fancy, like a picture.
The chapter headers are usually going like that:
ONE
[some fancy graphics]
It Begins
while in the ToC something like that is put:
Chapter one. It Begins
HTML hierarchic headers are useless here.
No. That's your opinion, which you are holding to suit your idea that it's fine to use divs for body content and p for headings. It's inaccurate. You're basing that on novels, not "all books." I have PLENTY of books that use a hierarchy. Headings, subheads and so forth. The reason I'm so painfully aware of how many of these we do, is due to K4PC's limited ability to display multi-dimensional TOCs.

I mean, really--for those who have visual difficulties, why is it such skin off of anyone's nose, to use p for paragraphs (shocking idea, I know) and headings for, well, headings? How can one possibly be so much simpler than another, or is this just one of those "I feel like I should be arbitrary for the bloody sake of it" things? Gonna "stick it to the man," by using divs for ps and ps for headings???????

I mean, WHY?

Hitch
Hitch is offline   Reply With Quote
Old 06-12-2020, 10:42 AM   #23
Land_Outcast
Enthusiast
Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!
 
Posts: 43
Karma: 100000
Join Date: Jun 2018
Device: none
Quote:
Originally Posted by JSWolf View Post
What I want to know is why so many publishers have no idea how to properly use <p> and have to stick in a class for the most use paragraph style instead of just coding for <p> in CSS?
I can answer for myself: when I started working with ebooks, it was directly form InDesign exports, and therefore everything was assigned a class according to the style defined in InDesign. Therefore, I treated “p” or even “em” as a “superclass” or “category”, not to be used by themselves.
Now I know better, but still, I get why it happens.
Land_Outcast is offline   Reply With Quote
Old 06-12-2020, 10:46 AM   #24
Land_Outcast
Enthusiast
Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!Land_Outcast rocks like Gibraltar!
 
Posts: 43
Karma: 100000
Join Date: Jun 2018
Device: none
Quote:
Originally Posted by Sarmat89 View Post
In books, headings are not hierarchical. Everything over the chapter layer is usually something manually created and fancy, like a picture.
Oh, no, no. That line of thinking won't do.
Essays, academic text books, anthologies, biographies, cookbooks, journalistic investigations… they usually have complex structures, with parts, chapters, and sub-parts within the chapters, detailed bibliographies. And much more.
Land_Outcast is offline   Reply With Quote
Old 06-12-2020, 10:57 AM   #25
ps67
Guru
ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.ps67 ought to be getting tired of karma fortunes by now.
 
Posts: 732
Karma: 7025494
Join Date: Aug 2017
Location: Italy
Device: Kindle Paperwhite, Kobo Elipsa, Pocketbook Color PB633, Inkpad Color
I know a bit (just a bit) of Latex and I can easily understand that the h1 h2 ecc hierarchy is like the Latex hierarchy \part, \chapter, \section ecc. In the case of Latex the hierarchy is more explicitly semantic but the principle is the same. And also in Latex You could invent something else to obtain the same results, but why do it? (and nobody does it).

If You are coding a book for Yourself do what You want, everything works on Your ereader or Your app is good.

If You are coding a book in order to sell it on the various book stores, or freely distribute it to other person: please follow the advice of Hitch and other members here: h for headings (also in fiction book) and p for paragraphs.
ps67 is offline   Reply With Quote
Old 06-12-2020, 11:14 AM   #26
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,498
Karma: 145557716
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by JSWolf View Post
That weird solution is not a solution. It's sloppy code.
Not necessarily sloppy code. I used a non-displaying h with title when the book is using a graphic for the displayed title.

As for using h elements for a hierarchical TOC? One omnibus I recently read used h1 for the books, h2 for the parts within the books, h3 for chapters and h4 for sub-chapters. Made for an easy to follow TOC with no extra work required.
DNSB is offline   Reply With Quote
Old 06-12-2020, 11:18 AM   #27
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,099
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
It is certainly doable to use any tag in place of the proper tag...you can make anything look/behave like anything else just by adding the right css. But it messes up other aspects (such as the accessibility functions) when publishers don't stick with the semantically correct tags.

Different agencies work on their favorite aspect of e-publishing and they rely on the content providers to follow standards so that everyone's product plays well with everyone else's.

<h> for header
<p> for paragraph
<strong> for bold letters or special audio emphasis... <b> for visual representation only when you don't care about accessibility
<em> for italicized letters or different audio emphasis... <i> for visual representation only when you don't care about accessibility
<div> for a simple division of the text which can be used to define special styling in all manner of ways
<blockquote> for a literal representation of a long quote - not to be confused with a div even though the same visual styling can be achieved with css, audio play back would sound different with a blockquote vs. a div
Turtle91 is offline   Reply With Quote
Old 06-12-2020, 11:49 AM   #28
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: 74,037
Karma: 129333114
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 Land_Outcast View Post
I can answer for myself: when I started working with ebooks, it was directly form InDesign exports, and therefore everything was assigned a class according to the style defined in InDesign. Therefore, I treated “p” or even “em” as a “superclass” or “category”, not to be used by themselves.
Now I know better, but still, I get why it happens.
But it's trivial to fix <p>. I can do it in less then 5 minutes. Do most programs used to create eBooks force all p to have a class? Sigil and Calibre do not.
JSWolf is online now   Reply With Quote
Old 06-12-2020, 11:53 AM   #29
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: 74,037
Karma: 129333114
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 DNSB View Post
Not necessarily sloppy code. I used a non-displaying h with title when the book is using a graphic for the displayed title.

As for using h elements for a hierarchical TOC? One omnibus I recently read used h1 for the books, h2 for the parts within the books, h3 for chapters and h4 for sub-chapters. Made for an easy to follow TOC with no extra work required.
That is an unusual eBook. In most cases, it's <p> for all of that. I would like it if the authors spoke out about the way their books are make as eBooks so maybe things would be made properly.
JSWolf is online now   Reply With Quote
Old 06-12-2020, 11:56 AM   #30
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,099
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 DNSB View Post
Not necessarily sloppy code. I used a non-displaying h with title when the book is using a graphic for the displayed title.
Yes, I also use this technique when I don't want, or can't have, a visual representation on the page but still need the structural definition of a header...and the functionality of an auto-generated TOC.

eg.
Code:
<h2 title="Copyright" style="display:none" />
Turtle91 is offline   Reply With Quote
Reply

Tags
semantic markup


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Span Span Span Sigil cleaning up indesign blackest Sigil 31 12-06-2017 10:16 AM
Span Span Span Span MULTIVAC ePub 7 12-06-2014 08:58 AM
Nested Span? Turtle91 ePub 4 05-20-2013 02:47 PM
span in span: is this problematic? tbuyus ePub 8 03-31-2013 08:01 AM
Remove <br /> together with span, and only span Razzia Recipes 3 05-30-2011 06:55 PM


All times are GMT -4. The time now is 10:47 AM.


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