This project brings SciGen to JavaScript, both for Node and for the browser.
Usage
Node
const files = console
Command Line
$ git clone git@github.com:davidpomerenke/scigen.js && cd scigen$ node lib/cli.js --helpUsage: node cli.js --save [<directory>] [--authors "<author1>, <author2>, ..."] [--bibinlatex] [--silent] directory all files will be saved here authors list of the authors in the paper bibinlatex avoids dependency on BibTex
Browser
$ git clone git@github.com:davidpomerenke/scigen.js && cd scigen$ npx webpack$ python -m http.server -d docs$ xdg-open http://localhost:8000
See also the TexLive.js Wiki.
Rule Compilation
The almost original rule files from the original SciGen project are found in rules/rules-original
. They can be compiled to JSON by running perl rules/compile-rules.pl
. The JSON files are required for running the module. They are already included in the module and only need to be re-compiled for applying changes in the original .in
rule files.
Limitations
- Bibtex is not available for the browser (cf. here). An almost perfect workaround is implemented for the parameter
--bibinlatex
(or setting the second/third function parameter totrue
in Node, see the above examples). - Rendering diagrams and figures requires Ghostscript in the original SciGen project. Ghostscript is not available for the browser. A workaround would probably involve rewriting the original EPS rules in some format which is supported by TexLive.js (maybe SVG or TIKZ). As this module is aimed at the browser, the diagram and figure code production is not yet implemented in the JavaScript code. For locally producing TEX and PDF files with figures and diagrams, use the original SciGen project with this unmerged fix.
- Works in Firefox Desktop & Mobile and in Chrome Mobile, but not in Chrome/Chromium Desktop. Cf. this issue with TexLive.js.
Motivation
The server-side code at the original SciGen website appears to be broken. The aim of this project is therefore to provide a more server-independent implementation.