/usr/share/perl5/LaTeXML/Package/amsthm.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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | # -*- mode: Perl -*-
# /=====================================================================\ #
# | amsthm | #
# | 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. | #
# |---------------------------------------------------------------------| #
# | Thanks to the arXMLiv group for initial implementation | #
# | http://arxmliv.kwarc.info/ | #
# | Released to the Public Domain | #
# |---------------------------------------------------------------------| #
# | 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;
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Core is defined in LaTeX.ltxml
Let('\nonslanted', '\upshape');
DefMacroI('\nopunct', undef, Tokens());
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Theorem Styles.
# amsthm includes headfont!
AssignValue(THEOREM_PARAMETERS => ['\thm@headfont', '\thm@bodyfont', '\thm@headpunct',
'\thm@styling', '\thm@headstyling',
'thm@swap']);
# activate a certain theorem style
DefPrimitive('\theoremstyle{}', sub {
my $style = ToString($_[1]);
AssignValue('\thm@style' => $style);
Digest(T_CS('\th@' . $style));
return; });
DefMacro('\swapnumbers', sub {
AssignValue('thm@swap' => (LookupValue('thm@swap') eq 'N' ? 'S' : 'N')); });
# The default theorem styles.
# plain is defined in LaTeX, but we need to add headpunct (.)
DefPrimitive('\th@plain', sub {
AssignValue('\thm@headfont' => T_CS('\bfseries'));
AssignValue('\thm@bodyfont' => T_CS('\itshape'));
AssignValue('\thm@headpunct' => T_OTHER('.'));
AssignValue('\thm@headstyling' => T_CS('\lx@makerunin'));
return; });
DefPrimitive('\th@definition', sub {
AssignValue('\thm@headfont' => T_CS('\bfseries'));
AssignValue('\thm@bodyfont' => T_CS('\normalfont'));
AssignValue('\thm@headpunct' => T_OTHER('.'));
AssignValue('\thm@headstyling' => T_CS('\lx@makerunin'));
return; });
DefPrimitive('\th@remark', sub {
AssignValue('\thm@headfont' => T_CS('\itshape'));
AssignValue('\thm@bodyfont' => T_CS('\normalfont'));
AssignValue('\thm@headpunct' => T_OTHER('.'));
AssignValue('\thm@headstyling' => T_CS('\lx@makerunin'));
return; });
RawTeX('\theoremstyle{plain}'); # Activate the default style.
#\newtheoremstyle{note}% name
# {3pt}% Space above
# {3pt}% Space below
# {}% Body font
# {}% Indent amount (empty = no indent, \parindent = para indent)
# {\itshape}% Thm head font
# {:}% Punctuation after thm head
# {.5em}% Space after thm head: " " = normal interword space;
# % \newline = linebreak
# {}% Thm head spec (can be left empty, meaning `normal')
DefPrimitive('\newtheoremstyle{}{}{}{}{}{}{}{}{}', sub {
my ($stomach, $name, $spaceabove, $spacebelow, $bodyfont,
$indent, $headfont, $headpunct, $spaceafter, $headspec) = @_;
DefMacroI(T_CS('\th@' . ToString($name)), undef, sub {
AssignValue('\thm@bodyfont' => $bodyfont);
AssignValue('\thm@headfont' => $headfont);
AssignValue('\thm@headpunct' => $headpunct);
AssignValue('\thm@headstyling' => (Equals($spaceafter, Tokens(T_CS('\newline')))
? Tokens() : T_CS('\lx@makerunin')));
return; });
});
DefMacro('\thmname{}', Tokens());
DefMacro('\thmnumber{}', Tokens());
DefMacro('\thmnote{}', Tokens());
DefMacro('\thmhead{}{}{}', Tokens());
DefMacro('\swappedhead{}{}{}', Tokens());
DefMacroI('\thmheadnl', undef, Tokens());
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Proofs
AssignValue('QED@stack', []);
DefMacro('\pushQED{}', sub { PushValue('QED@stack', $_[1]); });
DefMacro('\popQED{}', sub { (PopValue('QED@stack')); });
# Should mark this as somehow ignorable for math,
# but we DO want to keep it in the formula...
DefConstructor('\qed',
"?#isMath(<ltx:XMTok role='PUNCT'>\x{220E}</ltx:XMTok>)(\x{220E})");
Let('\mathqed', '\qed');
Let('\textsquare', '\qed');
Let('\qedsymbol', '\qed');
Let('\openbox', '\qed');
DefMacro('\qedhere', sub {
my $t = PopValue('QED@stack');
PushValue('QED@stack', Tokens());
$t; });
DefMacro('\proofname', 'Proof');
DefPrimitive('\th@proof', sub {
AssignValue('\thm@headfont' => T_CS('\itshape'));
AssignValue('\thm@bodyfont' => T_CS('\normalfont'));
return; });
# Note that you get EITHER \proofname OR [#1] but NOT both!!!
DefEnvironment('{@proof} OptionalUndigested',
"<ltx:proof class='#class'>"
. "<ltx:title font='#titlefont' _force_font='true' class='#titleclass'>#title</ltx:title>"
. "#body"
. "</ltx:proof>",
beforeDigest => sub {
Digest(T_CS('\th@proof')); },
afterDigestBegin => sub {
my ($stomach, $whatsit) = @_;
PushValue('QED@stack', T_CS('\qed'));
Digest(Tokens(T_CS('\the'), T_CS('\thm@bodyfont'))); },
properties => sub {
my $title = Digest(Tokens(T_BEGIN, T_CS('\the'), T_CS('\thm@headfont'),
($_[1] ? $_[1]->unlist : (T_CS('\proofname'))),
T_OTHER('.'), T_END));
my $titlefont = [$title->unlist]->[1]->getFont;
(title => $title,
titlefont => $titlefont,
class => undef,
titleclass => 'ltx_runin'); },
beforeDigestEnd => sub {
my $qed = PopValue('QED@stack');
($qed ? Digest($qed) : ()); }
);
if (LookupValue('2.09_COMPATIBILITY')) {
# \def\tiny{\Tiny}
# \def\defaultfont{\normalfont}
# \def\rom{\textup}
# Strangely, we need to undefine these... ?
# [well, don't even let them to \relax, then!]
## Let('\proof','\relax');
## Let('\endproof','\relax');
# {pf} & {pf&} env's are already defined in ams_support
}
else {
Let('\proof', '\@proof');
Let('\endproof', '\end@proof');
Let('\begin{proof}', '\begin{@proof}');
Let('\end{proof}', '\end{@proof}'); }
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# from older versions of amsthm.sty
DefPrimitive('\theorembodyfont{}', sub { AssignValue('\thm@bodyfont' => $_[1]); });
DefPrimitive('\theoremheaderfont{}', sub { AssignValue('\thm@headfont' => $_[1]); });
DefMacro('\theorempreskipamount', '');
DefMacro('\theorempostskipamount', '');
1;
|