/usr/share/perl5/LaTeXML/Package/dcolumn.sty.ltxml is in latexml 0.8.1-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 | # -*- mode: Perl -*-
# /=====================================================================\ #
# | dcolumn | #
# | Implementation 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=/ #
package LaTeXML::Package::Pool;
use strict;
use warnings;
use LaTeXML::Package;
RequirePackage('array');
sub absorbedString {
my ($tokens) = @_;
my $capdocument = LaTeXML::Core::Document->new($STATE->getModel);
my $capture = $capdocument->openElement('ltx:_Capture_', font => LaTeXML::Common::Font->new());
$capdocument->absorb(Digest($tokens));
if (my @nodes = $capdocument->findnodes("//ltx:XMath/*", $capture)) {
return $nodes[0]->textContent; }
else {
return $capture->textContent; } } # ???
DefMacro('\DC@{}{}{}', sub {
my ($gullet, $delim, $todelim, $ndec) = @_;
$delim = ToString($delim);
if ($delim ne ToString($todelim)) {
$STATE->assignMathcode($delim => 0x8000);
DefMacroI(T_CS($delim), undef, '\ROLE{PERIOD}{' . UnTeX($todelim) . '}');
}
if (LookupValue('IN_MATH') || $gullet->ifNext(T_MATH)) { # Not really good enough, but...
(); }
else {
Let('\DC@end', T_MATH);
(T_MATH); } });
# NOTE: We should be making arrangements for this funny thing to still
# be considered a number!
DefMacro('\DC@end', '');
DefColumnType('D{}{}{}', sub {
my ($gullet, $delim, $todelim, $ndec) = @_;
my $alignment = absorbedString(Tokens(T_CS('\ensuremath'), T_BEGIN, $todelim, T_END));
$LaTeXML::BUILD_TEMPLATE->addColumn(before => Tokens(T_CS('\DC@'),
T_BEGIN, $delim->unlist, T_END,
T_BEGIN, $todelim->unlist, T_END,
T_BEGIN, $ndec->unlist, T_END),
align => 'char:' . $alignment,
after => Tokens(T_CS('\DC@end')));
return; });
1;
|