| 1 | # /=====================================================================\ # | ||||||||||||
| 2 | # | LaTeXML::Core::MuGlue | # | ||||||||||||
| 3 | # | Representation of Stretchy 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::MuGlue; | ||||||||||||
| 13 | 5 | ▶ | use LaTeXML::Global; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 14 | 5 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 15 | 5 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 16 | 5 | ▶ | use LaTeXML::Common::Error; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 17 | 5 | ▶ | use LaTeXML::Common::Float; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 18 | 5 | ▶ | use LaTeXML::Common::Number; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 19 | 5 | ▶ | use LaTeXML::Common::Dimension; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 20 | 5 | ▶ | use LaTeXML::Common::Glue; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 21 | 5 | ▶ | use base qw(LaTeXML::Common::Glue); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 22 | 5 | ▶ | use base qw(Exporter); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 23 | 5 | our @EXPORT = (qw(&MuGlue)); | |||||||||||
| 24 | |||||||||||||
| 25 | #====================================================================== | ||||||||||||
| 26 | # Exported constructor. | ||||||||||||
| 27 | |||||||||||||
| 28 | # Create a new MuGlue, given EITHER a string with muunits, fills,etc, | ||||||||||||
| 29 | # OR separate args, wiith $spec, $plus, $minus being fixed point, | ||||||||||||
| 30 | # and $pfill, $mfill being 0 (sp) or a fillcode | ||||||||||||
| 31 | # Note: this stores mu (NOT pts) as fixed point number | ||||||||||||
| 32 | # [Glue is parameterized on the effective unit] | ||||||||||||
| 33 | 0 | ▶ | sub MuGlue { | ||||||||||
|
Subroutine
MuGlue: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 34 | 0 | my ($spec, $plus, $pfill, $minus, $mfill) = @_; | |||||||||||
| 35 | 0 | return LaTeXML::Core::MuGlue->new($spec, $plus, $pfill, $minus, $mfill); } | |||||||||||
| 36 | |||||||||||||
| 37 | #====================================================================== | ||||||||||||
| 38 | 0 | ▶ | sub _unit { return 'mu'; } | ||||||||||
|
Subroutine
_unit: not called CC=1 SCAR=6.9
| |||||||||||||
| 39 | |||||||||||||
| 40 | 0 | ▶ | sub stringify { | ||||||||||
|
Subroutine
stringify: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 41 | 0 | my ($self) = @_; | |||||||||||
| 42 | 0 | return "MuGlue[" . join(',', @$self) . "]"; } | |||||||||||
| 43 | |||||||||||||
| 44 | 0 | ▶ | sub spValue { | ||||||||||
|
Subroutine
spValue: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 45 | 0 | my ($self, $prec) = @_; | |||||||||||
| 46 | 0 | return fixpoint($$self[0] / $UNITY, $STATE->lookupValue('font')->getMUWidth); } | |||||||||||
| 47 | |||||||||||||
| 48 | 0 | ▶ | sub ptValue { | ||||||||||
|
Subroutine
ptValue: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 49 | 0 | my ($self, $prec) = @_; | |||||||||||
| 50 | 0 | return roundto($self->spValue / $UNITY, $prec); } | |||||||||||
| 51 | |||||||||||||
| 52 | 0 | ▶ | sub pxValue { | ||||||||||
|
Subroutine
pxValue: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 53 | 0 | my ($self, $prec) = @_; | |||||||||||
| 54 | 0 | ▶ | return roundto($self->spValue / $UNITY / 1.8 * ($STATE->lookupValue('DPI') || 100 / 72.27), $prec); } | ||||||||||
|
Condition0%0/2
$LaTeXML::Core::MuGlue::STATE->lookupValue('DPI') || 1.3837000138370001423
MC/DC0%0/1
$LaTeXML::Core::MuGlue::STATE->lookupValue('DPI') || 1.3837000138370001423
$LaTeXML::Core::MuGlue::STATE->lookupValue('DPI')
Truth table0%0/2
A
A= $LaTeXML::Core::MuGlue::STATE->lookupValue('DPI')
| |||||||||||||
| 55 | #====================================================================== | ||||||||||||
| 56 | 5 | 1; | |||||||||||
| 57 | |||||||||||||
| 58 | __END__ | ||||||||||||