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

Simple Example with Typescript #2310

Closed
pstaabp opened this issue Jan 28, 2020 · 3 comments
Closed

Simple Example with Typescript #2310

pstaabp opened this issue Jan 28, 2020 · 3 comments

Comments

@pstaabp
Copy link

pstaabp commented Jan 28, 2020

I'm trying to get mathjax embedded in a Vue component using typescript and am trying to get something simple working. I found a nice example (without vue) using the beta version of 3.0 at https://stackblitz.com/edit/mathjax-ts.

I installed MathJax via yarn and it seems that the directory structure is different from the beta version, however if I use

import { MathJax } from 'mathjax-full/ts/mathjax';  // this is the typescript file.

and I seemed to find versions of TeX, CHTML, etc. in the mathjax-full package that replace those in the example in https://stackblitz.com/edit/mathjax-ts.

However when trying to run this, there is a large list of missing packages. For example, in the mathjax-full/ts/mathjax.ts file, the top line is:

import {HandlerList} from './core/HandlerList.js';

which does not exist, however ./core/HandlerList.ts does?

I looked through the documentation, but can't seem to find anything about a typescript example.

@dpvc
Copy link
Member

dpvc commented Jan 29, 2020 via email

@dpvc dpvc added the Question label Jan 29, 2020
@pstaabp
Copy link
Author

pstaabp commented Jan 30, 2020

Davide,

If I understand things right, the mathjax-full directory is that of the github.com/mathjax/MathJax-src repository. There's no js directory at the top that.

In fact, there doesn't seem to be a mathjax.js file at all in there.

@dpvc
Copy link
Member

dpvc commented Feb 5, 2020

If I understand things right, the mathjax-full directory is that of the github.com/mathjax/MathJax-src repository. There's no js directory at the top that.

There is a build process that is performed before the mathjax-full npm package is published. That creates the js (and es5) directories that are part of the mathjax-full npm package.

If you checked out the MathJax-src repository by hand, then you can use

npm install
npm run --silent compile
npm run --silent make-components

to build the js and es5 directories (respectively).

(Sorry, I missed your response, and just saw it now as I was cleaning up some issues for the 3.0.1 release.)

@dpvc dpvc added the v3 label May 12, 2020
@dpvc dpvc closed this as completed May 12, 2020
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

2 participants