diff --git a/src/config.rs b/src/config.rs index daeccbd035..d5713aba82 100644 --- a/src/config.rs +++ b/src/config.rs @@ -493,6 +493,8 @@ pub struct HtmlConfig { pub curly_quotes: bool, /// Should mathjax be enabled? pub mathjax_support: bool, + /// Should mathjax enable `$…$` inline math? This option has no effect if mathjax is not enabled. + pub inline_math_dollar_sign: bool, /// Whether to fonts.css and respective font files to the output directory. pub copy_fonts: bool, /// An optional google analytics code. @@ -554,6 +556,7 @@ impl Default for HtmlConfig { preferred_dark_theme: None, curly_quotes: false, mathjax_support: false, + inline_math_dollar_sign: false, copy_fonts: true, google_analytics: None, additional_css: Vec::new(), diff --git a/src/renderer/html_handlebars/hbs_renderer.rs b/src/renderer/html_handlebars/hbs_renderer.rs index 69dc31248c..459468fc93 100644 --- a/src/renderer/html_handlebars/hbs_renderer.rs +++ b/src/renderer/html_handlebars/hbs_renderer.rs @@ -634,6 +634,10 @@ fn make_data( data.insert("mathjax_support".to_owned(), json!(true)); } + if html_config.inline_math_dollar_sign { + data.insert("inline_math_dollar_sign".to_owned(), json!(true)); + } + if html_config.copy_fonts { data.insert("copy_fonts".to_owned(), json!(true)); } diff --git a/src/theme/index.hbs b/src/theme/index.hbs index 966eedbcef..c6746cb300 100644 --- a/src/theme/index.hbs +++ b/src/theme/index.hbs @@ -52,6 +52,12 @@ {{#if mathjax_support}} + {{#if inline_math_dollar_sign}} + + + {{/if}} {{/if}}