Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can it be converted to amazon kindle format #205

Open
byteshiva opened this issue Aug 21, 2019 · 15 comments
Open

Can it be converted to amazon kindle format #205

byteshiva opened this issue Aug 21, 2019 · 15 comments

Comments

@byteshiva
Copy link

byteshiva commented Aug 21, 2019

Can it be converted to amazon kindle format, it would be nice to have it in kindle format.

@toxicafunk
Copy link

toxicafunk commented Aug 21, 2019 via email

@byteshiva
Copy link
Author

Kindle have a proprietary format

" AZW that is based on Mobipocket; in fourth generation and later Kindles, AZW3, also called KF8; and in seventh generation and later Kindles, KFX.[1] Kindles do not support the EPUB file format used by many other e-book readers." - Kindle File Format

@XVilka
Copy link

XVilka commented Aug 22, 2019

Calibre can do this: https://www.epubor.com/how-to-convert-epub-to-azw.html

@byteshiva
Copy link
Author

Calibre can do this: https://www.epubor.com/how-to-convert-epub-to-azw.html

I tried to convert pdf to Amazon AZW3 format(using https://pdf2kindle.com/) but the formatting and alignment are getting messed up. Here is the link to download AZW3 format. https://gofile.io/?c=eKueDK

I'll try "epub to azw" and keep you updated.

@TV4Fun
Copy link

TV4Fun commented Sep 6, 2019

I have had some success doing this with other TeX documents using tex4ebook. It uses tex4ht to convert the document to HTML, and then uses Amazon's own KindleGen tool to convert it to Kindle format.

@byteshiva
Copy link
Author

byteshiva commented Sep 6, 2019

I have had some success doing this with other TeX documents using tex4ebook. It uses tex4ht to convert the document to HTML, and then uses Amazon's own KindleGen tool to convert it to Kindle format.

$/home/tmp/milewski-ctfp-pdf/src]$ tex4ebook -c hej -f epub3 index.tex

Hi @TV4Fun

I'm trying to convert tex to epub3 but throws the below error.

(./index.tex
! Undefined control sequence.
l.1 \setindexprenote
                    {\normalsize

@byteshiva
Copy link
Author

byteshiva commented Sep 6, 2019

Doesn't Kindle have a proprietary format? I think epub is the best we can do.

On Wed, 21 Aug 2019, 12:50 Siva, @.***> wrote: Can it be converted to amazon kindle format, it would give to have it in kindle format. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#205?email_source=notifications&email_token=AABID2JIDAMHVQWNNLE2PALQFUMY7A5CNFSM4IOFFUH2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HGPJLOA>, or mute the thread https://github.com/notifications/unsubscribe-auth/AABID2MDXJAGRPTHNJPYYU3QFUMY7ANCNFSM4IOFFUHQ .

Hi @toxicafunk
How do you convert to epub? Are current scripts allows conversion to epub without messing up the structural alignments?

@TV4Fun
Copy link

TV4Fun commented Sep 6, 2019

@byteshiva, I don't think index.tex is meant to be compiled directly. It's referenced by other files. I was starting from ctfp-reader.tex. I was still running into odd errors that I couldn't immediately explain there, but at least I had some hope. I haven't been able to successfully convert this book using tex4ebook yet, but you could give it a try.

@byteshiva
Copy link
Author

@byteshiva, I don't think index.tex is meant to be compiled directly. It's referenced by other files. I was starting from ctfp-reader.tex. I was still running into odd errors that I couldn't immediately explain there, but at least I had some hope. I haven't been able to successfully convert this book using tex4ebook yet, but you could give it a try.

@TV4Fun ,
i tried executing ctfp-reader.tex but it threw the following error!!

$/home/tmp/milewski-ctfp-pdf/src] $ tex4ebook -c hej -f epub3 ctfp-reader.tex

Error Details

! Fatal Package fontspec Error: The fontspec package requires either XeTeX or
(fontspec)                      LuaTeX.
(fontspec)                      
(fontspec)                      You must change your typesetting engine to,
(fontspec)                      e.g., "xelatex" or "lualatex"instead of
(fontspec)                      "latex" or "pdflatex".

For immediate help type H <return>.
 ...                                              
                                                  
l.45 \msg_fatal:nn {fontspec} {cannot-use-pdftex}
                                                 
? H

This is a fatal error: LaTeX will abort.

? H
Sorry, I already gave what help I could...
Maybe you should try asking a human?
An error might have occurred before I noticed any problems.
``If all else fails, read the instructions.''

First level Error:
l.45 \msg_fatal:nn {fontspec} {cannot-use-pdftex}

Probable Fix:
fontspec-cannot-use-pdftex-on-overleaf

@TV4Fun
Copy link

TV4Fun commented Sep 7, 2019 via email

@byteshiva
Copy link
Author

byteshiva commented Sep 7, 2019

It's telling you exactly what you need to do. Just add the -l option to
tex4ebook

Thanks for pointing it out, I'll try that option.

! Fatal Package fontspec Error: The fontspec package requires either XeTeX or
(fontspec)                      LuaTeX.

Ref: https://github.com/michal-h21/tex4ebook

-l,--lua

: Use LuaLaTeX as TeX engine.

I see in MakeFile, it executes

latexmk -shell-escape -interaction=nonstopmode -halt-on-error -norc -pdflatex="xelatex %O %S" -pdf $<

are there any option for epub!!

Related to: #46

Result after adding -l option (: Use LuaLaTeX as TeX engine.)

added -l option and ran tex4ebook, it seems its looking for locale, Please be noted I'm running it on ubuntu 19.04 using nix-shell, Please guide me if i'm missing something here.

milewski-ctfp-pdf/src]$ tex4ebook -l -f epub3 ctfp-reader.tex

