diff --git a/src/rust_typeset/frontend.rs b/src/rust_typeset/frontend.rs index f928fa7..ee78cd1 100644 --- a/src/rust_typeset/frontend.rs +++ b/src/rust_typeset/frontend.rs @@ -140,7 +140,7 @@ const PRELUDE: &str = r#" \def\mathbb#1{\texrramathfontstart{blackboard}#1\texrramathfontend} \def\mathfrak#1{\texrramathfontstart{fraktur}#1\texrramathfontend} \def\boldsymbol#1{\texrramathfontstart{bold}#1\texrramathfontend} -\def\operatorname#1{\texrraoperatorstart#1\texrraoperatorend} +\def\operatorname#1{\mathrm{#1}} \def\stackrel#1#2{\mathrel{\mathop{#2}\limits^{#1}}} \def\overset#1#2{\mathop{#2}\limits^{#1}} \def\underset#1#2{\mathop{#2}\limits_{#1}} diff --git a/tests/typeset.rs b/tests/typeset.rs index a22492f..ea972c3 100644 --- a/tests/typeset.rs +++ b/tests/typeset.rs @@ -1826,6 +1826,20 @@ fn aligned_with_leading_space_and_big_brace_compiles() { assert_eq!(value["status"], "ok"); } +#[test] +fn operatorname_renders_operator_glyphs() { + let source = + "\\documentclass{article}\n\\begin{document}\n$\\operatorname{H}(x)$\n\\end{document}\n"; + let value = fresh_preview(source, "operatorname.tex"); + assert_eq!(value["status"], "ok"); + let svg = page_svg(&value, 0); + assert!( + svg.matches("= 2, + "operatorname should paint its glyphs: {}", + &svg[..svg.len().min(300)] + ); +} + #[test] fn eqref_and_math_accents_compile() { let source = r#"\documentclass{article}