usestd::fs::write;usetectonic::latex_to_pdf;usecrate::error::Error;/// Render a .tex file as a .pdf
pubfnget_pdf(tex:&str)->Result<Vec<u8>, Error>{// Try to generate the PDF.
matchlatex_to_pdf(tex){Ok(pdf)=>Ok(pdf),Err(error)=>{// Dump the TeX string.
let_=write("bad.tex", tex);Err(Error::Pdf(error))}}}