#[cfg(feature = "tectonic")]
pub fn compile_tectonic(tex: &str) -> Result<Vec<u8>, String> {
tectonic::latex_to_pdf(tex).map_err(|e| format!("tectonic failed: {e}"))
}
#[cfg(all(test, feature = "tectonic"))]
mod tests {
use super::*;
#[test]
fn prototype_compiles_mini() {
let tex = r"\documentclass{article}
\usepackage{lmodern}
\usepackage{amsmath,amssymb}
\usepackage{tabularx}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric,arrows.meta,positioning}
\begin{document}
\title{T}\author{A}\maketitle
Hello.
\begin{tikzpicture}\node[draw](a){x};\end{tikzpicture}
\begin{tabularx}{\columnwidth}{Xl}A&B\\1&2\\\end{tabularx}
\end{document}
";
let pdf = compile_tectonic(tex).expect("tectonic mini compile");
assert!(pdf.starts_with(b"%PDF-"));
}
}