| 1 | # /=====================================================================\ # | ||
| 2 | # | LaTeXML::Core::MuDimension | # | ||
| 3 | # | Representation of Math Dimensions | # | ||
| 4 | # |=====================================================================| # | ||
| 5 | # | Part of LaTeXML: | # | ||
| 6 | # | Public domain software, produced as part of work done by the | # | ||
| 7 | # | United States Government & not subject to copyright in the US. | # | ||
| 8 | # |---------------------------------------------------------------------| # | ||
| 9 | # | Bruce Miller <bruce.miller@nist.gov> #_# | # | ||
| 10 | # | http://dlmf.nist.gov/LaTeXML/ (o o) | # | ||
| 11 | # \=========================================================ooo==U==ooo=/ # | ||
| 12 | package LaTeXML::Core::MuDimension; | ||
| 13 | 4 | ▶ | use LaTeXML::Global; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 4 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 4 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | 4 | ▶ | use base qw(LaTeXML::Common::Dimension); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | 4 | ▶ | use base qw(Exporter); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | 4 | our @EXPORT = (qw(&MuDimension)); | |
| 19 | |||
| 20 | #====================================================================== | ||
| 21 | # Exported constructor. | ||
| 22 | |||
| 23 | sub MuDimension { | ||
| 24 | 0 | ▶ | my ($scaledpoints) = @_; |
|
Subroutine
MuDimension: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 25 | 0 | return LaTeXML::Core::MuDimension->new($scaledpoints); } | |
| 26 | |||
| 27 | #====================================================================== | ||
| 28 | |||
| 29 | # A mu is 1/18th of an em in the current math font. | ||
| 30 | # 1 mu = 1em/18 = 10pt/18 = 5/9 pt; 1pt = 9/5mu = 1.8mu | ||
| 31 | sub toString { | ||
| 32 | 0 | ▶ | my ($self) = @_; |
|
Subroutine
toString: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 33 | 0 | return LaTeXML::Common::Float::floatformat($$self[0] / 65536 * 1.8) . 'mu '; } | |
| 34 | |||
| 35 | sub stringify { | ||
| 36 | 0 | ▶ | my ($self) = @_; |
|
Subroutine
stringify: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 37 | 0 | return "MuDimension[" . $$self[0] . "]"; } | |
| 38 | |||
| 39 | #====================================================================== | ||
| 40 | 4 | 1; | |
| 41 | |||
| 42 | __END__ | ||