{"id":20744282,"url":"https://github.com/mathjax/mathjax-demos-node","last_synced_at":"2025-05-07T01:50:18.665Z","repository":{"id":33812254,"uuid":"136760101","full_name":"mathjax/MathJax-demos-node","owner":"mathjax","description":"A repository with examples using mathjax-v3 in NodeJS","archived":false,"fork":false,"pushed_at":"2024-06-26T11:53:36.000Z","size":243,"stargazers_count":106,"open_issues_count":13,"forks_count":44,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-31T05:11:13.873Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mathjax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-09T21:41:23.000Z","updated_at":"2025-03-19T07:49:55.000Z","dependencies_parsed_at":"2024-12-27T02:06:09.694Z","dependency_job_id":"2d7f0f24-578b-4942-b3b1-af5c5c37e253","html_url":"https://github.com/mathjax/MathJax-demos-node","commit_stats":{"total_commits":91,"total_committers":4,"mean_commits":22.75,"dds":"0.15384615384615385","last_synced_commit":"d9ba8c61e54683efc04d0e11d5812bc974da65db"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathjax%2FMathJax-demos-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathjax%2FMathJax-demos-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathjax%2FMathJax-demos-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathjax%2FMathJax-demos-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathjax","download_url":"https://codeload.github.com/mathjax/MathJax-demos-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252798781,"owners_count":21805880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T07:14:54.307Z","updated_at":"2025-05-07T01:50:18.629Z","avatar_url":"https://github.com/mathjax.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [MathJax-demos-node](https://github.com/mathjax/MathJax-demos-node)\n\u003cimg class=\"shield\" alt=\"GitHub release version\" src=\"https://img.shields.io/github/v/release/mathjax/MathJax-src.svg?sort=semver\"\u003e\n\nA repository with examples using [MathJax version 3](https://github.com/mathjax/MathJax-src) in node applications.\n\nSee the [MathJax Web Demos](https://github.com/mathjax/MathJax-demos-web) for examples of how to use MathJax in web pages.  See the [MathJax documentation](https://docs.mathjax.org/) for complete details of how to use MathJax in web browsers and node.\n\n## The Example files\n\nThis repository contains examples of how to use MathJax v3 in your node projects.  These are divided into three main categories:  ones based on the MathJax v3 components and its loading system, ones based on the MathJax v3 components that you preload by hand (for easier synchronous use), and ones that use the base MathJax files directly without using the MathJax components.\n\nAll three groups include examples of conversion from the various input formats to the various output formats, both for individual expressions, and for complete pages containing math.  Each category includes the following executables:\n\n* `tex2chtml`\n* `tex2svg`\n* `tex2mml`\n* `mml2chtml`\n* `mml2svg`\n* `am2chtml`\n* `am2mml`\n* `tex2chtml-page`\n* `tex2svg-page`\n* `tex2mml-page`\n* `mml2chtml-page`\n* `mml2svg-page`\n* `am2chtml-page`\n\nThe first seven convert an expression from either a TeX, MathML, or AsciiMath string (given as its first argument) to a CommonHTML, SVG, or MathML string.  The ones ending in `-page` take an HTML file and convert the math in it from the given input format to the specified output format and output the modified page.\n\nUse the `--help` option to get a list of all the possible options for each command.\n\nThe three categories of commands are stored in the directories called [`component`](component), [`simple`](simple), [`preload`](preload), and [`direct`](direct).  Both the `component` and `simple` directories are examples of the component-based approach, with the `component` directory containing versions that mirror the approach needed when MathJax is used in web pages, and the `simple` directory containing examples that take advantage of some simplifications available in node.  Each of those directories contain additional information about the example files they contain.\n\nThere is also a directory [`speech`](speech) that give examples of converters that add speech strings to their results, which illustrate more sophisticated operations in MathJax.  This is described in more detail in that directory.\n\nThe [`custom-tex-extension`](custom-tex-extension) directory contains an example of how to create your own custom TeX extension and load it as a component.  Again, see the directory for more details.\n\nThe [`puppeteer`](puppeteer) directory contains an example of how to use the [Puppeteer](https://developers.google.com/web/tools/puppeteer) library to use a headless Chrome instance to do server-side conversion of mathematics using MathJax.  This is useful in situations where you are using characters that are not included in the main MathJax fonts, as Chrome will be able to measure the widths of these characters so that they can be displayed more reliably.\n\n## Installation\n\nIn order to try out these examples, clone this repository, enter the directory, and install the dependencies:\n\n``` bash\ngit clone https://github.com/mathjax/MathJax-demos-node.git MathJax-demos-node\ncd MathJax-demos-node\nnpm install\n```\n\nThe examples should be executable files that you can run.  On non-unix systems, you may need to call\n\n``` bash\nnode -r esm \u003cexample-name\u003e\n```\n\nwhere `\u003cexample-name\u003e` is the name of the example file.  Some examples take an argument (like a TeX string) that follows the `\u003cexample-name\u003e` above.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathjax%2Fmathjax-demos-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathjax%2Fmathjax-demos-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathjax%2Fmathjax-demos-node/lists"}