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

more packages? #109

Open
mr-hyperboloid opened this issue Apr 11, 2020 · 3 comments
Open

more packages? #109

mr-hyperboloid opened this issue Apr 11, 2020 · 3 comments
Labels

Comments

@mr-hyperboloid
Copy link

Hey, this project is unique!
I am using the compiled docs directory as a basis for my project because it's easier. Can you please tell me how can I add more (latex) packages without recompiling? Is this possible at all?

Thank you for the answers!

@michael-brade
Copy link
Owner

Hi! Yeah, sorry about that... it is work in progress. I am not sure yet how you could be doing it with the docs directory, but if you are using the CLI, all you need is a subfolder called packages with <package>.js files in it. Then the \usepackage{<package>} macro should pick it up. I haven't tested it yet since we switched to rollup, and rollup added a nice feature for dynamic includes lately. So I will improve it soon.

@mr-hyperboloid
Copy link
Author

Thank you very much for your answer! I have looked into the "packages" dir, but it seems that the files there are of some unusual extension ".ls" as well as their format inside only resembles LaTeX. I am not really experienced into the neither the realm of js nor tex, but I wanted to use the package amsmath, which can be downloaded from CTAN in a zip file containing ".ins", ".dtx", ".tex" and other file formats which seem to be written in ordinary TeX. Is there some kind of translator between the formats or can the clean TeX be pasted and used like a native LaTeX.js package? How do you port a LaTeX package (a directory containing ins/dtx/tex files) to LaTeX.js (ls files)?

@michael-brade
Copy link
Owner

Actually, .ls is LiveScript, which transpiles to JavaScript. So you could also use plain .js files, or any other language that transpiles to JavaScript. However, if you don't know JavaScript, then it's going to be a big challenge ;-) Those files in packages and classes have to be JavaScript because they have to use the API of LaTeX.js. And no, I don't have a translator from TeX to LaTeX.js/JavaScript, every single LaTeX macro has to be rewritten in JavaScript individually--that's the work we have to do in creating this project :-)

Now, the good news is: a lot of amsmath is probably already working because when switching to math mode in LaTeX.js, you are using KaTeX, and that is emulating amsmath. The bad news is that environments are not supported yet (see KaTeX/KaTeX#2042). As soon as they are, I can support them in LaTeX.js as well.

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

No branches or pull requests

2 participants