prsd22 has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to do group matching in latex. can anybody give me any example by using LaTeX::Tom::Node. Thanks.

Replies are listed 'Best First'.
Re: Latex::Tom::Node example
by Khen1950fx (Canon) on Dec 15, 2012 at 21:00 UTC
    And what is "group matching"? Did you mean something like this?
    #!/usr/bin/perl use strict; use autodie; use warnings; use LaTeX::TOM; use Data::Dumper::Concise; my $file = 'input.tex'; open my $fh, '<', $file; my $parser = LaTeX::TOM->new; my $tree = $parser->parseFile($file); $tree->getNodesByCondition( sub { my $node = shift; $node->getNextGroupNode; print Dumper($node); } );
Re: Latex::Tom::Node example
by CountZero (Bishop) on Dec 15, 2012 at 15:00 UTC
    I use LaTex regularly, but I have no idea what you mean by "group matching". Can you explain and perhaps give us an example?

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics