Book-writing with Writer

Hi again.

OK. I've been through the eLAIX extension and found it works quite well. I have successfully exported the first chapter of the Getting started with LO 4.0 guide (the one titled "Introducing LibreOffice"). Main problems I had were:

- eLAIX doesn't like custom styles for headings, I had to change the headings to the standard values. I didn't gave them the properties the original document headings had (fonts, colour, etc.) but it could be easily done. It's probably useless, though, because most readers would ignore this settings. I think Virgil had problems with customized styles with the writer2epub extension too.

- The first item on the lists would display different from the rest, because two different custom styles were used to create lists in this ODT: one for the first item and another for the rest of the list. Don't know why, but just giving standard list style to all solved the problem.

- For some reason I don't understand, but may be something regarding frames, eLAIX failed to export the images embedded in the document. I solved this by extracting the "Pictures" folder from the ODT file (I used 7-zip) and then eliminating each image from the original document and inserting it again via the macro provided by eLAIX itself to insert pictures. Then, the images were properly exported.

- eLAIX creates its own index, so I eliminated the ODT index.

- When opening the epub file in my reader, I found a weird thing about the "figure" fields. These are auto-numeric fields used in the captions that follow images, like, let's say: "Figure 1, LibreOffice starting window". The number here is introduced as a field (which is wise if one doesn't want to keep on updating the captions manually). Well, my reader marked these as links that linked to the beginning of the epub. This is not solved in my export. Rough solution, to eliminate the field and work the captions manually.

So, my experience with eLAIX is that it would do a pretty good job, but it would take some time and effort. By the way, is there a method to make Writer select all the text with a specific style so then one can change the style of similar headings at a time? It will reduce a lot of work just to tell Write: "take all the text styled as OOoHeader1 and change it into Header 1."

