Home ยป Forum ยป Author Hangout

Forum: Author Hangout

EPUB issue?

StarFleet Carl ๐Ÿšซ

Just got an email this morning about an EPUB issue that I've never heard before.

What type of formatting are you using on the epub versions of ATH books 1 thru 3 on Bookapy?
I'd been using either "read" or PDF to view them since Firefox stopped supporting epub, but recently obtained 'epubfilereader' to read my archive of older epubs.
My Bookapy bookshelf contains some 20-25 purchases from Ernest, Rollie, Kris me, Ed Nelson and others, so I downloaded the epub versions of my purchases. However, in your three epub ATH files, the quote punctuation symbols are replaced by a gothic-like format 'eA' pairing that I've not seen in the other stories.
Nor am I seeing this pairing in ATH epub files from your SOL files.

I write my stories using Libre Office, I save them in HTML from that. I use Sigil to convert those to EPUB, and then use Calibre to create the PDF and MOBI files. I have not changed any of the default settings any of the files. I've had one (1) complaint about a paragraph formatting issue that was simply an extra font change in the middle of the paragraph that I rather quickly fixed.

When I view the EPUBs themselves here on MY computer - and on my laptop at my office - they look fine to me. Any ideas, or have any of you noticed that in the files I've uploaded? I've been doing this the same way since last summer, and I've never had anyone tell me about this.

Ernest Bywater ๐Ÿšซ

@StarFleet Carl

Check both the original Libre Office file and the epub file to see if you have embedded fonts or used any non-standard fonts as I've only seen that error reported when the software hits a font code it doesn't recognise.

Replies:   Vincent Berg
Vincent Berg ๐Ÿšซ

@Ernest Bywater

Check both the original Libre Office file and the epub file to see if you have embedded fonts or used any non-standard fonts as I've only seen that error reported when the software hits a font code it doesn't recognise.

That's a good point, as you'll generally want to replace ALL fonts from each formatted file. Each format (i.e. ePub, mobi and ePub) have their now self-defined fonts, and they're ALL mutually incompatible).

