| 1 | # /=====================================================================\ # | ||
| 2 | # | LaTeXML::Post::TeXMath | # | ||
| 3 | # | Copy TeX as parallel Math | # | ||
| 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 | |||
| 13 | # ================================================================================ | ||
| 14 | # Trivial Math PostProcessor which supplies the TeX string | ||
| 15 | # ================================================================================ | ||
| 16 | |||
| 17 | package LaTeXML::Post::TeXMath; | ||
| 18 | use strict; | ||
| 19 | use warnings; | ||
| 20 | use LaTeXML::Common::XML; | ||
| 21 | use LaTeXML::Post; | ||
| 22 | use base qw(LaTeXML::Post::MathProcessor); | ||
| 23 | |||
| 24 | #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 25 | # Top level | ||
| 26 | #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 27 | |||
| 28 | our $lxMimeType = 'application/x-tex'; | ||
| 29 | |||
| 30 | sub convertNode { | ||
| 31 | my ($self, $doc, $xmath, $style) = @_; | ||
| 32 | my $math = $xmath->parentNode; | ||
| 33 | my $tex = $math && isElementNode($math) && $math->getAttribute('tex'); | ||
| 34 | return { processor => $self, encoding => $lxMimeType, mimetype => $lxMimeType, | ||
| 35 | string => $tex }; } | ||
| 36 | |||
| 37 | sub rawIDSuffix { | ||
| 38 | return '.tm'; } | ||
| 39 | |||
| 40 | #================================================================================ | ||
| 41 | |||
| 42 | 1; |