Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

scigen

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scigen

Create scientific papers on the fly: SciGen brought to the browser and to Node.

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-40%
Maintainers
1
Weekly downloads
 
Created
Source

# SciGen.js

NPM version Node CI Gitter

This project brings SciGen to JavaScript, both for Node and for the browser.

Try it here!

Usage

Node

import { scigen, scigenSave } from 'scigen'

const files = scigen(
  /* authors = */ ['Jeremy Stribling', 'Max Krohn', 'Dan Aguayo'], 
  /* avoid bibtex dependency = */ false)
console.log(files['paper.tex'])

scigenSave(
  /* directory = */ 'mydir', 
  /* authors = */ undefined, 
  /* avoid bibtex dependency = */ true)

CLI

$ git clone git@github.com:davidpomerenke/scigen.js && cd scigen
$ node lib/cli.js --help
Usage: node cli.js --save [<directory>] [--authors "<author1>, <author2>, ..."] [--bibinlatex] [--silent]
    directory   all files (.tex, .eps, .cls, .bib, ...) will be saved here
    authors     list of the authors in the paper
    bibinlatex  avoids dependency on BibTex (useful especially for texlive.js)
    silent      skip info logging
$ node cli.js --save tmp --authors "Jeremy Stribling, Max Krohn, Dan Aguayo" --silent
$ cd tmp
$ pdflatex -interaction=nonstopmode paper.tex 
$ bibtex paper.aux
$ pdflatex -interaction=nonstopmode paper.tex
$ pdflatex -interaction=nonstopmode paper.tex
$ xdg-open paper.pdf

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 to true 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 but not in Chromium.

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.

FAQs

Package last updated on 18 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc