04-26-2019, 01:29 PM | #1 |
Enthusiast
Posts: 48
Karma: 10
Join Date: Mar 2008
Device: HTC-p3000
|
Conversion Latex to ebook
I am trying to convert a novel I wrote (in Italian) from current PDF format to any format suitable for self-publishing on Amazon (I assume ebook, mobi and azw3 are ok).
I wrote novel in LaTeX and thus I have full (?) control on PDF generation. I tried to find a way to directly generate [x]html, but I failed because of fonts I'm using. ebook-viewer can show the generated PDF apparently without any problem. Using either Calibre or ebook-convert results in error at the very end of document: Spoiler:
Apparently no output is generated (in the /tmp directory I see several files, including a 'index.html' with the full content of my novel, but no font info). I am at a loss to understand what went wrong (apparently some iso-8859 char slipped in, but that's not in my source!) or even to map "position 799750" to a specific location in my text. If needed I can attach input PDF (You are welcome to proofread it ), but it is rather large (~4.5M) and I'm unsure about attachment limits. If relevant: I'm working on a fairly up-to-date Debian Sid box running on an amd_64 i7 with 32GRam. Any hint on how to bypass problem will be very welcome. Last edited by theducks; 04-26-2019 at 02:16 PM. Reason: Use SPOILER, not quote for logs |
04-26-2019, 03:14 PM | #2 |
Grand Sorcerer
Posts: 12,167
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
I've no experience with LaTex but have you tried PanDoc http://pandoc.org ? It claims to do LaTex to Epub
|
04-26-2019, 04:05 PM | #3 | |
Enthusiast
Posts: 48
Karma: 10
Join Date: Mar 2008
Device: HTC-p3000
|
pandoc does not work (for me)
Quote:
In the specific case it fails to understand direct speech quoting, so resulting .html is completely devoid of dialogues. Thanks anyways. |
|
04-26-2019, 05:51 PM | #4 |
null operator (he/him)
Posts: 20,569
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Moderator Notice This issue would be better asked in the Workshop forum, so I'm moving it there. Calibre is just one of several tools/processes to get from a LatTex generated a PDF to ebook formats. For personal use I would convert the LaTex output (.tex ?) to DOCX, then use Writer to edit/style the document, and then convert DOCX to flowable formats. The professional bookmakers, who inhabit the Workshop forum and who are familiar with LaTex will undoubtedly have alternative ideas. BR |
04-27-2019, 08:09 AM | #5 |
Evangelist
Posts: 482
Karma: 2267928
Join Date: Nov 2015
Device: none
|
But why use PDF as a source? The more reasonable way would be the straight latex->xhtml conversion, which some simple script could do.
|
04-27-2019, 08:45 AM | #6 |
Veteran Linux user
Posts: 144
Karma: 678910
Join Date: Mar 2017
Location: Barcelona/Spain
Device: Boyue Likebook Note & Mimas, Hisense A5, hopefully soon a PineNote
|
When writing in LaTeX with the explicit intention to later convert into epub, then this here might be helpful to consider for inclusion in the source files:
github.com/michal-h21/tex4ebook On Debian, it is included in the 'texlive-extra-utils' package. |
04-27-2019, 02:48 PM | #7 |
Wizard
Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
Also try asking the question from the other side; find TeX and LaTeX forums and ask them how you can convert to an ebook.
|
04-27-2019, 08:50 PM | #8 | ||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Depending on how complicated the code of your book is, some of these may work better than others:
As you mentioned, pandoc is okay for trivial LaTeX->HTML conversions, but more complicated text (especially macro-heavy) will break. There's lots of information on the TeX Stack Exchange. Here's some of the latest discussions: Use LaTeX to produce Epub LaTeX document to epub or mobi ebook formats (with mathematical formulas) There's also a few older discussions: Use LaTeX to produce Epub https://www.mobileread.com/forums/sh...51#post3800751 where these tools are mentioned:
Perhaps you'll have better luck with some of those other tools. Although note, some of these tools haven't been updated in quite a long while. Quote:
Is your source document UTF-8? What are you using to compile (pdfLaTeX, LuaLaTeX, XeLaTeX, [...])? Last edited by Tex2002ans; 04-27-2019 at 09:01 PM. |
||
06-06-2019, 04:33 PM | #9 |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
I also ran across this user on Reddit + Stack Exchange:
https://www.reddit.com/user/michal_h21 https://tex.stackexchange.com/users/2891/michal-h21 who is the maintainer of tex4ht + tex4ebook + make4ht. Looks like he posts lots of helpful info as well. |
06-06-2019, 10:47 PM | #11 | |
Wizard
Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
Quote:
|
|
06-07-2019, 03:03 PM | #12 |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Also, this one might be of interest.
At TUG 2018, Will Robertson gave a talk showing off how he uses LaTeXML to generate LaTeX->HTML: The Canvas Management System and LaTeXML He discusses why he settled on LaTeXML + shows many of the commands he uses. I've had this in my pile for months (been meaning to write a blog post summarizing all the talks). It's still the best. :P Last edited by Tex2002ans; 06-07-2019 at 03:06 PM. |
Tags |
pdf, pdftoazw3, unicode |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Conversion Input] LaTeX Formulas Input Conversion Plugin | sevyls | Plugins | 0 | 03-23-2015 05:52 AM |
.epub to LaTeX Conversion | _savage | ePub | 4 | 11-07-2013 04:06 PM |
Conversion of odt produced from latex | dawood | Conversion | 11 | 10-19-2013 01:38 AM |
LaTeX to HTML conversion | kongzifan | Conversion | 9 | 12-14-2011 04:41 PM |
ebook from LaTeX | rplantz | Workshop | 2 | 03-17-2011 03:29 PM |