Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "scigen", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Create scientific papers on the fly: SciGen brought to the browser and to Node.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -14,19 +14,26 @@ ![# SciGen.js](logo.png) | ||
### Node | ||
```javascript | ||
import { scigen, scigenSave } from 'scigen' | ||
import { scigen, scigenSave } from "scigen"; | ||
const files = scigen( | ||
/* authors = */ ['Jeremy Stribling', 'Max Krohn', 'Dan Aguayo'], | ||
/* avoid bibtex dependency = */ false) | ||
console.log(files['paper.tex']) | ||
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"]); | ||
scigenSave( | ||
/* directory = */ 'mydir', | ||
/* authors = */ undefined, | ||
/* avoid bibtex dependency = */ true) | ||
// 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 && cd scigen | ||
$ git clone git@github.com:davidpomerenke/scigen.js --depth 1 && cd scigen | ||
$ node lib/cli.js --help | ||
@@ -36,7 +43,7 @@ Usage: node cli.js --save [<directory>] [--authors "<author1>, <author2>, ..."] [--bibinlatex] [--silent] | ||
authors list of the authors in the paper | ||
bibinlatex avoids dependency on BibTex (useful especially for texlive.js) | ||
useBibtex use Bibtex for formatting the bibliography (disable this for use with texlive.js) | ||
silent skip info logging | ||
$ node cli.js --save tmp --authors "Jeremy Stribling, Max Krohn, Dan Aguayo" --silent | ||
$ node lib/cli.js --save tmp --authors "Jeremy Stribling, Max Krohn, Dan Aguayo" --silent | ||
$ cd tmp | ||
$ pdflatex -interaction=nonstopmode paper.tex | ||
$ pdflatex -interaction=nonstopmode paper.tex | ||
$ bibtex paper.aux | ||
@@ -49,2 +56,3 @@ $ pdflatex -interaction=nonstopmode paper.tex | ||
### Browser | ||
```bash | ||
@@ -57,8 +65,10 @@ $ git clone git@github.com:davidpomerenke/scigen.js && cd scigen | ||
See also the [TexLive.js Wiki](https://github.com/manuels/texlive.js/wiki). | ||
For the detailed setup with TexLive.js, have a look at the [`docs`](docs) folder, where the demo is contained. See also the [TexLive.js Wiki](https://github.com/manuels/texlive.js/wiki). | ||
## Rule Compilation | ||
The almost original rule files from the [original SciGen project](https://github.com/strib/scigen) 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 | ||
- `src` includes the main source code, written in _ES2016_. | ||
@@ -74,15 +84,18 @@ - `lib` is 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. | ||
## Limitations | ||
- Bibtex is not available for the browser (cf. [here](https://github.com/manuels/texlive.js/issues/7)). 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](https://github.com/strib/scigen). _Ghostscript_ is not available for the browser. | ||
- Rendering diagrams and figures requires _Ghostscript_ in the [original SciGen project](https://github.com/strib/scigen). _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 from `docs/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](https://github.com/strib/scigen) with [this unmerged fix](https://github.com/strib/scigen/pull/5) or run `git clone git@github.com:davidpomerenke/scigen.js && cd scigen/scigen-perl && perl make-latex.pl`. | ||
- For locally producing TEX and PDF files with figures and diagrams, use the [original SciGen project](https://github.com/strib/scigen) with [this unmerged fix](https://github.com/strib/scigen/pull/5) 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](https://github.com/manuels/texlive.js/issues/63). | ||
## Motivation | ||
The server-side code at the [original SciGen website](https://pdos.csail.mit.edu/archive/scigen/) 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. | ||
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]](https://arxiv.org/abs/2107.06751) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
768327
97