Skip to content

Commit

Permalink
Save SVG's in book/latex (keeps src/ clean).
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeckman314 committed Aug 25, 2019
1 parent c0f6d6e commit c0af37a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 {
Expand Down

0 comments on commit c0af37a

Please sign in to comment.