I believe that pdf has 3 pdf fonts, mobi has 5, while ePub has either 5 or 6. Whatever you do, do NOT try to install your own Calibre font file, as the process is incredibly complex (i.e. you'll have to define each individual font character based on a series of hex codes, for whichever font you want). However, the trick is that, since there are only so many predefined fonts, you're effectely replacing one of the predefined fonts, making it unavailable in the ePub. Trust me, I investigated it, and have zero desire to waste my time on such a mission!

Replies:   Ernest Bywater
Ernest Bywater ๐Ÿšซ

@Vincent Berg

That's a good point, as you'll generally want to replace ALL fonts from each formatted file. Each format (i.e. ePub, mobi and ePub) have their now self-defined fonts, and they're ALL mutually incompatible).

Actually, I get the best results by not identifying or install fonts within the epub file. If you don't embed any fonts in the epub and you don't state a specific font to use in the epub file code the epub readers will automatically use their default font set by the reader within the reader software or the system software font. This insures that the reader get to have it display in their choice of font.

The only font information I have in an epub are font size, bold, italics, and font colour.

Replies:   Keet  Vincent Berg
Keet ๐Ÿšซ

@Ernest Bywater

The only font information I have in an epub are font size, bold, italics, and font colour.

Perfectly clean! ONLY use fonts if you specifically want to force a small part to a specific font otherwise use the readers default by not including other font styles.

Vincent Berg ๐Ÿšซ

@Ernest Bywater

Actually, I get the best results by not identifying or install fonts within the epub file.

That was my point. I'd done the research, more to learn what was possible than any desire to actually undertake switching default fonts, and realized how few options there are concerning changing fonts.

Meanwhile, just like font choice, font size is also user controlled. You can change it, but that choice will likely incur user's wrath, though they'll likely quite your books rather than actually complaining about it.

Vincent Berg ๐Ÿšซ

@StarFleet Carl

While most ePubs are dependent on browser coding to operate, there is no requirement that the various browsers need to automatically open them. Tell your pal to search for an ePub reader Firefox plug-in (I haven't used FF in years, so the one I used to use is likely no longer functional any more). That should take care of your friends ability to access the ePubs. Most OSes generally have their own ePub readers, though each one calls their something slightly different, so you'll need to Google to fine out what it is (this is essential for testing your ePub files).

The odd symbol in place of the smart quotes (inward facing single and double quotation marks) result from your mistakenly formatting it incorrectly. All ePubs need to be formatted as UTF8, using the following line in the Header Section at the top of each html file used to compile the ePub (Note: You can't just change the text, you'll have to reformat the file to change the file type).

< meta http-equiv=Content-Type content="text/html; charset=utf-8">

However, before you do that, you'll have to manually replace each smart quote, any accented character (i.e.foreign phrases in your story) as well as any 'publishing' character (i.e. em-dashes and ellipses), so that they'll appear correctly in the new document. You can automate this process, but I'm not aware of any automatic conversion tools for them.

Once you've converted all those 'special characters', you can now do one of the following: either use a conversion tool (ex: Lazeez directed me to BBEdit, which handles this wonderfully) or simply create a new UTF8 html file and copy the converted text and paste it into the new file.

It's the new UTF8 html file that you'll need to submit to Calibre to both create the required ePub file, as well as to convert it into variety of other eBook formats.

Last but not least, you'll need to use Calibre to generate a list of ePub errors for you. Despite hand-crafting each of my files and stripping out all the kludgy 'legacy' code, I'll typically generate anyone from 5 to 20 errors on each of my ePubs each time I update a given ePub, so it's a fairly tedious process.

In Calibre you'll need to click on the "Edit Book" symbol at the top of the page (it's the purple book image just after the peach-colored "Remove books" icon). This will pop up a VERY complex tool, but in the upper right hand corner, you'll see a "Run check" link. If you press this, it'll generate a list of ALL the errors in your ePub.

Once you do this, click on each of the items highlighted in the upper left column (one at a time, of course). That same upper right Error column will list specifically what the error is, which section (chapter) it is, and an explanation of the error. Simply click the blue link and it'll fill in the bottom sections with the individual chapter's html file and highlight the line which generated the error.

You can try to click the "Try to correct all fixable errors automatically", but this typically will only fix a few, as the vast majority of ePub errors are automatically generated by the Calibre conversion process itself (where it converts your clean html code into the nonsensical Calibre paragraph types).

Fix whatever you can and then click on the "Re-run check" to see how many still remain, and keep doing this until you get a 'clean' copy. Note: you'll have to do this whole procedure every single time you update your existing ePub file, so you'll likely spend more time in Calibre's EDIT BOOK function than you did creating the html files to begin with.

Once you get used to that, either check back in here or send me a PM and I'll tell you which defaults you'll need to set for each specific document type, as Calibre's settings are pretty brain dead, and you'll need to manually activate the features of each format (i.e. epub, mobi, and pdf). But for now, that's best left until you get a clean ePub.

Good luck, and trust me, this process NEVER gets any easier, but so far, I've yet to meet a satisfactory ePub generator!

Replies:   StarFleet Carl
StarFleet Carl ๐Ÿšซ

@Vincent Berg

Here's the top code from a typical chapter, with the < and > deleted.

?xml version="1.0" encoding="utf-8"?
!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
meta http-equiv="content-type" content="text/html; charset=windows-1252"/

meta name="generator" content="LibreOffice 7.1.0.3 (Windows)"/
meta name="author" content="XXX - personal"/
meta name="created" content="2020-11-04T02:01:00Z"/
meta name="changedby" content="XXX - personal"/
meta name="changed" content="2021-02-14T13:38:07.190000000"/
style type="text/css"
@page { size: 8.5in 11in; margin: 0.79in }
p { margin-bottom: 0.08in; background: transparent }
/style
/head

Replies:   Keet  Vincent Berg
Keet ๐Ÿšซ

@StarFleet Carl

charset=windows-1252

As Vincent mentioned: always use UTF-8, NOT windows-1252.

Quasirandom ๐Ÿšซ

@Keet

Yup. Character encoding mismatch in action. The XML declaration even says utf-8 but then the html charset is different.

Replies:   StarFleet Carl
StarFleet Carl ๐Ÿšซ

@Quasirandom

And doing a universal replace to UTF-8 seems to have fixed it.

I remember the days when things were rather self-explanatory. What's annoying is that even reading through the manuals on how to use the software doesn't actually tell me the tricks Ernest did in an email.

Replies:   Vincent Berg
Vincent Berg ๐Ÿšซ

@StarFleet Carl

And doing a universal replace to UTF-8 seems to have fixed it.

It will, but you'll eventually discover random errors, especially if you generate ebook files via Calibre. I suffered those for a long run, before Lazeez finally suggested I use BBEdit to perform my conversions. Since then, I haven't had a single error (though honestly, I haven't been publishing much recently either).

StarFleet Carl ๐Ÿšซ

@Keet

As Vincent mentioned: always use UTF-8, NOT windows-1252.

It's not like I specifically knew anything about this, or how to change it. :)

The biggest thing we've figured out is his epub reader doesn't like curly quotes.

helmut_meukel ๐Ÿšซ

@StarFleet Carl

It's not like I specifically knew anything about this, or how to change it. :)

For a quick test I opened one of my eBooks in Calibre's eBook editor (ebook-edit.exe). This book didn't contain a line like
meta http-equiv="content-type" content="text/html; charset=windows-1252"/
so I inserted it (with the )
Then I clicked the "Run Check" link and got the message "No problems found", however the newly inserted line was changed to
meta http-equiv="content-type" content="text/html; charset=utf-8"/

So you probably have just to open your EPUB files, 'Run Check' and look if it automatically changed the charset entry.

If it worked just save the changed file.
Done.

HM.

helmut_meukel ๐Ÿšซ

@helmut_meukel

So you probably have just to open your EPUB files, 'Run Check' and look if it automatically changed the charset entry.

If it worked just save the changed file.

Oops, missed a step between the steps above:
On the right side it shows a preview of your eBook, look if it still displays the curly quotes correctly. (it should, but because my test file didn't originally contain that charset=windows-1225 I can't easily test it).

HM.

Replies:   StarFleet Carl
StarFleet Carl ๐Ÿšซ
Updated:

@helmut_meukel

On the right side it shows a preview of your eBook, look if it still displays the curly quotes correctly. (it should, but because my test file didn't originally contain that charset=windows-1225 I can't easily test it).

Looks good on my end, but ... it always did.

I've found an error that I'm not sure HOW it got there in one of the other books, where the left quote mark at the start of sentences ended up completely outside of the font size - on SOME of the sentences, but not all of them. I used to know HTML really well ... two decades ago.

Vincent Berg ๐Ÿšซ

@helmut_meukel

So you probably have just to open your EPUB files, 'Run Check' and look if it automatically changed the charset entry.

Actually M$ Word and (I'm assuming) Libre and OpenOffice have default html settings to establish they produce utf-8 files. The problem, is that it's much easier to use charset windows-1252 when submitting to SOL, or anywhere else, for that matter, as each browser 'imitates' a Windows formatting scheme. However, there's no such option for ePubs, and especially not for epub conversions.

Replies:   Keet
Keet ๐Ÿšซ
Updated:

@Vincent Berg

The problem, is that it's much easier to use charset windows-1252 when submitting to SOL, or anywhere else, for that matter, as each browser 'imitates' a Windows formatting scheme.

Just curious, but WHY is it easier? UTF-8 shouldn't be a problem anywhere, on the contrary, it should avoid possible problems, especially if it's web related.

ETA

Calibre has a setting to 'smarten punctuations', which include automatically modifying quotes to 'smart quotes'.

Is there a reason to force smart quotes? Do publishers require it or are there readers that notice the difference AND use it?

Replies:   Vincent Berg
Vincent Berg ๐Ÿšซ

@Keet

Just curious, but WHY is it easier? UTF-8 shouldn't be a problem anywhere, on the contrary, it should avoid possible problems, especially if it's web related.

It's more difficult, simply because it's nowhere near as simple as a straightforward web page is. It mostly affect smart quotes and publishing marks (ex: em-dots and ellipses), but also any kind of accent mark, which have to be manually inserted, which is a real pain in the butt.

Is there a reason to force smart quotes? Do publishers require it or are there readers that notice the difference AND use it?

Publishers don't require it, as it's considered the publishers responsibility to do the books design and formatting work, thus authors play no role in selecting those options. But since many of us are now publishing our own books, we're dealing with those issues anyone. But the publishing marks, just like the accent marks, are simply to make the story look more professional, rather than a slap-dash effort. It's more for distinguishing your work than it is to achieve any kind of 'standard'.

Thus, it's completely optional, and there's no reason for you and other authors to go to the extra work. But I've been putting in that extra work for the past ten years, so it's basically second nature to me now. Adding descriptions to my in-story images for the blind isn't necessary either, but it still seems worth the effort, since I already know how to do it and it really doesn't take that much extra time. Since I charge a little extra for my work, I like to give readers a little something extra for it.

In short, I prefer my books look as close as possible to the mainstream publishers' bestsellers, including customer designed covers, fonts, formatting, front and back matter, etc. I didn't undertake become an author as a part-time hobby. I'm serious about it, and try my best to produce a high-quality product.

Of course, the books don't pay for any of that extra effort, as they simply don't sell enough. But it's a matter of personal pride, and that means more to me than simply publishing an unformatted plain-text document. But I certainly don't expect anyone else to follow suit--otherwise mine wouldn't look better than everyone else's! ;)

Vincent Berg ๐Ÿšซ

@StarFleet Carl

The biggest thing we've figured out is his epub reader doesn't like curly quotes.

Actually, if you leave the normal 'straight' quotes, Calibre has a setting to 'smarten punctuations', which include automatically modifying quotes to 'smart quotes'. I'm unsure how they precisely do that, but โ€ฆ You'll find the setting in the "Look and Feel" section of the individual conversion step.

Replies:   helmut_meukel
helmut_meukel ๐Ÿšซ

@Vincent Berg

Actually, if you leave the normal 'straight' quotes, Calibre has a setting to 'smarten punctuations', which include automatically modifying quotes to 'smart quotes'. I'm unsure how they precisely do that, but โ€ฆ

Because normal 'straight' single quotes and apostrophes are the same character, calibre decides on the position of the apostrophe which typographical quote to use as replacement.
At the end of the word or within the word it's the closing single quote.
At the start of the word it's the opening single quote.
But this is wrong if it's used as the marking of the omission of one or more letters e.g. 'em (=them), 'cause (=because),...
There doesn't exist two position dependent typographical apostrophes, it's always the same as the closing single quote.
Wikipedia has more about smart quotes.

It's a pain in the ass to find and replace erroneously set opening single quotation marks where there should be an apostrophe.

HM.

Replies:   Vincent Berg
Vincent Berg ๐Ÿšซ

@helmut_meukel

Because normal 'straight' single quotes and apostrophes are the same character, calibre decides on the position of the apostrophe which typographical quote to use as replacement.

Thanks for the research HM. I'd seen the option, but never considered utilizing it, figuring it wouldn't be effective, no matter how they attempted to implement it (having coded before), so I figured it wasn't worth my time to even look into or experiment with it.

Replies:   Keet
Keet ๐Ÿšซ

@Vincent Berg

no matter how they attempted to implement it (having coded before), so I figured it wasn't worth my time to even look into or experiment with it.

Problems like these are what I try to solve with the services my company provides. With a lot of research, testing, and tweaking you can get very close to perfect but probably never 100%. One of the things that is most likely needed is a checklist with items like helmut_meukel mentioned ('em=them, 'cause=because) to handle these exceptions. That checklist will never be complete and some items might even be impossible because they have different meanings that require a different approach. I bet I could enhance the Calibre function a great deal but it would take a lot of work.
One possible easier approach could be to search-and-replace the smartquotes in a word document html export and replace them with the html code equivalent (ldquo; rdquo;).

Vincent Berg ๐Ÿšซ

@Keet

One possible easier approach could be to search-and-replace the smartquotes in a word document html export and replace them with the html code equivalent (ldquo; rdquo;).

That's precisely what I do, but since it's a manual procedure, I generally warn others before they attempt to undertake it, as it is a fairly tedious process. At least for newbie authors, it's easier just posting a text document and be done with it. Leave the more difficult bits to the old times who have already spent years researching the nitty-gritty literary details.

Replies:   Keet
Keet ๐Ÿšซ

@Vincent Berg

That's precisely what I do, but since it's a manual procedure, I generally warn others before they attempt to undertake it, as it is a fairly tedious process. At least for newbie authors, it's easier just posting a text document and be done with it. Leave the more difficult bits to the old times who have already spent years researching the nitty-gritty literary details.

Why manual? Write a little script that does the search-and-replace for all files in a directory. If you're on Linux there are even sneaky ways to integrate it in the filemanager, I don't know if that's possible on Windows.
Ok, you would still have to active the script manually ;)
Remember the golden rule: if you have to do it more than twice, script it.

Dominions Son ๐Ÿšซ

@Keet

Remember the golden rule: if you have to do it more than twice, script it.

I thought the golden rule was: He who has the gold makes the rules. :)

