/usr/share/perl5/LaTeXML/Post/XMath.pm is in latexml 0.8.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | # /=====================================================================\ #
# | LaTeXML::Post::XMath | #
# | XMath pseudo-generator for LaTeXML | #
# |=====================================================================| #
# | Part of LaTeXML: | #
# | Public domain software, produced as part of work done by the | #
# | United States Government & not subject to copyright in the US. | #
# |---------------------------------------------------------------------| #
# | Bruce Miller <bruce.miller@nist.gov> #_# | #
# | http://dlmf.nist.gov/LaTeXML/ (o o) | #
# \=========================================================ooo==U==ooo=/ #
# ================================================================================
# LaTeXML::XMath Math Formatter for LaTeXML's Parsed Math.
# LaTeXML's parallel math markup model is rather primitive;
# we just let the ltx:Math contain ltx:XMath and any other math representations.
# There isn't any intelligent selection or classification of them (yet?).
#
# If XMath is going to be kept in the document either alone,
# or as the "primary" representation within a Parallel markup,
# then all we have to do is leave it alone --- it's fine where it is.
#
# If it is NOT the primary representation, however, then we'll need
# to MOVE the XMath from where it is to whereever the primary representation
# wants it. Since it has ID's within it that are already known to the document,
# it needs to move, rather than be copied.
#
# AND, since any formatters that would follow this one would want to translate
# the XMath (which is now gone), this math formatter MUST be the last one....
# OR... Does it?????
# ================================================================================
package LaTeXML::Post::XMath;
use strict;
use warnings;
use LaTeXML::Common::XML;
use LaTeXML::Post;
use base qw(LaTeXML::Post::MathProcessor);
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Top level
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
sub convertNode {
my ($self, $doc, $xmath, $style) = @_;
my $idsuffix = $self->IDSuffix;
if ($idsuffix) {
return ['ltx:XMath', {}, map { $doc->cloneNode($_, $idsuffix) } element_nodes($xmath)]; }
else {
# If no idsuffix, we're actually just PRESERVING the xmath,
# so we shouldn't need any cloning or id munging (!?!?!?!)
return $xmath; } }
sub combineParallel {
my ($self, $doc, $math, $xmath, $primary, @secondaries) = @_;
# Just return the converted nodes to be added to the ltx:Math
return ($primary, map { $$_[1] } @secondaries); }
sub getEncodingName {
return 'application/x-latexml'; }
sub rawIDSuffix {
return '.xm'; }
#================================================================================
1;
|