Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 05-16-2012, 12:21 PM   #1
GraciousMe
Zealot
GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.
 
Posts: 101
Karma: 202774
Join Date: Apr 2012
Device: none
Question What code should go into every chapter?

Hello

I wonder if there is an obligatory code that should be in every single chapter of an epub book, or if it´s enough to have it in the first chapter?

I guess this

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="My Title" name="Title" />
<meta content="My Name" name="Author" />
<link href="../Styles/style.css" rel="stylesheet" type="text/css" />

<title>Book</title>

</head>


is obligatory (?).

Anything more?
GraciousMe is offline   Reply With Quote
Old 05-16-2012, 12:55 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: 29,806
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:
Originally Posted by GraciousMe View Post
Hello

I wonder if there is an obligatory code that should be in every single chapter of an epub book, or if it´s enough to have it in the first chapter?

I guess this

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="My Title" name="Title" />
<meta content="My Name" name="Author" />
<link href="../Styles/style.css" rel="stylesheet" type="text/css" />

<title>Book</title>

</head>


is obligatory (?).

Anything more?
The orange is optional (technically). Of Coarse, your style sheet will have no effect
The Stuff between <body> tags is also not required

Go read basis HTML rules. Validate your code using one of the Validation services/tools at w3.org

Why are you even sweating this small stuff ?
theducks is offline   Reply With Quote
Advert
Old 05-16-2012, 02:03 PM   #3
GraciousMe
Zealot
GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.
 
Posts: 101
Karma: 202774
Join Date: Apr 2012
Device: none
Quote:
Originally Posted by theducks View Post
The orange is optional (technically). Of Coarse, your style sheet will have no effect
The Stuff between <body> tags is also not required
I know basic HTML. CSS and epub are new to me.

Your answer only made me more confused.
GraciousMe is offline   Reply With Quote
Old 05-16-2012, 04:48 PM   #4
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,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
At a bare minimum, your html file should look like this:

Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
  <link href="../Styles/style.css" rel="stylesheet" type="text/css" />
</head>

<body>
  <h3>Chapter 1</h3>

  <p>It was a dark and stormy night...</p>
</body>
</html>
You can add as many meta tags as you like, but since they'll be ignored it'd be rather pointless. (Metadata only needs to be entered once via Edit > Meta Editor.)

The <title></title> tags are required, but since they are usually ignored by the ePub reader software, you can leave them empty.

However, you should definitely keep the stylesheet reference. Also don't forget to enclose the chapter header in header tags (h1, h2, h3 ...). Otherwise you won't be able to automatically generate the toc.

Last edited by Doitsu; 05-16-2012 at 04:55 PM.
Doitsu is offline   Reply With Quote
Old 05-16-2012, 07:19 PM   #5
GraciousMe
Zealot
GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.
 
Posts: 101
Karma: 202774
Join Date: Apr 2012
Device: none
That sparse, Doitsu?

Lovely. Room to breathe...
GraciousMe is offline   Reply With Quote
Advert
Old 05-17-2012, 04:01 AM   #6
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
The DOCTYPE directive is optional, anyway, you can safely remove it (and you must if there is SVG in the file).
Jellby is offline   Reply With Quote
Old 05-17-2012, 12:13 PM   #7
GraciousMe
Zealot
GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.
 
Posts: 101
Karma: 202774
Join Date: Apr 2012
Device: none
Quote:
Originally Posted by Doitsu View Post
At a bare minimum, your html file should look like this:

And this code goes into every chapter? (I have this idea that the first chapter is somehow special...)

Jellby, what is SVG?
GraciousMe is offline   Reply With Quote
Old 05-17-2012, 12:20 PM   #8
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,551
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by GraciousMe View Post
And this code goes into every chapter? (I have this idea that the first chapter is somehow special...)
This code goes into every (x)html file that you have included in your epub. "Chapter" is a bit ambiguous and not always relevant. And no... there's nothing inherently special about the "first" html file in your epub.

