Package: liblatex-tom-perl
Version: 0.8-1
Severity: normal

My purpose in using LaTeX::TOM is related to how one might use detex
or untex, I am preparing LaTeX source for further processing that
relies on its input being text.  This may not be compatible with
what the author of LaTeX::TOM had in mind.

In any event, I was seeing "problems" with two things: footnotes and
inline math mode.

If a person just removes the \footnote{ and }  from the input, we are
often left with a sentence within a sentence.  For sentence oriented
processing such as diction or LanguageTool, this is a problem.  After
trying a few approaches, what seems to work for me is to split the
LaTeX source file on \footnote.  With the exception of the first
element of that list, each element now starts with an opening
brace, the contents of the footnote, and the closing brace.  I remove
the footnote with Text::Balanced, and then look for the end of sentence
(currently just a period).  I then insert the footnote text after that
period.  However, this basically shuffles text around so that sentence
oriented processing still sort of makes sense.

In the situation of inline math mode, in general I don't think it is easy
to find a text approximation of what is in math mode.  What I did instead
was insert some obscure pattern for the math mode.  The code snippet
below would allow a person to put the original math mode content back
if this was needed.

      while( 1 ) {
          if( $text =~ /$RE{delimited}{-delim=>'$'}{-keep}/ ) {
              my $match = $1;
              push @inline, $match;
              $match = quotemeta( $match );
              $text =~ s/$match/InLiNeMaThMoDe($#inline)/;
          } else {
              last;
          }
      }

Perhaps this note is of interest?  These two things seem to be needed
for sentence oriented work with LaTeX source files.  I don't know
that they would be needed for any other purposes.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.23 (SMP w/2 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages liblatex-tom-perl depends on:
ii  perl                         5.10.0-11.1 Larry Wall's Practical Extraction 

liblatex-tom-perl recommends no packages.

liblatex-tom-perl suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to