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

Enable Export to PDF / EPUB / MOBI #7

Open
public-daniel opened this issue Jun 26, 2021 · 11 comments
Open

Enable Export to PDF / EPUB / MOBI #7

public-daniel opened this issue Jun 26, 2021 · 11 comments

Comments

@public-daniel
Copy link

public-daniel commented Jun 26, 2021

When attempting to export to PDF, I got an error. It looks like MathJAX-Node dependency is using a deprecated API. This will probably get resolved upstream, but just in case anyone else wants to export, there is a workaround:

Modify node_modules/mathjax-node/lib/mj-single.js on line 540 from

result.speakText = speech.processExpression(result.mml);

to

result.speakText = speech.toSpeech(result.mml);

Source for workaround: kgryte/tex-equation-to-svg#2 (comment)

Command for exporting:

npx honkit pdf ./ ./ml-interviews-book.pdf or npx honkit epub ./ ./ml-interview-book.epub

@mikhaildubov
Copy link

Hi @public-daniel, would you mind sharing the PDF you got? Doesn't work for me even with the fix above. Thanks

@BellmannRichard
Copy link

@public-daniel what about sharing the PDF? Thanks!

@animesh-007
Copy link

animesh-007 commented Jul 4, 2021

Hi,

PFA for the pdf version of the book. I hope the authors of the book have no issue with this.😓
Thank you @Aryaman1706 for helping me in converting to the pdf version.

Regards,
Animesh
ml-interviews-book.pdf

@chiphuyen
Copy link
Owner

Hi @animesh-007, this is amazing. I just sent you an email with a follow-up question about PDF rendering. Thank you so much!

Hi,

PFA for the pdf version of the book. I hope the authors of the book have no issue with this.😓
Thank you @Aryaman1706 for helping me in converting to the pdf version.

Regards,
Animesh
ml-interviews-book.pdf

@animesh-007
Copy link

ml-interviews-book.pdf

Hi @chiphuyen. I tried to answer your follow-up question in the email. Hope the problem is resolved now. 😇

@chiphuyen
Copy link
Owner

Thanks Animesh! Yep we're working on it, just some few formatting problems left!

ml-interviews-book.pdf

Hi @chiphuyen. I tried to answer your follow-up question in the email. Hope the problem is resolved now. 😇

@karelin
Copy link

karelin commented Jul 22, 2022

hello all,
Is it possible to provide some clues how the book in PDF or EPUB can be created?
(libraries, tools, ...)

@IanQS
Copy link

IanQS commented Aug 2, 2022

@animesh-007

Is the url you posted up-to-date? If not could you post instructions as to how you generated it? I'd really appreciate it

@jordandraper
Copy link
Contributor

jordandraper commented Jul 18, 2023

@animesh-007

Is the url you posted up-to-date? If not could you post instructions as to how you generated it? I'd really appreciate it

Here is a ml-interviews-book.pdf I just generated from the most recent commit. The instructions provided by @public-daniel still work perfectly #7 (comment).

@dsvolkov
Copy link

dsvolkov commented Jul 28, 2023

And here is a recent ml-interview-book.epub

@goyalyashpal
Copy link

$ npm install
npm warn deprecated har-validator@5.1.5: this library is no longer supported
npm warn deprecated abab@1.0.4: Use your platform's native atob() and btoa() methods instead
npm warn deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be p
roblematic.  See https://v8.dev/blog/math-random for details.
npm warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

$ npx honkit pdf ./ ./ml-interviews-book.pdf
Need to install the following packages:
honkit@5.1.4
Ok to proceed? (y) y

npm warn deprecated try-resolve@1.0.1: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
(node:9508) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
ReferenceError: Failed to load HonKit's plugin module: "mathjax" is not found.

cwd: ...\ml-interviews-book-master
baseDir:


    at PluginResolver.resolvePluginPackageName (%LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\honkit\lib\plugins\PluginResolver.js:78:19)
    at %LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\honkit\lib\plugins\loadForBook.js:26:34
    at %LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\immutable\dist\immutable.js:3016:46
    at List.__iterate (%LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\immutable\dist\immutable.js:2206:13)
    at mappedSequence.__iterateUncached (%LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\immutable\dist\immutable.js:3015:23)
    at seqIterate (%LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\immutable\dist\immutable.js:604:16)
    at IndexedSeq.__iterate (%LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\immutable\dist\immutable.js:320:14)
    at IndexedIterable.toArray (%LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\immutable\dist\immutable.js:4258:23)
    at List [as constructor] (%LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\immutable\dist\immutable.js:2065:62)
    at reify (%LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\immutable\dist\immutable.js:3570:37)

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

No branches or pull requests

10 participants