pub struct Dimension(pub i64);Tuple Fields§
§0: i64Implementations§
Source§impl Dimension
impl Dimension
Sourcepub fn em_value(&self, prec: Option<u8>, font: Option<&Font>) -> f64
pub fn em_value(&self, prec: Option<u8>, font: Option<&Font>) -> f64
Convert dimension to em units, using the given font’s EM width (or current font if None).
Sourcepub fn spec_is_readable(spec: &str) -> bool
pub fn spec_is_readable(spec: &str) -> bool
Whether Self::spec_to_f64 reads spec as written: empty, a dimension (SPEC_RE), or a number of sp.
pub fn spec_to_f64(spec: &str) -> Result<f64>
Trait Implementations§
impl Copy for Dimension
impl Eq for Dimension
Source§impl From<&RegisterValue> for Dimension
impl From<&RegisterValue> for Dimension
Source§fn from(v: &RegisterValue) -> Dimension
fn from(v: &RegisterValue) -> Dimension
Converts to this type from the input type.
Source§impl From<Dimension> for RegisterValue
impl From<Dimension> for RegisterValue
Source§fn from(n: Dimension) -> RegisterValue
fn from(n: Dimension) -> RegisterValue
Converts to this type from the input type.
Source§impl From<RegisterValue> for Dimension
impl From<RegisterValue> for Dimension
Source§fn from(v: RegisterValue) -> Dimension
fn from(v: RegisterValue) -> Dimension
Converts to this type from the input type.
Source§impl IntoRegisterValueOption<Option<RegisterValue>> for Dimension
impl IntoRegisterValueOption<Option<RegisterValue>> for Dimension
fn into_register_value_option(self) -> Option<RegisterValue>
Source§impl NumericOps for Dimension
impl NumericOps for Dimension
fn new(number: i64) -> Self
fn new_f64(number: f64) -> Self
fn value_of(self) -> i64
fn register_type(&self) -> RegisterType
fn unit(&self) -> Option<&'static str>
fn to_attribute(&self) -> String
fn value_f64(self) -> f64where
Self: Sized,
fn pt_value(self, prec: Option<u8>) -> f64where
Self: Sized,
fn px_value(self, prec: Option<u8>) -> f64where
Self: Sized,
fn absolute(self) -> Selfwhere
Self: Sized,
fn sign(self) -> i8where
Self: Sized,
fn negate(self) -> Selfwhere
Self: Sized,
fn add<T: NumericOps>(self, other: T) -> Selfwhere
Self: Sized,
fn subtract<T: NumericOps>(self, other: T) -> Selfwhere
Self: Sized,
fn multiply<T: NumericOps>(self, other: T) -> Selfwhere
Self: Sized,
Source§fn arith_ceiling() -> i64
fn arith_ceiling() -> i64
The arith_error clamp bound:
max_dimen for dimensions and glue,
TeX’s integer infinity for counts (overridden by Number).Source§fn divide<T: NumericOps>(self, other: T) -> Selfwhere
Self: Sized,
fn divide<T: NumericOps>(self, other: T) -> Selfwhere
Self: Sized,
Truncating division
Source§fn divideround<T: NumericOps>(self, other: T) -> Selfwhere
Self: Sized,
fn divideround<T: NumericOps>(self, other: T) -> Selfwhere
Self: Sized,
Rounding division — eTeX’s
quotient(n,d) (etex.ch “Declare
subprocedures for scan_expr”): work on magnitudes and round half AWAY
from zero, so \numexpr -1/2 = -1 and -7/2 = -4 (pdflatex-probed).
Perl Number.pm int(0.5 + n/d) truncates toward zero and yields 0 / -3
(KNOWN_PERL_ERRORS #124); l3fp’s \__fp_mul_cases_o:NnNnww case index
(#5 #2 #8) / 2 * 2 + 7 (expl3-code.tex:18724-18760) relies on the TeX
rounding, so 0 * x inside a +/- expression collapsed the whole
\fp_eval:n to 0 (wheelchart’s tikz transform determinant,
wheelchart.sty:2423). A zero divisor is TeX’s arith_error → 0.fn smaller<T: NumericOps>(self, other: T) -> Selfwhere
Self: Sized,
fn larger<T: NumericOps>(self, other: T) -> Selfwhere
Self: Sized,
fn to_token(self) -> Tokenwhere
Self: Sized,
fn into_glue_type(self) -> Gluewhere
Self: Sized,
Source§impl Object for Dimension
impl Object for Dimension
Source§fn revert(&self) -> Result<Tokens>
fn revert(&self) -> Result<Tokens>
each concrete object needs to provide its own path back to tokens
fn be_digested(self) -> Result<Digested>
fn stringify(&self) -> String
fn isa_box(&self) -> bool
fn is_expandable(&self) -> bool
fn is_definition(&self) -> bool
fn is_comment(&self) -> bool
Source§fn get_locator(&self) -> Option<Locator>
fn get_locator(&self) -> Option<Locator>
The object’s stored source locator, if it has one.
None is the honest
“no recorded source position” (replacing the old Locator::default()
file!()/line!() sentinel). For “where the parser is now” (error
reporting, box creation), use the free fn gullet::get_locator().Source§fn get_origin(&self) -> DefinitionOrigin
fn get_origin(&self) -> DefinitionOrigin
Who made this definition (K1 provenance,
definition::origin). The
default is Unknown, which counts as LaTeXML’s own.impl StructuralPartialEq for Dimension
Auto Trait Implementations§
impl Freeze for Dimension
impl RefUnwindSafe for Dimension
impl Send for Dimension
impl Sync for Dimension
impl Unpin for Dimension
impl UnsafeUnpin for Dimension
impl UnwindSafe for Dimension
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more