| 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 | 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 LaTeXML::Common::Float; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 17 | 4 | ▶ | use base qw(LaTeXML::Common::Glue); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 18 | 4 | ▶ | use base qw(Exporter); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 19 | 4 | our @EXPORT = (qw(&MuGlue)); | |||||||||||||
| 20 | |||||||||||||||
| 21 | #====================================================================== | ||||||||||||||
| 22 | # Exported constructor. | ||||||||||||||
| 23 | |||||||||||||||
| 24 | sub MuGlue { | ||||||||||||||
| 25 | 0 | ▶ | my ($scaledpoints, $plus, $pfill, $minus, $mfill) = @_; | ||||||||||||
|
Subroutine
MuGlue: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 26 | 0 | return LaTeXML::Core::MuGlue->new($scaledpoints, $plus, $pfill, $minus, $mfill); } | |||||||||||||
| 27 | |||||||||||||||
| 28 | #====================================================================== | ||||||||||||||
| 29 | |||||||||||||||
| 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=5 SCAR=34.0
Pod
documented
| |||||||||||||||
| 33 | 0 | my ($sp, $plus, $pfill, $minus, $mfill) = @$self; | |||||||||||||
| 34 | 0 | my $string = LaTeXML::Common::Float::floatformat($sp / 65536 * 1.8) . 'mu '; | |||||||||||||
| 35 | 0 | ▶ | $string .= 'plus ' . ($pfill | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 36 | ? $plus . $LaTeXML::Common::Glue::FILL[$pfill] | ||||||||||||||
| 37 | : LaTeXML::Common::Float::floatformat($plus / 65536 * 1.8) . 'mu ') if $plus != 0; | ||||||||||||||
| 38 | 0 | ▶ | $string .= 'minus ' . ($mfill | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 39 | ? $minus . $LaTeXML::Common::Glue::FILL[$mfill] | ||||||||||||||
| 40 | : LaTeXML::Common::Float::floatformat($minus / 65536 * 1.8) . 'mu ') if $minus != 0; | ||||||||||||||
| 41 | 0 | return $string; } | |||||||||||||
| 42 | |||||||||||||||
| 43 | sub toAttribute { | ||||||||||||||
| 44 | 0 | ▶ | my ($self) = @_; | ||||||||||||
|
Subroutine
toAttribute: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||
| 45 | 0 | my ($sp, $plus, $pfill, $minus, $mfill) = @$self; | |||||||||||||
| 46 | 0 | my $string = LaTeXML::Common::Float::floatformat($sp / 65536 * 1.8) . "mu"; | |||||||||||||
| 47 | 0 | ▶ | $string .= ' plus ' . ($pfill | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 48 | ? $plus . $LaTeXML::Common::Glue::FILL[$pfill] | ||||||||||||||
| 49 | : LaTeXML::Common::Float::floatformat($plus / 65536 * 1.8) . 'mu') if $plus != 0; | ||||||||||||||
| 50 | 0 | ▶ | $string .= ' minus ' . ($mfill | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 51 | ? $minus . $LaTeXML::Common::Glue::FILL[$mfill] | ||||||||||||||
| 52 | : LaTeXML::Common::Float::floatformat($minus / 65536 * 1.8) . 'mu') if $minus != 0; | ||||||||||||||
| 53 | 0 | return $string; } | |||||||||||||
| 54 | |||||||||||||||
| 55 | sub stringify { | ||||||||||||||
| 56 | 0 | ▶ | my ($self) = @_; | ||||||||||||
|
Subroutine
stringify: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 57 | 0 | return "MuGlue[" . join(',', @$self) . "]"; } | |||||||||||||
| 58 | |||||||||||||||
| 59 | #====================================================================== | ||||||||||||||
| 60 | 4 | 1; | |||||||||||||
| 61 | |||||||||||||||
| 62 | __END__ | ||||||||||||||