bell notificationshomepageloginedit profileclubsdmBox

10.04% popularity   0 Reactions

I am thinking about writing and/publishing an ebook with the following in mind:

It will contain code (needs proper formatting)
I should be able to publish PDF and EPUB versions
I might need to have an HTML version of the book too

Since I am new to this stuff, I wonder if anyone could give me some points on which software (free/paid) I should use for writing/formatting the ebook.

I have used LaTeX about 8 years ago, and I really liked it, but I am not sure if I can export to the formats I want with LaTeX.


Free books android app tbrJar TBR JAR Read Free books online gutenberg


Load Full (4)

Login to follow story

More posts by @Twilah

4 Comments

Sorted by latest first Latest Oldest Best

10% popularity   0 Reactions

Some time ago I created a GitHub repository of eBook Writing Resources.
Specifically, this is the current list (as of the time of writing this answer - visit the link above for an up-to-date list as well as to get visual indications on whether they cost money, work offline or on the cloud etc.) of eBook writing software.
Specifically, GitBook and Scrivener do let you write code properly as well as export to PDF and EPUB.

Writing Tools
GitBook
Penflip
Scrivener
yWriter
BookWriter
WriteItNow


Free books android app tbrJar TBR JAR Read Free books online gutenberg


Load Full (0)

 

@Karen

10% popularity   0 Reactions

I say this as something who doesn't normally use the product, but Adobe InDesign allows for an easy export into PDF and epub. I don't know about formatting code blocks though. Adobe ID has a monthly subscription, so even though it's a premium product, in many cases you're only using it for one or two months. You might be able to buy some low cost Adobe ID templates, so you don't have to set everything up.

I use a Docbook solution (with Docbook XSLT, using the Oxygen XML editor software). This produces output very easily in html, epub and pdf, although the learning curve is high. (Also, Oxygen XML license is pricey for commercial use). Docbook can do code blocks very easily; on the other hand, when producing pdfs, you have limited formatting options. Oxygen uses the open source Apache FOP (which lets you output from Docbook XML to PDF), but there are commercial options (in the 200-500 range) which let you produce nice looking PDF files. (Check out renderx and antenna house). Docbook can do output for webhelp, javahelp, htmlhelp as well. Docbook works well, but the toolchain is hard to set up.

A "dumb but effective" solution might be to code your output in HTML, paste it into MS word (to produce a PDF), and then to use SIGIL to move the html files into epub. Or use the MS word file as the source for doing output using Calibre.

There are pros and cons for each solution. I haven't used pandoc, but it sounds like a good solution if you have lots of legacy latex content.


Free books android app tbrJar TBR JAR Read Free books online gutenberg


Load Full (0)

10% popularity   0 Reactions

If you don't want the hassle of setting up the full LaTeX stack, as needed with the, in this respect, unfriendly pandoc, you can have a look at reStructured text and Sphinx. For these tools exists to generate ePub and PDF, the latter without having to go through LaTeX.


Free books android app tbrJar TBR JAR Read Free books online gutenberg


Load Full (0)

10% popularity   0 Reactions

Pandoc is your friend here.

Pandoc can take your input file (LaTeX, markdown, other) and transform it to PDF, EPUB, HTML (and many more).

Pandoc is cross-platform and free under the GPL, although donations are appreciated.

With regards to formatting your code, both LaTeX and markdown have components that will help. LaTeX has many more layout options.

I've used both LaTeX and markdown to produce ebook (ePub) files. An example of using pandoc with LaTeX is shown in another ebooks.stackexchange.com question I posted.

It's great to have a range of options.


Free books android app tbrJar TBR JAR Read Free books online gutenberg


Load Full (0)

 

Back to top