lbeckman314 / mdbook-latex

An mdbook backend for generating LaTeX and PDF documents.
https://liambeckman.com/code/mdbook-latex/
Mozilla Public License 2.0
104 stars 11 forks source link

Successful Build of rust-lang/book with xelatex #11

Open danieldjewell opened 4 years ago

danieldjewell commented 4 years ago

Hi!

I was poking around with trying to create a PDF of rust-lang/book (so that I could read it :grin:) ... I'm certainly a major novice with Rust but I know a few tricks in TeX and Markdown.

Although I didn't play with Tectonic (until I found this project, I wasn't even aware of its existence :hand_over_mouth:), I was able to get the book to build with xelatex (XeTeX 3.14159265-2.6-0.999991 (TeX Live 2019)).

The only major modification was to remove the HTML-style comments from the TeX source generated by md2tex -- I'm not sure if Tectonic can process those but I don't recall that being valid TeX source.

That said, it does appear that there is a regex match in md2tex to remove the comments but I'm not sure it's working... (My ability to read Rust and determine what's going on is minimal right now...)

Aside from that, there might be a few minor formatting things but I'm not really sure that it would be easy to implement (e.g. making the TeX section numbers match up with the "Chapter" references in the text... I haven't looked deep enough into that to see what's going on there.)

Thank you for the great tool though! :) :+1:

https://github.com/lbeckman314/md2tex/blob/a065dbeac9ebfe6d91befe1dc4e6f708a0991ff5/src/lib.rs#L491-L493