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

HTML version? #116

Open
AvyChanna opened this issue Feb 22, 2021 · 11 comments
Open

HTML version? #116

AvyChanna opened this issue Feb 22, 2021 · 11 comments
Labels
enhancement New feature or request formatting Format of the outputted PDF file lots of work

Comments

@AvyChanna
Copy link

First of all, thank you for this amazing book(?). I wish I had known about napkin before my calculus classes.

I was wondering if there was a possibility for an HTML version for the same.
This would help in 2 ways -

  • Permalink-ing to chapters/sections/theorems/... via links.
  • Directly hosting the html copy on github.io for speedy reference.(like a gitbook/readthedocs)

This could've been as easy as htlatex Napkin.tex but I was not able to build it successfully.
The Travis CI uses some specific versions for everything (Ubuntu bionic, texlive ppa) and I was not able to build the same on my config.

(I expect everything but the diagrams to work well in HTML. Will try to reproduce the build environment on a Virtual Machine tomorrow, hope it succeeds.)

@vEnhance
Copy link
Owner

This is a nice idea. If you manage to get it to work, I would definitely be happy to take the pull request. I may also look into it myself, but it might not be any time soon.

@mikepierce
Copy link

I too am interested in this. I quite like the idea of moving mathematical writing online into webpages instead of in PDFs

@AvyChanna
Copy link
Author

Finally. I was able to have some nice HTML. I've put up all the output and steps/limitations in a README.

https://github.com/AvyChanna/napkin_html_out

*You will need to clone the repo to view it properly.

@AvyChanna AvyChanna reopened this Feb 26, 2021
@vEnhance
Copy link
Owner

Sweet, glad you got it mostly working!

I'm hoping to eliminate diagrams.sty completely over time (but have been putting that off for nine months now), mentioned in #77. Once that is done, the integration here might become a little smoother.

I'm curious whether we think this can be made to work with the CI, to generate automatically?

@AvyChanna
Copy link
Author

Possibly, but I'd advice against it.

Firstly, texlive version in current CI build is a whole major release behind(Texlive is "frozen" once a year).
You can get around this by building from source. You'll also need the most recent release of ghistscript to get that latest version of asympyote to run. GS had some internal fixes which change the way PS extensions are used(like transparency).

Secondly, build job is too lengthy for CI. Mine took forever. And Travis CI is introducing a new price model

@i-ky
Copy link

i-ky commented Feb 27, 2021

Travis CI is still free for open source projects. They had to change their rules (blame cryptocurrency miners) and now you have to apply for your build time instead of getting unlimited access straight away. Quoting the link provided above:

We will be offering an allotment of OSS minutes that will be reviewed and allocated on a case by case basis. Should you want to apply for these credits please open a request with Travis CI support stating that you’d like to be considered for the OSS allotment.

You will have to apply anyway since credits they give you for free trial will expire sooner or later.

@vEnhance
Copy link
Owner

vEnhance commented Mar 8, 2021

Possibly, but I'd advice against it.

Thanks for the suggestion. In that case, my thought is that, once #77 is resolved (which admittedly could be a while), then I can create a static version on my website, using the commands you suggest, that is periodically updated every so often. Won't be as fresh as the main PDF but I haven't had time for the last few years to do more than trivial edits anyways.

@AvyChanna
Copy link
Author

Sorry. I was(and will be) busy with academics and had to put this aside for the moment.

There are some corrections required for HTML output. Current maths output is bad and needs to be replaced with MathML/SVG/Katex. And, I'll have to repair/replace fixed units of length. PDF is expected to look the same on all devices, but HTML is more "fluid" in nature.

I won't be able to work on it until April. If someone else is interested, they can work on it in the meantime.

maparent added a commit to maparent/napkin that referenced this issue Jan 2, 2022
@maparent
Copy link

maparent commented Jan 2, 2022

Did a bit of work on this in https://github.com/maparent/napkin/tree/htlatex . I can now apply htlatex Napkin.tex mathml,svg to most of Napkin except two chapters (quantum/circuits, quantum/shor). Images rendering is also still problematic, but it's a step.

@maparent
Copy link

maparent commented Jan 2, 2022

More info: I have removed the settings.outformat on asymptote on my branch, so it is easier to create the svg version of the asymptote figures. However, this breaks the mklatex process, so it is (obviously) provisional. The procedure right now is to run mklatex once to generate the asy/*.asy files, then use asy directly to generate all .svg and .pdf from those (doing it with a shell loop for now), then run latexmk to completion, and finally htlatex (and tex4ebook) can complete. I have disastrous results with dvisvgm on OSX, so most tikz images still do not render well.

@maparent
Copy link

maparent commented Jan 2, 2022

thought of externalizing the Tikz images, but ran into this issue. The link gives a lot of workarounds, none exactly lightweight. Curious if this is worth pursuing.

@vEnhance vEnhance added enhancement New feature or request lots of work formatting Format of the outputted PDF file labels Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request formatting Format of the outputted PDF file lots of work
Projects
None yet
Development

No branches or pull requests

5 participants