LaTeXML

 view release on metacpan or  search on metacpan

lib/LaTeXML/Package/beamer.cls.ltxml  view on Meta::CPAN

    else {
      (T_CS('\beamer@closeitem'), T_CS('\beamer@item@org')); } });
DefMacro('\beamer@item@before BeamerAngled []', sub {
    my ($stomach, $overlay, $key) = @_;
    my @return = ();
    push(@return, T_CS('\beamer@closeitem'), T_CS('\beamer@item@org'));
    push(@return, T_OTHER('['), Revert($key), T_OTHER(']')) if defined($key);
    push(@return, T_CS('\beamer@item@action'), revertBeamerAngled($overlay));
    @return; });

# Hook into all the {enumerate} {itemize} {description}

# from LaTeX.Pool
DefEnvironment('{itemize} [BeamerAngled]',
  "<ltx:itemize xml:id='#id'>#body</ltx:itemize>",
  properties      => sub { beginBeamerItemize($_[1], 'itemize', '@item'); },
  beforeDigestEnd => sub { Digest('\par'); Digest('\beamer@closeitem'); },
  locked          => 1, mode => 'text');

# from enumitem package, because of the second arg!
DefEnvironment('{enumerate} [BeamerAngled] OptionalUndigested',
  "<ltx:enumerate xml:id='#id'>#body</ltx:enumerate>",
  properties       => sub { beginBeamerItemize($_[1], 'enumerate', 'enum'); },
  beforeDigestEnd  => sub { Digest('\par'); Digest('\beamer@closeitem'); },
  afterDigestBegin => sub { setEnumerationStyle($_[1]->getArg(2)); });

# from LaTeX.Pool
DefEnvironment('{description} [BeamerAngled]',
  "<ltx:description  xml:id='#id'>#body</ltx:description>",
  beforeDigest    => sub { Let('\makelabel', '\descriptionlabel'); },
  properties      => sub { beginBeamerItemize($_[1], 'description', '@desc'); },
  beforeDigestEnd => sub { Digest('\par'); Digest('\beamer@closeitem'); },
  locked          => 1, mode => 'text');

#**********************************************************************
# beamerbasenavigation.sty
#**********************************************************************

# TODO: Implement me!

#**********************************************************************
# beamerbasentheorems.sty
#**********************************************************************

# TODO: This needs testing!

RequirePackage('amsthm');
RequirePackage('amsmath');
RequirePackage('amssymb');

DefMacro('\pushQED {}', sub { beamerTODO('pushQED'); });
DefMacro('\popQED',     sub { beamerTODO('popQED'); });
DefMacro('\qedhere',    sub { beamerTODO('qedhere'); });

RawTeX(<<'EoTeX');
% compatibility
\newcommand{\ExampleInline}[1]{\translate{Example}: \ignorespaces#1}
\newcommand{\BeispielInline}[1]{Beispiel: \ignorespaces#1}

\newtheorem{theorem}{\translate{Theorem}}
\newtheorem{corollary}[theorem]{\translate{Corollary}}
\newtheorem{fact}[theorem]{\translate{Fact}}
\newtheorem{lemma}[theorem]{\translate{Lemma}}
\newtheorem{problem}[theorem]{\translate{Problem}}
\newtheorem{solution}[theorem]{\translate{Solution}}

% \theoremstyle{definition}
\newtheorem{definition}[theorem]{\translate{Definition}}
\newtheorem{definitions}[theorem]{\translate{Definitions}}

% \theoremstyle{example}
\newtheorem{example}[theorem]{\translate{Example}}
\newtheorem{examples}[theorem]{\translate{Examples}}


% Compatibility
\newtheorem{Beispiel}[theorem]{Beispiel}
\newtheorem{Beispiele}[theorem]{Beispiele}
\theoremstyle{plain}
\newtheorem{Loesung}[theorem]{L\"osung}
\newtheorem{Satz}[theorem]{Satz}
\newtheorem{Folgerung}[theorem]{Folgerung}
\newtheorem{Fakt}[theorem]{Fakt}
\newenvironment{Beweis}{\begin{proof}[Beweis.]}{\end{proof}}
\newenvironment{Lemma}{\begin{lemma}}{\end{lemma}}
\newenvironment{Proof}{\begin{proof}}{\end{proof}}
\newenvironment{Theorem}{\begin{theorem}}{\end{theorem}}
\newenvironment{Problem}{\begin{problem}}{\end{problem}}
\newenvironment{Corollary}{\begin{corollary}}{\end{corollary}}
\newenvironment{Example}{\begin{example}}{\end{example}}
\newenvironment{Examples}{\begin{examples}}{\end{examples}}
\newenvironment{Definition}{\begin{definition}}{\end{definition}}
EoTeX

#**********************************************************************
# beamerbasethemes.sty
#**********************************************************************

# TODO: Implement me!
DefMacro('\usetheme[]{}',      sub { beamerTODO('themes'); });
DefMacro('\usecolortheme[]{}', sub { beamerTODO('themes'); });
DefMacro('\usefonttheme[]{}',  sub { beamerTODO('themes'); });
DefMacro('\useinnertheme[]{}', sub { beamerTODO('themes'); });
DefMacro('\useoutertheme[]{}', sub { beamerTODO('themes'); });

# TODO: Record this and pass this to covered stuff!
DefMacro('\setbeamercovered{}', sub { beamerTODO('setbeamercovered'); });

#**********************************************************************
# Utilities
#**********************************************************************

# promoteChildren ensures that any children of node that match selector come first in $node.
sub promoteChildren {
  my ($document, $node, $selector) = @_;
  my @elements = $document->findnodes($selector, $node);
  foreach my $element (reverse @elements) {
    $element->unbindNode;
    $node->insertBefore($element, $node->firstChild); }
  @elements; }

# T_END_ENV($env) returns tokens representing the end of an environment.
sub T_END_ENV { Tokens(T_CS('\end'), T_BEGIN, ExplodeText(@_), T_END); }

# readUntilMatch reads a (balanced) sequence of tokens until all tokens in $match are encounted in order.
# When $gullet runs out of tokens before this is the case, returns undef.
#
# TODO: Might want to move this into $gullet?
sub readUntilMatch {
  my ($gullet, $match) = @_;
  return Tokens() if IsEmpty($match);
  my ($head, @tail) = $match->unlist;
  my $tail = Tokens(@tail);
  # main loop to collect tokens
  my (@read, $token) = ();
  while (1) {
    # skip ahead until the first token; then
    $token = $gullet->readUntil($head);
    return unless defined($token);
    push(@read, $token->unlist);
    # check if we match the tail too
    # TODO: $gullet->readMatch mutates the argument, so we clone here!
    return Tokens(@read) if defined($gullet->readMatch($tail->clone));
    # we read the head, but didn't see the tail!
    push(@read, $head); } }

# readRawUntilMatch reads raw lines from $gullet until it finds a line containing exactly one of @lines.
# returns a string representing the text consumed, and the last line that matched.
sub readRawUntilMatch {



( run in 1.106 second using v1.01-cache-2.11-cpan-f56aa216473 )