https://github.com/davidpomerenke/scigen.js
Create scientific papers on the fly: SciGen brought to the browser.
Science Score: 20.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
✓Committers with academic emails
2 of 3 committers (66.7%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.8%) to scientific vocabulary
Keywords
Repository
Create scientific papers on the fly: SciGen brought to the browser.
Basic Info
- Host: GitHub
- Owner: davidpomerenke
- License: gpl-3.0
- Language: TeX
- Default Branch: master
- Homepage: https://davidpomerenke.github.io/scigen.js
- Size: 18.9 MB
Statistics
- Stars: 20
- Watchers: 2
- Forks: 7
- Open Issues: 1
- Releases: 0
Topics
Metadata Files
README.md

This project brings SciGen to JavaScript, both for Node and for the browser.
Usage
Node
```javascript import { scigen, scigenSave } from "scigen";
const files = scigen({ authors: ["Jeremy Stribling", "Max Krohn", "Dan Aguayo"], useBibtex: false, }); // this returns an object of file names and contents console.log(Object.keys(files)); console.log(files["paper.tex"]);
// or, to directly save the files to an actual directory: scigenSave({ directory: "mydir", authors: undefined, useBibtex: true, }); ```
Command Line
bash
$ git clone git@github.com:davidpomerenke/scigen.js --depth 1 && 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
useBibtex use Bibtex for formatting the bibliography (disable this for use with texlive.js)
silent skip info logging
$ node lib/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
bash
$ git clone git@github.com:davidpomerenke/scigen.js && cd scigen
$ npx webpack
$ python -m http.server -d docs
$ xdg-open http://localhost:8000
For the detailed setup with TexLive.js, have a look at the docs folder, where the demo is contained. 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.
Structure
srcincludes the main source code, written in ES2016.libis a transpilation of this source code to standard JavaScript. Use this for running and importing the module locally. It is also the code for the NPM module.rulesincludes the context-free grammar to create the papers:rules/rules-originalcontains the.inrules from the original SciGen project, only very slightly modified.rules/rules-compiledcontains the rules compiled to JSON. They can be compiled to JSON by runningperl rules/compile-rules.pl. The JSON files are required for running the module.
docsdoes not contain the documentation but a working example of using the module in the browser. It uses TexLive.js.docs/bundle.jsis the browser code for the module. It is created from thesrcdirectory by runningnpx webpack.docs/precompiled-figuresis a dirty workaround for the figures (see limitations).
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 totruein Node, see the above examples). - Rendering diagrams and figures requires Ghostscript in the original SciGen project. Ghostscript is not available for the browser.
- A good 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.
- A current, bad workaround is implemented in
docs/index.html, where some out of 50 pre-compiled figures are loaded fromdocs/precompiled-figures. However, for an obscure reason Latex treats the diagrams differently than the other figures and layouts them in a very weird way. So diagrams are currently left out completely, which is very unsatisfactory. - For locally producing TEX and PDF files with figures and diagrams, use the original SciGen project with this unmerged fix or run
git clone git@github.com:davidpomerenke/scigen.js && cd scigen/scigen-perl && perl make-latex.pl.
- 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.
Also interesting
Here's an interesting paper on the topic of scientific fake text generators.
- Guillaume Cabanac, Cyril Labbé, Alexander Magazinov. Tortured phrases: A dubious writing style emerging in science. Evidence of critical issues affecting established journals. 2021. [arXiv]
Owner
- Name: David Pomerenke
- Login: davidpomerenke
- Kind: user
- Location: Maastricht
- Website: linkedin.com/in/davidpomerenke
- Repositories: 29
- Profile: https://github.com/davidpomerenke
GitHub Events
Total
- Watch event: 2
Last Year
- Watch event: 2
Committers
Last synced: about 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| David Pomerenke | d****e@u****e | 43 |
| Jeremy Stribling | s****b@a****u | 1 |
| Jeremy Stribling | s****b | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 1
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 1.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- rdjenkins (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v1 composite
- actions/setup-node v1 composite
- 310 dependencies
- @babel/cli ^7.16.0 development
- @babel/core ^7.16.0 development
- @babel/preset-env ^7.16.4 development
- babel-loader ^8.2.3 development
- webpack ^5.64.4 development
- webpack-cli ^4.9.1 development
- minimist ^1.2.5
- pdftex.js 0.0.10
- title-case ^3.0.3