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

make a Scope here? #2

Closed
shashi opened this issue Apr 1, 2019 · 8 comments
Closed

make a Scope here? #2

shashi opened this issue Apr 1, 2019 · 8 comments

Comments

@shashi
Copy link

shashi commented Apr 1, 2019

Is there a reason this package does not provide a widget to show and update a LaTeX string?

I'd love to use it for markdown in CSSUtil.

@piever
Copy link
Owner

piever commented Apr 1, 2019

I originally planned this just as a way to unify the download of KaTeX javascript, css, fonts and autorender extension (needed both for InteractBase and for Remark), but I agree it would make sense to move the LaTeX widgets here. I've opened the PR to "revamp" the LaTeX widgets at InteractBase JuliaGizmos/InteractBase.jl#132 but I'm a bit stuck on asset loading issues. Happy to move those function here as soon as I understand how to load fonts and the autorender extension with AssetLoader (I may need some help there!).

@shashi
Copy link
Author

shashi commented Apr 1, 2019

Have a look at https://github.com/JuliaGizmos/CSSUtil.jl/blob/master/src/markdown.jl#L39 and see if it helps!

@piever
Copy link
Owner

piever commented Apr 1, 2019

The issue is that the CSSUtil code uses the online version of KaTeX whereas I would like to use a local copy. In the online version, it can find the font files easily are they are hosted in the same place as the katex.js file. However, with local files AssetServer "screws things up" by adding its prefixes and I get:

:8736/assetserver/fonts/KaTeX_Main-Regular.woff2:1 GET http://127.0.0.1:8736/assetserver/fonts/KaTeX_Main-Regular.woff2 net::ERR_ABORTED 500 (Internal Server Error)

@shashi
Copy link
Author

shashi commented Apr 4, 2019

Well you can register a directory with assetserver, it'll give you a url where all files in that directory will be served. KaTeX will load fonts from the same directory.

@shashi
Copy link
Author

shashi commented Apr 4, 2019

The error message makes this clear -- the katex.js is served under assetserver/ directory which is why it looks for assetserver/fonts/....

@piever
Copy link
Owner

piever commented Apr 4, 2019

Ah! I didn't know you could register a directory! I tried registering the fonts individually but it complained that the .ttf asset format was not supported....

@piever
Copy link
Owner

piever commented Apr 4, 2019

Opened #3, I called the function latex (not sure about the name) and it returns a scope: fonts should be loaded correctly, let me know if you have feedback before I merge.

@piever
Copy link
Owner

piever commented Apr 4, 2019

I was thinking, InteractBase latex could simply call this one (I like the idea that people just do using Interact and get all the functionality).

@piever piever closed this as completed Apr 5, 2019
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

2 participants