diff --git a/README.md b/README.md index ff35438..f1b7d22 100644 --- a/README.md +++ b/README.md @@ -160,9 +160,9 @@ Either one. `mdbook-latex` can be thought of as a frontend for the LaTeX generat Below is a list of features I am currently working on (loosely in a "top-down" direction). - [x] Add support for equation delimiters "\( x^2 \)" "\[ x^2 \]". -- [ ] Allow SVG images (convert to PNG for LaTeX). +- [x] Allow SVG images (convert to PNG for LaTeX). - [x] Configure [resvg](https://github.com/RazrFalcon/resvg) library to convert SVG's to PNG. - - [ ] Save SVG's in `book/latex` directory to keep `src` clean. + - [x] Save SVG's in `book/latex` directory to keep `src` clean. - [x] Add CI/CD pipeline ([travis](https://travis-ci.org/)) - [x] Move all LaTeX data to single template file (src/template.tex). - [ ] Compile *The Rust Book* and *mdbook* documentation without any errors or warnings (e.g. missing Unicode characters). See [Status of Rust Bookshelf](#status-of-rust-bookshelf) for up to date progress. diff --git a/src/main.rs b/src/main.rs index 50c1aa5..22f3c48 100644 --- a/src/main.rs +++ b/src/main.rs @@ -57,6 +57,10 @@ fn main() -> std::io::Result<()> { // copy template data into memory. let mut template = include_str!("template.tex").to_string(); + // add title and author information. + template = template.replace(r"\title{}", &format!("\\title{{{}}}", title)); + template = template.replace(r"\author{}", &format!("\\author{{{}}}", authors)); + let mut latex = String::new(); // iterate through markdown source. @@ -74,7 +78,7 @@ fn main() -> std::io::Result<()> { if cfg.markdown { // output markdown file. - output(".md".to_string(), title.clone(), &latex, &ctx.destination); + output(".md".to_string(), title.clone(), &content, &ctx.destination); } if cfg.latex || cfg.pdf {