Output dir: 	
Compiler: 	dvilualatex
Latex options: 	 -jobname=ctfp-reader 
tex4ht.sty :	xhtml,
tex4ht	
build_file	ctfp-reader.mk4
Output format	epub3
ctfp-reader-epub3/OEBPS
ctfp-reader-epub3/mimetype
No conffile
Cannot open config file	ctfp-reader.mk4
dvilualatex ctfp-reader "xhtml,,charset=utf-8,epub3,html5,uni-html4" " -cmozhtf -utf8" "" " -jobname=ctfp-reader "
Output file: ctfp-reader.epub
Make4ht run
-------------------
setting param correct_exit
setting param correct_exit
setting param correct_exit
setting param ext
LaTeX call: dvilualatex  -jobname=ctfp-reader  '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,html]{tex4ht}\RequirePackage{tex4ebook}\Configure{ext}{xhtml}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode xhtml,,charset=utf-8,epub3,html5,uni-html4.a.b.c.\input "\detokenize{ctfp-reader.tex}"'
Unable to read environment locale: exit now.
Make4ht: Fatal error. Command htlatex returned exit code 1
(venv) 

@byteshiva
Copy link
Author

byteshiva commented Sep 7, 2019

I've converted to AZW3 from epub format as stated in #46

More information can be found in the below GIST link, also I have attached AZW3 format file in it. It seems to be rendering fine in Amazon Fire HD Tablet.

https://gist.github.com/byteshiva/d1ad7377ecf2e2a625fc58960e252b10

ps:-
The tex4ebook still threw errors, maybe i'm missing something here.

@TV4Fun
Copy link

TV4Fun commented Sep 8, 2019

@byteshiva, I doubt you are missing anything. tex4ebook and tex4ht are just very finicky and require a lot of messing with. I know that when I have had to convert documents in the past, I have sometimes run into bugs in tex4ht that cause a failure to compile with only very specific combinations of LaTeX sequences, so you could be running into something like that. I haven't spent enough time on this particular book to know what the issues are though.

@oddg
Copy link

oddg commented Sep 18, 2019

I just tried an epub -> mobi conversion on epubconverter.com using this nice project as input.
I read a few pages. So far so good.

@byteshiva
Copy link
Author

@oddg, I've used the same site for conversion from epub to azw3. Its Originally posted by @onlurking in #46 (comment)

I just tried an epub -> mobi conversion on epubconverter.com using this nice project as input.
I read a few pages. So far so good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants