diff --git a/src/lib.rs b/src/lib.rs index 66df0a9..df3f27e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -86,10 +86,19 @@ pub struct Opts { /// Color used for invalid LaTeX. error_color: Option, /// Collection of custom macros. + /// Read for more information. macros: HashMap, /// Specifies a minimum thickness, in ems. /// Read for more information. min_rule_thickness: Option, + /// Max size for user-specified sizes. + /// If set to `None`, users can make elements and spaces arbitrarily large. + /// Read for more information. + max_size: Option>, + /// Limit the number of macro expansions to the specified number. + /// If set to `None`, the macro expander will try to fully expand as in LaTeX. + /// Read for more information. + max_expand: Option>, } impl Opts { @@ -132,6 +141,21 @@ impl Into for Opts { if let Some(min_rule_thickness) = self.min_rule_thickness { opt.insert("minRuleThickness".to_owned(), min_rule_thickness.into()); } + if let Some(max_size) = self.max_size { + if let Some(max_size) = max_size { + opt.insert("maxSize".to_owned(), max_size.into()); + } + } + if let Some(max_expand) = self.max_expand { + match max_expand { + Some(max_expand) => { + opt.insert("maxExpand".to_owned(), max_expand.into()); + } + None => { + opt.insert("maxExpand".to_owned(), i32::max_value().into()); + } + } + } JsValue::Object(opt) } }