Replies:   Keet
Keet ๐Ÿšซ

@Dominions Son

@Keet
Remember the golden rule: if you have to do it more than twice, script it.


I thought the golden rule was: He who has the gold makes the rules. :)

I made that rule (for myself), no need for gold to make a rule :D

Michael Loucks ๐Ÿšซ

@Keet

Why manual? Write a little script that does the search-and-replace for all files in a directory. If you're on Linux there are even sneaky ways to integrate it in the filemanager, I don't know if that's possible on Windows.

BBEdit (where I do all my writing) on the Mac has a 'straighten quotes' option which I use religiously because my editor uses MS Word. I've also set Scrivner to not use them when I make my digital editions.

Now, if I could just have a setting to turn them off on SOL, I'd be happy, as using 'interior quotes' (a single quote) often confuses the engine.

Replies:   Vincent Berg
Vincent Berg ๐Ÿšซ

@Michael Loucks

BBEdit (where I do all my writing) on the Mac has a 'straighten quotes' option which I use religiously because my editor uses MS Word. I've also set Scrivner to not use them when I make my digital editions.

You can turn off that feature in Word. In fact, in virtually ever installation I've performed, you had to manually set it up to activate it.

For those posting as text file, it's much easier. This is for those of us who like to make things difficult, just because the end result looks a little 'prettier'.

