5

I wrote a lengthy novel using a program I wrote. This produces a suitable LaTeX source I can use to generate a nice-looking PDF.

Markup, beside customary division in Part/Chapter/Scene, is used to put emphasis, to handle direct-speech (which I use a lot, sometimes even nested) and to output certain phrases in "strange fonts".

So far, so good.

Now my problem is I need to convert all this into a format suitable for Kindle as I want to self-publish with Amazon.

I have seen standard tools (i.e.: Kindle Create), but that seems to lack all the kinds of formatting I'm using and its input (if I want to enable reflow) is restricted to Microsoft .docx format, which I don't know how to produce.

OTOH I have control over my program so, given a suitable markup (e.g.: Markdown) I can generate what is needed.

Question is: which "suitable markup" is available for novel rendering?

Ideally it should:

  • handle standard headings (easy; almost every markup does).
  • handle TOC and some limited cross-referencing (this is also standard).
  • handle font change "on the fly" (font face, not just bold/italic).
  • handle (possibly nested) direct speech, possibly keeping track of speaker.
  • output a professional-looking ebook for Kindle (mobi, epub or azw3/4).
  • if possible generate, from the same source, also PDF (not mandatory).

Does such a beast exist?


UPDATE:

judging from comments and the lonely Answer I did not manage to make the message through (or I'm saying something completely foolish, which could well be).

What I really like in LaTeX is it's possible to use things like \tqt{Yesterday my boss said: \tqt{jump!} and I had to jump.} to define a (nested) direct speech fragment and it will be converted according Your (global) choices.

In my book I use:

«Yesterday my boss said: “jump!” and I had to jump.»

but that could be easily (and globally!) converted to a different style, e.g.:

— Yesterday my boss said: «jump!» and I had to jump.

This (again AFAIK) is possible neither in plain HTML nor with programs normally used to edit books (MSWord, kindle-create, Calibre or Sigil).

Other uses of semantic tagging could include:

  • differentiating (visually or otherwise) speech from different entities (e.g.: speech from a vampire could be in a different font)
  • long citations.
  • nested tales (e.g.: flashbacks).
  • separators (horizontal line vs. stars vs. graphic image).
  • add "invisible" metadata (e.g.: time and duration of a scene, to be used to prepare a timeline).
  • etc.

"Normal" markup languages (e.g.: Markdown) are not really suited for this even if they have a lots of features, mostly useless for novel writing (cross-reference, lists, tables, math, ...).

I am thinking about defining (and implementing) something myself.

Let me know if there is some interest.

Any comment welcome.

28
  • 2
    @J.G.: I have been on that road and I can assure You it gets nowhere (at least for me): NONE of the zillion "solutions" proposed seems able to deal with Font changing. ALL solutions seem to concern with math rendering, which I don't need, and not with novel writing. That is exactly the reason why I'm exploring the possibility to ditch LaTeX in favor of some other markup, if possible. Alternative is manually import everything into MSWord and reformat from scratch (forgetting about semantic tagging). Question is: is there a markup language designed for novel writing?
    – ZioByte
    Apr 27, 2019 at 6:32
  • 1
    I'm not sure what to advise, then. I write my novels in LyX, which has its own .lyx file format, from which you have to export to another filetype for people without LyX to read. It can also import LaTeX, after which you can export either to .pdf (which you already have) or .docx, then convert that to .epub with another program. But hopefully there's a better solution.
    – J.G.
    Apr 27, 2019 at 6:38
  • 2
    You might have better luck looking into producing OpenDocument (which Word can open, or you could use another piece of software that understands OpenDocument and can create .docx files to do the conversion), and then set up a way to convert OpenDocument to Word. That said, I'm not sure if OpenDocument qualifies as "markup", though it is XML (as is .docx).
    – user
    Apr 27, 2019 at 19:33
  • 2
    Is the document export your only concern? There's a number of options to convert from LaTeX to Word - are they all so awful? Also, suppose you can find a tool that handles font change smartly and smoothly - but how would that help when a reader changes font on his/her Kindle?
    – Alexander
    Apr 29, 2019 at 16:44
  • 1
    @RobbieGoodwin: if you are aware of a "editing/DTP/markup/WP app" able to correctly render (both in editor and in print) several kinds of direct speech (normal, thinking, ghost, beast, etc.) and to highlight on screen occurrences of character names I would be very interested in a pointer. TiA
    – ZioByte
    Jul 31, 2020 at 6:56

2 Answers 2

2

I have not been able to find any suitable Markup, so I started coding it myself.

A very preliminary version is available on GitLab.

Any feedback would be VERY welcome.

3
  • Wow, nice! Is it intended that the "\@<something>" in the Readme links to seemingly random userprofiles? Maybe you need to escape those for the Readme.
    – Secespitus
    Jun 2, 2019 at 21:57
  • Thanks @Secespitus, of course user linking is not intended, but I was unable to find the right spell to disable this specific "magic". I updated README.md with more info and escaped "@", but user-pointing persists :(
    – ZioByte
    Jun 3, 2019 at 10:26
  • Awesome! What a great idea @ZioByte . I am not too keen on actual coding, but from what I can tell it looks like the start for an awesome project. In the next days I will tell you if some useful feedback comes to mind Jun 4, 2019 at 19:38
1
+50

My bestie, when converting Ebooks, is Calibre.

I use it mainly to load .epub files on my Kobo (usually converting from .pdf or .doc).

You have so many options to control formatting. You can also export to .mobi and view it on your Kindle if you own one (or also just check the given preview).

Calibre also has an integrated reader for Ebooks.

Settings available

Hope this can helps out. Here you can find the free program:

https://calibre-ebook.com/download

3
  • 1
    Thanks @CashewsFuel, I am very much aware of both Calibre and Sigil (which I'm currently using to hand-convert), but that's not what I'm looking for. I would like to have some kind of "semantic" tagging which (AFAIK) is not available. Typical example would be direct-speech, where choosing different styles is not feasible (not to speak about nesting and/or differentiate based on speaker). I will update Question to reflect this. Thanks.
    – ZioByte
    May 8, 2019 at 18:18
  • @ZioByte now I definitely get the whole picture. That's a beast for sure. I hope you will find it! Post it if you do, I am pretty interested as well May 8, 2019 at 19:20
  • I started development (see my own Answer). Your feedback would be appreciated.
    – ZioByte
    Jun 2, 2019 at 21:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.