https://github.com/bytesnake/mdbook-scientific
A plugin for scientific mdbooks
https://github.com/bytesnake/mdbook-scientific
Last synced: about 1 year ago
JSON representation
A plugin for scientific mdbooks
- Host: GitHub
- URL: https://github.com/bytesnake/mdbook-scientific
- Owner: bytesnake
- Created: 2020-04-17T10:03:49.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-13T09:01:23.000Z (over 3 years ago)
- Last Synced: 2023-03-13T00:01:05.900Z (over 3 years ago)
- Language: Rust
- Size: 39.1 KB
- Stars: 14
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Scientific mdbook plugin
This plugin adds functionality to `mdbook` for scientific application. It allows the writer to generate named LaTeX, named Gnuplots and supports `bibtex` files. Further cross-referencing in text to equation, figures or literature is possible. A sample output can be seen [here](https://bytesnake.github.io/mdbook_example/).
## Install
Compile this crate and add the `mdbook-scientific` to your search path. Also [bib2xhtml](https://github.com/dspinellis/bib2xhtml) is required if you want to generate a bibliography. Then add the following to your `book.toml`:
```
[preprocessor.scientific]
renderer = ["html"]
bibliography = "literature.bib"
bib2xhtml = "/home/lorenz/Documents/tmp/bib2xhtml/"
assets = "src/"
[output.html]
additional-css = ["src/scientific.css"]
```
For latex rendering `latex` and `dvisvgm` are required. For gnuplot rendering the `gnuplot` binary.
## Syntax
For block equation rendering use the following syntax
```
$$equation,
...
$$
```
the `equation` identifier is only needed if you want to name the equation block. You can cross-reference it then with `$ref:equ:$` in the whole `mdbook`.
The same syntax is working with `latex` and `gnuplot` figures, both are requiring a subtitle for the plot. Further a `gnuplotonly` figure only uses Gnuplot to render the file to SVG.
Example for gnuplot rendering
```
$$gnuplot, ,
...
$$
```
and then cross-reference with `$ref:fig:$`.
If block is empty, then the preprocessor looks into the `assets` path specified in the configuration. So for a block `$$latex, legendrepoly, Legendre Polynomials$$` it looks for the file `src/legendrepoly.tex`.
The BibTeX file referenced in the configuration file is added as a additional chapter and citations can be generated with `$ref:bib:$`.
## Should I use this
Nope, it's still in its infancy. Please don't use it yet.