LaTeX::Parser - Perl extension to parse LaTeX files
use LaTeX::Parser; my $l = new LaTeX::Parser 'file' => 'file.tex'; my $p = $l->latex; # $p now hold a reference to an array of # file.tex parsed
Or use it to break up LaTeX in a variable:
my $l = new LaTeX::Parser 'content' => '\textit{Three Lives} by Gertrude Stein.';
Contents of nested braces are extracted as a single element. Another LaTeX::Parser will have to be created to parse nested braces.
LaTeX::Parser
This is a very early version of LaTeX::Parser, there are many bugs. I think this will work fine with plain TeX files but I do not plan on ever support that.
For now, only simple descriptions of the modules functions.
Creates a LaTeX::Parser object. All values in %hash are initialize to the values in the object. The only two tested values to set are `file' and `content'. `file' is the name of the file to load the LaTeX file from, and it get copied into `content'. If content is set by then %hash then `file' will never be called.
%hash
file
content
No arguments. Actualy does all the work. Loads the LaTeX file if not content was specified, and returns a reference to all parsed information.
Many bugs i'll find soon enough. Off the top of my head, I know backslashed brackes in LaTeX are considered normal brackets. I haven't even thought about math things, and don't think I will think about that any time soon.
Sven Heinicke, <sven@zen.org>
perl(1), latex(1).
To install LaTeX::Parser, copy and paste the appropriate command in to your terminal.
cpanm
cpanm LaTeX::Parser
CPAN shell
perl -MCPAN -e shell install LaTeX::Parser
For more information on module installation, please visit the detailed CPAN module installation guide.