Now, if I could just have a setting to turn them off on SOL, I'd be happy, as using 'interior quotes' (a single quote) often confuses the engine.

Try setting your systems' 'default language' to 'British English', as single-quotes should be the default.

Crumbly Writer ๐Ÿšซ

@Keet

Why manual? Write a little script that does the search-and-replace for all files in a directory. If you're on Linux there are even sneaky ways to integrate it in the filemanager, I don't know if that's possible on Windows.

Mainly because my favorite html editor (which show both source and output side by side) doesn't support it. While BBEdit does, but without samples, I haven't been able to make sense of their explanations of how to implement it.

Besides, I kinda prefer doing it by hand, since there's always the odd accent mark, which I tend not to even notice until I get in there and see what pops up (as a square box in the display).

Replies:   Keet
Keet ๐Ÿšซ

@Crumbly Writer

Mainly because my favorite html editor (which show both source and output side by side) doesn't support it.

I wasn't pointing to an editor for this, at least not the way BBEdit does. I was thinking about a shell script that iterates all html files in a directory and uses something like 'sed' to do the replacements.
('sed' is a linux editor that allows command line instructions.)
The same should be possible with a Windows power shell script but I'm not familiar with that.

Replies:   Crumbly Writer
Crumbly Writer ๐Ÿšซ

@Keet

('sed' is a linux editor that allows command line instructions.)

I know that the Intel Macs support sed, though I'm not sure whether the M1 models do. Besides, I haven't coded in that since way back in my DOS days!

Lazeez Jiddan (Webmaster)

@Crumbly Writer

I know that the Intel Macs support sed, though I'm not sure whether the M1 models do. Besides, I haven't coded in that since way back in my DOS days!

sed is part of unix and is included in every version of the Mac OS since version 10.0.

Brew has been updated for ARM architecture and installs most unix packages as ARM binaries on M1 Macs.

Although I know sed, I don't use it at all. I use BBEdit and script it with AppleScript!

Replies:   Crumbly Writer
Crumbly Writer ๐Ÿšซ

@Lazeez Jiddan (Webmaster)

Although I know sed, I don't use it at all. I use BBEdit and script it with AppleScript!

Duh! I wasn't even aware of that. Guess I'll need to start investigating how to code AppleScript.

helmut_meukel ๐Ÿšซ

@Keet

One possible easier approach could be to search-and-replace the smartquotes in a word document html export and replace them with the html code equivalent (ldquo; rdquo;).

Hmm, if you do so and then open your eBook in Calibre's edit program, if its check function doesn't find any errors it will report warnings about the use of 'named entities' claiming their use isn't fully supported by some eBook reader software!

I don't know how the main Calibre program handles 'named entities' because I don't use it to create eBooks from source files.
I use a eBook template containing a simple html cover page, my customized css file, container.xml, metadata.opf and toc.ncx. I use calibre's eBook edit program to add the html files to this template and then edit it. This way the eBooks I create from HTML files look exactly as I like it.

BTW, Calibre's eBook edit program changes โ€“ on the fly โ€“ the html codes wenn manually entered into the appropriate characters.

HM.

Replies:   Keet  Crumbly Writer
Keet ๐Ÿšซ

@helmut_meukel

I use a eBook template containing a simple html cover page, my customized css file, container.xml, metadata.opf and toc.ncx. I use calibre's eBook edit program to add the html files to this template and then edit it. This way the eBooks I create from HTML files look exactly as I like it.

Then why use calibre at all? You have your ebook virtually complete so you don't need calibre.
If you have the correct header lines in your chapter files just zip it all and rename .zip it to .epub. (Don't forget to copy and include the 20 byte mimetype file from any other epub.)

Dominions Son ๐Ÿšซ

@Keet

Then why use calibre at all?

To convert the epub to other e-book formats for broader sales?

Replies:   Keet
Keet ๐Ÿšซ

@Dominions Son

To convert the epub to other e-book formats for broader sales?

Didn't think of that, but that's a good reason.

Replies:   StarFleet Carl
StarFleet Carl ๐Ÿšซ
Updated:

@Keet

that's a good reason

I use Sigil to create my EPUB files, then only use Calibre to convert them to MOBI and PDF.

ETA It seems that a lot of my readers like the PDF files, based upon their emails.

Ernest Bywater ๐Ÿšซ

@StarFleet Carl

I use Sigil to create my EPUB files, then only use Calibre to convert them to MOBI and PDF.

I write in Libre Office and use its built-in converter to make a PDF file then I save it as HTML. I run a script I wrote to clean out the excess format code used to create what I call my BASE HTML. I then use a 2nd script to create a HTML optimised for SoL and add in the SoL CSS code. Then I run a 3rd script on the BASE HTML to create a HTML optimised for an EPUB and add in the EPUB CSS. I import this HTML into Calibre and create the EPUB and the MOBI file I post to Bookapy along with the PDF created earlier.

Although this involves a little extra work by me I find it results in a much smaller and cleaner EPUB file which means less for me to upload and less for the reader to download. Typically, the EPUB I create this was is about half or less than if I had created an EPUB directly from the word processor file.

Vincent Berg ๐Ÿšซ

@StarFleet Carl

I use Sigil to create my EPUB files, then only use Calibre to convert them to MOBI and PDF.

I take the long route, using my html chapter files to create a the ePub and mobi files in Calibre. However, I use use Calibre's .pdf for SW (to create a flowing page which virtually erases ALL of my page settings) while creating my Bookapy .pdf using the Mac's default "Save as pdf" since it creates a perfect replica of my source material without having to process it at all (in a slightly easer to use 6"x9" format.

I've never gotten a complaint about either from readers, who I have no clue whether readers prefer one or the other, fixed or variable length.

helmut_meukel ๐Ÿšซ

@Keet

Then why use calibre at all? You have your ebook virtually complete so you don't need calibre.
If you have the correct header lines in your chapter files

I'm no writer, except for some technical stuff like program documentation and manuals I did years ago.

I use Calibre for organizing the about 1000 eBooks I own. Less than 20 of these books are DRM protected.

I created about 180 eBooks from different sources (html and text). I add the chapter file(s) as is to the template then replace the header lines etc. above the chapter header with my header lines, delete all those unnecessary lines at the end of the file after the last sentence, change style information within the chapter, correct typos and punctuation errors. Calibre's eBook edit program is well suited for all this work.

For reading one of those about 1000 eBooks I either use a reader devise or more often read it on my laptop. On the laptop I use Calibre's eBook editor program, no reader program, because with the editor I can easily correct errors in the book. I hate to stumble over the same error
every time I reread a story.

HM.

Replies:   Keet  Vincent Berg
Keet ๐Ÿšซ
Updated:

@helmut_meukel

On the laptop I use Calibre's eBook editor program, no reader program, because with the editor I can easily correct errors in the book. I hate to stumble over the same error
every time I reread a story.

You use Calibre for 'everything' so your process is logical. I don't create ebooks (I'm just a reader) but I convert downloaded zips to my custom library which allows me to do the same editing you do in Calibre. I reread a lot and like you I hate to read the same errors again.
What this also allows me to do is to add extras like OpenStreetMap screenshots, tooltips for difficult (to me) words or expressions, images for very specific cars/plains/etc are mentioned. Just about everything I want. One very recent example: I hate the character lists in chapters from Uncle Jim's stories. I move all these to a single cast list that I add to the index. Next time I read it I have a much better reading experience.

Vincent Berg ๐Ÿšซ

@helmut_meukel

I use Calibre for organizing the about 1000 eBooks I own. Less than 20 of these books are DRM protected.

With a bibliography of 34+ books, with multiple versions of each (for each distributor, who have their own formatting standards), I ain't got no room left for reading material!

Each version on Calibre (SW & Bookapy) generates a variety of formats, so it's my central repository.

For reading, I simply launch Apple's Book app and go from there, as it's got all the functionality I really need, and I'd rather not use Amz for obvious reasons!

Crumbly Writer ๐Ÿšซ

@helmut_meukel

BTW, Calibre's eBook edit program changes โ€“ on the fly โ€“ the html codes wenn manually entered into the appropriate characters.

I've noticed. On every single one of my eBooks, it manages to change a single instance of my 'align center' style type to 'centered'. Why, I haven't been able to figure out yet, since they rename every single user-defined style into a particular Calibre definition.

Calibre be a funky beast!

Replies:   Ernest Bywater
Ernest Bywater ๐Ÿšซ

@Crumbly Writer

Why, I haven't been able to figure out yet, since they rename every single user-defined style into a particular Calibre definition.

There may be an issue with how you're designating your CSS or you class codes as I used to have that problem until I started designating every item style and format code in the CSS code of the HTML file. Now I don't get that unless I forget to designate something. I'd be happy to check any problem cases you have, if you want me to. You know my email address, so just send a copy of the before and after files for me to compare.

Replies:   Crumbly Writer
Crumbly Writer ๐Ÿšซ

@Ernest Bywater

just send a copy of the before and after files for me to compare.

A copy of the source html or the problematic Calibre file?

My Style Definitions are:

p.Center
{
text-indent: 0em;
text-align:center;
margin-bottom: 0em;
}
p.Centered, p.centered
{
text-indent:0em;
text-align:center;
margin-bottom:0.5em;
}
span.Center
{align-content: center;}
span.centered
{
text-indent: 0em;
text-align: center;
margin-top:0em;
margin-bottom:0.5em;
}

As you can tell, the "Center" commands are just that, while the "centered" have a larger space at the bottom. The "Span" definitions are because Apple requires the for any graphic images. But for some odd reason, Calibre seems to be adapting the Style title, rather than the specific CSS definition.

Replies:   Ernest Bywater
Ernest Bywater ๐Ÿšซ
Updated:

@Crumbly Writer

CW, I'm not sure if the way you've coded that is correct. This is how I code the relevant sections of my CSS for paragraph codes for the general text paragraphs and the centered paragraphs of which I have 2 - one for general centered text and one for no space between the paragraphs:

.body {
color: black;
display: block;
font-size: 1.0em;
font-style: normal;
font-variant: normal;
font-weight: normal;
line-height: 1.0em;
text-align: left;
text-indent: 1.5em;
padding-top: 1.0em;
margin: 0
}
.center {
color: black;
display: block;
font-size: 1.0em;
font-style: normal;
font-weight: normal;
line-height: 1.0em;
text-align: center;
text-indent: 0.0cm;
padding-top: 1.0em;
margin: 0
}
.poem {
color: black;
display: block;
font-size: 1.0em;
font-style: normal;
font-weight: normal;
line-height: 1.0em;
text-align: center;
text-indent: 0.0cm;
padding-top: 0.0em;
margin: 0
}

The code I use in the text is:

< p class="body" >General text< /p >

< p class="center" >30 November 2021 version< /p >
< p class="poem" >Published by Ernest Bywater< /p >

There are a lot more paragraph styles I use, but these are the ones relevant to the usage you mentioned.

edited to stop the html code running by inserting blank spaces.

Note: the code I use works perfectly every time in the EPUb and as plain HTML.

richardshagrin ๐Ÿšซ

@Ernest Bywater

EPUb

A Pub is an English bar. If it were electronic it would be an E-Pub.

"Why is a pub called a pub?

Pub is short for Public House. The British have been drinking ale in pubs (public houses or ale houses) since the bronze age serving traditional English ale which was made solely from fermented malt and distinctive to each ale house."

Keet ๐Ÿšซ
Updated:

@Ernest Bywater

.center {
color: black;
display: block;
font-size: 1.0em;
font-style: normal;
font-weight: normal;
line-height: 1.0em;
text-align: center;
text-indent: 0.0cm;
padding-top: 1.0em;
margin: 0
}

Since this is specifically for your own epubs you can do it this way but for general use you shouldn't mix with color, fonts, etc for a declaration of 'center'. '.center' should do what it says: centering.

For example:
.center {
display: block;
line-height: 1.0em;
text-align: center;
text-indent: 0.0cm;
padding-top: 1.0em;
margin: 0}

.black{
color: black;}

.fontnormal{
font-size:1.0em;
font-style:normal;
font-weight:normal;}

And use it like this:

< p class="center black fontnormal" > ...
Doing it like that means you can use .black and .fontnormal also for non-centered p's.

ETA: (concerns both epub2 and epub3) Your usage of line-height might give problems with user settings on kobo devices. You can solve that this way:
body { line-height: 1.0em; }
body * { line-height: inherit; }

ETA 2: Last I read Kindle has a problem with line-heights less than 1.2 and will default to 1.75 on some Kindle devices.

Ernest Bywater ๐Ÿšซ

@Keet

Keet,

I use the process I do as it's straight from some the books I have on CSS in HTML and what I've found on websites about CSS when designating paragraph styles. I sue the same CSS code for my own HTML web page and it works for the EPUB as well. While I do include colours in the EPUB file I am aware some of the e-book readers strip out the colour format code and display it all in reader's default colour, but some do leave the code in and that makes for a nicer presentation for those who have those e-book readers.

In the earlier post I provided a few examples of what I use, but in the full CSS code I have 18 paragraph styles, 3 character colour format designations (red, blue, green), and two character format designation (bold, italics), with black being designated only in the paragraph styles. Each of these styles has a specific purpose and each one matches exactly a style I use in the original word processing documents; also, by doing things the way I do it's very simple to convert from the word processing style to the CSS designated style using a simple script. If I do as you state above it would create a lot of extra work for me to get and check the proper variations for each paragraph style.

The CSS paragraph styles use a mix of font colours (black, blue, red, and green), character type (normal, bold, and italics), alignments (left, centre, and justify), font size (1.0em, 1.6em, 2.0em, 1.4em, and 3.0em), padding-top (1.0em, and 0.0em), indentation (1.5em), and side margins (2.2em).

Were I to switch to the method you state I would have to add a hell of a lot more code in the file as where I currently have the main text body designated at < p class = body > I would have to have < p class = black fontnormal > and for chapter headings I'd have to include the font-colour, font-size, alignment, and font-variant, etc. for every usage.

Since I switched to this a few years ago I've not had anyone say it caused them a problem on their e-book readers.

Replies:   Keet
Keet ๐Ÿšซ

@Ernest Bywater

Since I switched to this a few years ago I've not had anyone say it caused them a problem on their e-book readers.

Of course it's no problem. As I stated, for you it's alright because it's exclusive for your use and you use it consistently for all your books. For someone who is starting and in the first stages of designing his css it's better to set it up more generic. This comes in handy when you have to update all your books at a later time and want to use the same css file for all. You have already reached that state so you can use that for all books.

Vincent Berg ๐Ÿšซ

@Keet

ETA 2: Last I read Kindle has a problem with line-heights less than 1.2 and will default to 1.75 on some Kindle devices.

Those are all reasons why I prefer to use relative settings (ex: text-indent: 0.0em;) rather than physical dimensions. That way, it'll leave the reader's personal settings alone, while hot triggering the formatter to dump the command it it violates their 'personal device settings'.

Replies:   Keet
Keet ๐Ÿšซ

@Vincent Berg

Those are all reasons why I prefer to use relative settings (ex: text-indent: 0.0em;) rather than physical dimensions.

Yes, that's why I mostly use em, rem, and % for dimensions in css. They work extremely well with resizing everything relative to each other. You can even use em for border corner rounding instead of px.

Crumbly Writer ๐Ÿšซ

@Ernest Bywater

CW, I'm not sure if the way you've coded that is correct.

Aside from the extraneous detail (potentially resetting the readers' personal settings), I can't see anything different between your approach and mine. (Yes, I know how to employ settings that I've defined in my eBooks). The only essential difference is my semicolon on my final setting command, but that's never triggered any issues before (though I can see how it might trigger intermittent errors). I'm not sure how to interpret the black space at the end of each line, whether that was your point or simply SOL's way of formatting the normal end-of-line command.

Personally, I end each html/ePub command with a backslash (i.e. < br>), rather than using extra spaces which are typically ignored by html.

Vincent Berg ๐Ÿšซ

@StarFleet Carl

meta http-equiv="content-type" content="text/html; charset=windows-1252"/

As Keet notes, your 'meta http-equiv="content-type" content="text/html; charset=windows-1252"/' directly contradicts your subsequent charset argument (i.e. it never affects how the story is actually formatted).

Back to Top

 

WARNING! ADULT CONTENT...

Storiesonline is for adult entertainment only. By accessing this site you declare that you are of legal age and that you agree with our Terms of Service and Privacy Policy.


Log In