An mdbook backend for generating LaTeX and PDF documents.
Warning: Not yet stable — may eat, shred, and atomize your laundry! See the Are We Stable Yet? section for a roadmap to the production release.
| Compiles? | Generated PDF | Generated LaTeX | Source | Online Version | | --------- | --------------------------------- | ----------------------- | ---------------------- | --------------------- | | ❌ | ~~Cargo Book~~ | ~~LaTeX~~ | Source | HTML | | ❌ | ~~Edition Guide~~ | ~~LaTeX~~ | Source | HTML | | ❌ | ~~Embedded Rust Book~~ | ~~LaTeX~~ | Source | HTML | | 🍊 | Mdbook User Guide | LaTeX | Source | HTML | | ❌ | ~~Rust Reference~~ | ~~LaTeX~~ | Source | HTML | | ❌ | ~~Rust By Example~~ | ~~LaTeX~~ | Source | HTML | | 🍊 | Rust Programming Language | LaTeX | Source | HTML | | ❌ | ~~Rustc Book~~ | ~~LaTeX~~ | Source | HTML | | ❌ | ~~Rustdoc Book~~ | ~~LaTeX~~ | Source | HTML | | ❌ | ~~Rustonomicon~~ | ~~LaTeX~~ | Source | HTML | | ❌ | ~~Unstable Book~~ | ~~LaTeX~~ | Source | HTML |
First, install the following two programs:
Then, to install mdbook-latex
, enter the following in a shell:
sh
cargo install mdbook-latex
Finally, add the following toml
configuration to book.toml
.
toml
[output.latex]
latex = true
pdf = true
The next mdbook build
command will produce LaTeX and PDF files in the book/latex/
directory.
To uninstall mdbook-latex
, enter the following in a shell:
sh
cargo uninstall mdbook-latex
Then delete the [output.latex]
configuration in book.toml
:
diff
- [output.latex]
- latex = true
- pdf = true
mdbook-latex
is built upon some really wonderful projects, including:
md2tex
and mdbook-latex
are developed in tandem, but are meant to be independent programs. Therefore, if one wishes to use an alternative markdown-to-tex conveter, they should be able to plug it in to mdbook-latex
with ease.Broadly speaking, there are three steps, or "transformations", from mdbook
source to PDF output:
1) mdbook source to JSON-organized markdown (mdbook-latex
): retreives the JSON formatted data from mdbook
. Calls md2tex
and tectonic
for LaTeX and PDF generation, respectively.
2) markdown to LaTeX (md2tex
): converts markdown input to LaTeX output.
3) LaTeX to PDF (tectonic
): creates PDF document from LaTeX input.
Pull requests, forks, and plain old copy-pasting are actively encouraged! Also, I am relatively new to Rust (and programming in general) so recommendations or advice in general is always appreciated.
mdbook-latex
or md2tex
?Either one. mdbook-latex
can be thought of as a frontend for the LaTeX generation done by md2tex
. So if there is a LaTeX error, you may favor creating an issue with md2tex
. Otherwise, creating an issue with mdbook-latex
is a good bet. But any issue is a good issue, so don't worry if it's in the "right" repository or not, I should be able to see it regardless!
Below is a list of features I am currently working on (loosly in "top-down" direction).
book/latex
directory to keep src
clean.The following projects served as guidance for mdbook-latex
(or are simply cool enough that they deserve to be shared!):
mdbook
that will verify URL links.mdbook
, but with an added focus on "novels and fiction". Though general enough to handle a lot of different projects.mdbook-latex
!