This file is indexed.

/usr/share/perl5/LaTeXML/Package/verbatim.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
# -*- mode: Perl -*-
# /=====================================================================\ #
# |  verbatim                                                           | #
# | 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;

#======================================================================
# Note that we CAN process the verbatim.sty file and that works,
# although the xml it generates is pretty pointless
### InputDefinitions('verbatim', type => 'sty', noltxml => 1);
#======================================================================
# Thus, we set out to define the essentials, but keep as close
# to verbatim's internals as we can

# Since LaTeX.pool has already defined {verbatim} as an environment,
# (so that \begin{verbatim} takes precedence over \verbatim!)
# we have to be more forceful so that \verbatim & \endverbatim
# are even seen!
$STATE->assignMeaning(T_CS('\begin{verbatim}'),  undef);
$STATE->assignMeaning(T_CS('\begin{verbatim*}'), undef);
$STATE->assignMeaning(T_CS('\end{verbatim}'),    undef);
$STATE->assignMeaning(T_CS('\end{verbatim*}'),   undef);

DefRegister('\every@verbatim' => Tokens());
DefRegister('\verbatim@line'  => Tokens());

#======================================================================
# Mostly simplified versions of what's in verbatim....
DefMacro('\verbatim@startline',   '\verbatim@line{}');
DefMacro('\verbatim@addtoline{}', '\verbatim@line\expandafter{\the\verbatim@line#1}');
DefMacro('\verbatim@processline', '\the\verbatim@line\par');

DefMacro('\verbatim@font', '\normalfont\ttfamily\hyphenchar\font\m@ne\@noligs');

DefMacro('\@verbatim',
  '\the\every@verbatim'
    . '\obeylines'
    . '\let\do\@makeother \dospecials'
    . '\verbatim@font');

DefConstructor('\lx@verbatim@',
  "<ltx:verbatim font='#font'>",
  beforeDigest => sub { Let('\par', T_CR); },
  beforeConstruct => sub { $_[0]->maybeCloseElement('ltx:p'); });

# We HAVE to get this guy in, to close the <ltx:verbatim>"
DefConstructor('\lx@end@verbatim@{}',
  "</ltx:verbatim>");

DefMacroI('\verbatim', undef,
  '\begingroup\@verbatim\frenchspacing\@vobeyspaces\verbatim@start');
DefMacroI('\verbatim*', undef,
  '\begingroup\@verbatim\verbatim@start');
DefMacroI('\endverbatim',  undef, '\lx@end@verbatim@\endgroup');
DefMacroI('\endverbatim*', undef, '\lx@end@verbatim@\endgroup');

DefMacroI('\comment', undef,
  '\let\do\@makeother\dospecials\catcode`\^^M\active'
    . '\let\verbatim@startline\relax'
    . '\let\verbatim@addtoline\@gobble'
    . '\let\verbatim@processline\relax'
    . '\verbatim@');
DefMacroI('\endcomment', undef, '');

DefMacro('\verbatim@start', '\lx@verbatim@\verbatim@');

#======================================================================
# Here's the interesting bit.
# Why do things the hard way, when we can pull lines out of the Mouth
# and match them as text ?
# Well, we have to dance a bit...

# NOTE: the part AFTER the \end{whatever}, should be lost (and message about it!)
DefMacro('\verbatim@', sub {
    my ($gullet) = @_;
    my $mouth    = $gullet->getMouth;
    my $env      = LookupValue('current_environment');
    # Note: This should allow a regexp, since there can be spaces between \end and { !!!
    my @lines = ();
    while (defined(my $line = $gullet->readRawLine)) {
      if ($line =~ /^(.*)\\end\s*\{\Q$env\E\}(.*)$/) {
        push(@lines, $1);
        Info('unexpected', 'stuff', $gullet, "Characters dropped after '\\end{$env}'") if $2;
        last; }
      else {
        push(@lines, $line); } }
    pop(@lines) if $lines[-1] eq '';
    my @tokens = ();
    foreach my $line (@lines) {
      push(@tokens,
        T_CS('\verbatim@startline'),
        Invocation(T_CS('\verbatim@addtoline'), Tokens(ExplodeText($line))),
        T_CS('\verbatim@processline')); }
    (@tokens, Invocation(T_CS('\end'), $env)); });

#======================================================================
# Read verbatim material from file.
DefMacro('\verbatiminput {}', sub {
    my ($gullet, $file) = @_;
    my $path = FindFile($file);
    $gullet->readingFromMouth(LaTeXML::Core::Mouth->create(ToString($path)), sub {
        my ($igullet) = @_;
        my @tokens;
        while (defined(my $line = $igullet->getMouth->readRawLine)) {
          push(@tokens,
            T_CS('\verbatim@startline'),
            Invocation(T_CS('\verbatim@addtoline'), Tokens(ExplodeText($line))),
            T_CS('\verbatim@processline')); }
        (T_CS('\begingroup'), T_CS('\@verbatim'), T_CS('\frenchspacing'), T_CS('\@vobeyspaces'),
          T_CS('\lx@verbatim@'), @tokens, T_CS('\lx@end@verbatim@'), T_CS('\endgroup')); }); });

#======================================================================
# Getting verbatim text into arguments
DefPrimitive('\newverbtext DefToken', sub {
    my ($stomach, $cs) = @_;
    my $mouth = $stomach->getGullet->getMouth;
    my ($init, $body);
    StartSemiverbatim();
    AssignCatcode('\\', CC_OTHER);
    AssignCatcode('{',  CC_OTHER);
    AssignCatcode('}',  CC_OTHER);
    $init = $mouth->readToken;
    $init = $mouth->readToken if ToString($init) eq '*';    # Should I bother handling \verb* ?

    if (!$init) {    # typically read too far, got \verb and the content is somewhere else..?
      Error('expected', 'delimiter', $stomach,
        "Verbatim argument lost", "Bindings for preceding code is probably broken");
      EndSemiverbatim();
      return (); }
    $body = $mouth->readTokens($init);

    EndSemiverbatim();
    DefMacroI($cs, undef, $body);
    return; });

#**********************************************************************
1;