Last edited by DiapDealer; 05-17-2012 at 12:38 PM.
DiapDealer is offline   Reply With Quote
Old 05-17-2012, 04:19 PM   #9
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by Jellby View Post
The DOCTYPE directive is optional, anyway, you can safely remove it (and you must if there is SVG in the file).
?? I never remove the DOCTYPE when I use SVG. Neither as reference or as inline. It still works and validates fine.
Toxaris is offline   Reply With Quote
Old 05-18-2012, 04:59 AM   #10
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Does it? When I started validating (I don't remember if it was epubcheck or flightcrew, or both) I got an error with inline SVG and DTD and, as far as I know, the XHTML 1.1 doctype does not allow inline SVG

Have a look here: http://www.daisy.org/epub/issues/cla...e-allowed-epub particularly at message #49

My understanding now is that DOCTYPE is not necessary, but if it's used it must be the right one for the content, and HTML+SVG is not valid in the XHTML 1.1 DOCTYPE. So, if you are going to use them, either you must include a custom DOCTYPE, or just remove the line, as it's not needed anyway.
Jellby is offline   Reply With Quote
Old 05-18-2012, 05:00 AM   #11
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by GraciousMe View Post
Jellby, what is SVG?
SVG=Scalable Vector Graphics

It's a graphics programming language, that allows to create resolution-independent graphics.
Jellby is offline   Reply With Quote
Old 05-18-2012, 08:15 AM   #12
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by Jellby View Post
Does it? When I started validating (I don't remember if it was epubcheck or flightcrew, or both) I got an error with inline SVG and DTD and, as far as I know, the XHTML 1.1 doctype does not allow inline SVG

Have a look here: http://www.daisy.org/epub/issues/cla...e-allowed-epub particularly at message #49

My understanding now is that DOCTYPE is not necessary, but if it's used it must be the right one for the content, and HTML+SVG is not valid in the XHTML 1.1 DOCTYPE. So, if you are going to use them, either you must include a custom DOCTYPE, or just remove the line, as it's not needed anyway.
Really, it does. It perhaps depends on the usage of SVG though. Perhaps if you use certain SVG commands it is not supported.
It probably depends on how you use the SVG. If you embed it, there is an SVG file added. In the SVG file there is no DOCTYPE. However, if I take the content of the SVG file (only the <svg> tags and everything in between), I can past it in a normal XHTML file with DOCTYPE without an issue. I must put the <svg> in <div> tags of course, but that is normal.

I usually don't do very complex things in SVG, which might be the reason why it works.
Toxaris is offline   Reply With Quote
Old 05-18-2012, 08:47 AM   #13
GraciousMe
Zealot
GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.GraciousMe ought to be getting tired of karma fortunes by now.
 
Posts: 101
Karma: 202774
Join Date: Apr 2012
Device: none
Thanks.

And what about this, should it go into the file?

<body xml:lang="SV" xmlns:xml="http://www.w3.org/XML/1998/namespace">

Or is language only something for the CSS?
GraciousMe is offline   Reply With Quote
Old 05-26-2012, 02:56 PM   #14
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,987
Karma: 128903378
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 Doitsu View Post
At a bare minimum, your html file should look like this:

Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
  <link href="../Styles/style.css" rel="stylesheet" type="text/css" />
</head>

<body>
  <h3>Chapter 1</h3>

  <p>It was a dark and stormy night...</p>
</body>
</html>
You can add as many meta tags as you like, but since they'll be ignored it'd be rather pointless. (Metadata only needs to be entered once via Edit > Meta Editor.)

The <title></title> tags are required, but since they are usually ignored by the ePub reader software, you can leave them empty.

However, you should definitely keep the stylesheet reference. Also don't forget to enclose the chapter header in header tags (h1, h2, h3 ...). Otherwise you won't be able to automatically generate the toc.
I'll have to disagree using <h3> for chapter titles. I'd go with <h2>.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ebook chapter titles: with or without chapter number? amoroso Writers' Corner 16 06-14-2011 06:35 AM
What are SGF Chapter Marker and Chapter Break? webphone Sigil 1 05-25-2011 02:43 PM
Next Chapter skips to End in last chapter? JoGoCo Kobo Reader 5 07-13-2010 09:23 PM
Let's create a source code repository for DR 800 related code? jraf iRex 3 03-11-2010 12:26 PM
K2 v K1: Chapter-to-chapter missing from some books? Starhawk Amazon Kindle 4 03-10-2009 06:27 PM


All times are GMT -4. The time now is 02:50 PM.


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