File: theorem.sty.ltxml

package info (click to toggle)
latexml 0.8.7-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 29,128 kB
  • sloc: xml: 98,982; perl: 29,706; sh: 179; javascript: 28; makefile: 15
file content (61 lines) | stat: -rw-r--r-- 2,702 bytes parent folder | download | duplicates (2)
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
# -*- mode: Perl -*-
# /=====================================================================\ #
# |  theorem                                                            | #
# | 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;

#**********************************************************************
# \newtheorem in LaTeX.pool
# This is close enough to amsthm to just use it.
RequirePackage('amsthm');
# However, theorem.sty's styles do NOT record the headfont!
setSavableTheoremParameters(qw(
    \thm@bodyfont \thm@headpunct
    \thm@styling \thm@headstyling thm@swap));

# And headpunct defaults to none.
DefRegister('\thm@headpunct' => Tokens());

DefMacro('\FMithmInfo', '');

DefMacro('\theoremheaderfont{}', sub {
    AssignValue('\thm@headfont' => $_[1]);
    AssignValue('\thm@notefont' => $_[1]); });

# \th@plain defined in LaTeX.pool, but amsthm redefines to add .
DefPrimitive('\lx@theorem@newtheoremstyle{}{}{}{}', sub {
    my ($stomach, $name, $bodyfont, $headstyle, $swap) = @_;
    $name = ToString($name);
    saveTheoremStyle($name,
      '\thm@bodyfont'    => $bodyfont,
      '\thm@headstyling' => $headstyle,
      'thm@swap'         => ToString($swap) eq 'S',
    );
    DefMacroI(T_CS('\th@' . $name), undef, sub { useTheoremStyle($name); });
    return; });

RawTeX(<<'EoTeX');
\lx@theorem@newtheoremstyle{plain}{\itshape}{\lx@makerunin}{N}
\lx@theorem@newtheoremstyle{break}{\slshape}{}{N}
\lx@theorem@newtheoremstyle{change}{\slshape}{\lx@makerunin}{S}
\lx@theorem@newtheoremstyle{margin}{\slshape}{\lx@makerunin\lx@makeoutdent}{S}
\lx@theorem@newtheoremstyle{marginbreak}{\slshape}{\lx@makeoutdent}{S}
\lx@theorem@newtheoremstyle{changebreak}{\slshape}{}{S}
% Redefine so we get correct parameters recorded
\lx@theorem@newtheoremstyle{definition}{}{\lx@makerunin}{\normalfont}%{}{\bfseries}{.}{}{}
\lx@theorem@newtheoremstyle{remark}{}{}{\normalfont}%{}{\itshape}{.}{}{}
\th@plain
EoTeX
#**********************************************************************
1;