Now, there is another much easier way to export ODT into EPUB, specially if they are well built, like is the case with the LO documentation: to pass them through the calibre ( http://calibre-ebook.com/ ) converter. I checked this with the full Getting Started Guide. It took to it quite an hour and a half in this laptop I'm using (which is not the most powerful one in the world) and it gave a reasonably good EPUB. Just two main problems:

- It changes page with each new chapter or sub-chapter, so the epub has more pages than the ODT, and all the references in the original text (go to page x") make no sense, though the links will still link to the good place. Same thing for the numbers of page in the index. Maybe this can be fixed through calibre's configuration, I haven't tried that.

- Some frames are rendered in a way that they don't fit in the reader's screen, so they remain partially illegible.

Both these problems could be solved by editing the ODT prior to the calibre exportation, eliminating the numbers of page in the references and the index and making the frames smaller.

Conclusion: eLAIX could do the job, is more flexible and works as a part of Writer. Calibre will do a more quick and less accurate work, and is third-party software, not related to LibreOffice. Still, if one just uses the exporting tools of eLAIX and calibre without any previous editing of the ODT files, calibre will come with a much better epub than eLAIX.

But all of this means nothing if you don't check the epubs by yourselves. How can I share them? I'm not sure that attaching them to a mail to this list would be the appropriate way. I wait for your comments.

Regards,
Joaquín

save the original as docbook and use pandoc to convert to epub or epub3
and compare :wink:

using elaix
you can do a global search and replace (easier I think with the alt
replace ext.) of the headings used in a doc with the headings elaix
employs. Took just a few minutes once you understand how to do that.
HOWEVER you can always select to include the existing headings without
the search and replace [and this worked as well, so no reheading was
actually necessary :slight_smile: ]
elaix added the larger images, which none of the other options handled
well (there are two different styles of images in the
GS4001-IntroducingLibreOffice.odt file, however, elaix also produce the
tiny png files too large

using pandoc
download the odt file and save as a docbook which will produce an xml file
now from command line run pandoc
host:directory user$ pandoc -f docbook -t epub -s GS4001.xml -o
gettingstarted.epub

pandoc can also produce epub3 with mathml

there will be some glitches here and there but it will likely present
fewer issues than many other options for converting docs already
formatted, such as the guides. I noticed that there were some issues
with the different graphic files.

using writer2xhtml
actually, if anything, using writer2xhtml
(http://extensions.libreoffice.org/extension-center/writer2xhtml) to
export to epub is the simplest (though there has not been any recent
work on the product) though images were an issue.

Ok. Thanks for the extensive information on the three ways of exporting, Marc. Guess it kind of solve the question started by Tom. I could try to export some of the manuals, if you people decide it's worth it, but I can't devote too much time to it.
Regards,
Joaquín

Hi :slight_smile:
+1
Thanks Marc :)  Also many thanks to Joaquín and Virgil for experimenting and finding out how well the theories work out in practice.

If anyone does have the time to take this forwards and create ePubs of the latest available versions of any of the guides in
https://wiki.documentfoundation.org/Documentation/Publications
Then that might be really helpful.  I think the Docs Team would want to have a quick prood-read before getting them out there into ePub stores for as low price as reasonably possible and with profits going back into the community.

There is no chance of getting paid for doing this work for the official guides just as almost all of us don't get paid for trying to help people with specific issues on this mailing list but it's all good experience and often interesting to learn about these sorts of things.  Also interesting how it might take ages to do the first one but then gets faster and better quality each time.

Personally i'd really like to see the Base handbook as an ePub if anyone has time to try that as the next experiment.  Obviously the "Getting Started Guide" is always the most important to get out there first. 
Regards from
Tom :slight_smile:

Hi.

Right. I'll give it a more serious try. I shall begin with the Getting Start Gide for 4.0, then. Keep you informed on the progress.

Regards,
Joaquín

I just tried the eLaix extension. As a quick test, I just converted the eLaix manual itself, a thirty page, highly formatted .odt file. I worked surprisingly well, with just a few quirks. I look forward to using it more.

Virgil

display graphics, it's not very elegant. I've found that books with anything

more than a stream of text create issues for the Kindle.

Thankfully there are a multitude of other devices available with the
better advantage of epub support.

I have to wonder if the LO user guides are simply too complex for elegant
translation to e-reader format.

They should be; if an academic article with maths and graphics (e.g.
http://downloads.hindawi.com/journals/jtc/2013/349870.epub) can be
created, the LO user guides should be possible.

display graphics, it's not very elegant. I've found that books with
anything

more than a stream of text create issues for the Kindle.

Ultimately, in the end, you have to export (save as) to HTML anyway (to
import into Calibre). Once you've done that, you can arrange your graphics
as you see fit. But just taking a LibreOffice doc (with images) and
getting into a format the meatgrinder of various ebook sites will accept
(such as Amazon, B&N, Smashwords, Kobo, etc) will be a challenge.

Hi :slight_smile:
That was an interesting choice that i wouldn't have considered.  Nice one!  Hopefully that might make it easier for people with a good reason for wanting ePubs to make them for themselves.

Is there any chance of forwarding your work to the Docs Team here?  Perhaps ask them if they could get it into Lulu and/or more relevant stores as a 3rd party guide?  What license does the original eLaix guide use?  Is it a "CC by SA" copy-left agreement?  Could you relicense the new work with the same license?  Typically with the official guides they use the CC-by-SA (a Creative Commons copy-left license) and so contributors are expected to add their own name to the list of contributors.  Some people are too shy to do so but i quite like the list showing lots of names to show off the variety of people involved.

Regards from
Tom :slight_smile:

Hi :slight_smile:

That would be really great!  Thanks Joaquín! :)  If possible, please add your name to the list of contributors before making the ePub version.  I think that means it will only appear in the ePub version but hopefully someone might add your name to the main version next time.

Many thanks and regards from
Tom :slight_smile:

>>
>> display graphics, it's not very elegant. I've found that books with
>> anything
>>
>> more than a stream of text create issues for the Kindle.

Ultimately, in the end, you have to export (save as) to HTML anyway (to
import into Calibre). Once you've done that, you can arrange your graphics
as you see fit. But just taking a LibreOffice doc (with images) and
getting into a format the meatgrinder of various ebook sites will accept
(such as Amazon, B&N, Smashwords, Kobo, etc) will be a challenge.

Wrong! Calibre does a great job of converting .odt to ePub without an

intermediate conversion to HTML.

Wrong! Calibre does a great job of converting .odt to ePub without an

intermediate conversion to HTML.

That may be the case, but formatting from HTML will render better results
when doing the conversion. This is especially true when uploading books to
Barnes & Nobel. Their meatgrinder doesn't deal well with things like
centering and such. You have to manually edit the CSS of the ebook file in
order to get objects actually centered. I've done this on a fourteen
ebooks so far.

as I am a proponent of wiki docs, I should point out that there are a
number of great ways as well to convert wiki docs to epub and epub3 :wink:
but, at what point are epubs of this type of value if we have effective
caching browsers and ubiquitous internet -- but universal transparency
is not going to be available any time soon as long as people go to horse
races :wink: