LaTeX::ToUnicode - Convert LaTeX commands to Unicode
version 0.03
use LaTeX::ToUnicode qw( convert ); convert( '{\"a}' ) eq 'ä'; # true convert( '"a', german => 1 ) eq 'ä'; # true, `german' package syntax convert( '"a', ) eq '"a'; # not enabled by default
This module provides a method to convert LaTeX-style markups for accents etc. into their Unicode equivalents. It translates commands for special characters or accents into their Unicode equivalents and removes formatting commands.
I use this module to convert values from BibTeX files into plain text, if your use case is different, YMMV.
In contrast to TeX::Encode, this module does not create HTML of any kind.
Convert the text in $string that contains LaTeX into a plain(er) Unicode string. All escape sequences for special characters (e.g. \i, \"a, ...) are converted, formatting commands (e.g. {\it ...}) are removed.
$string
%options allows you to enable additional translations. This values are recognized:
%options
german
If true, the commands introduced by the package `german' (e.g. "a eq ä, note the missing backslash) are also handled.
"a
ä
Gerhard Gossen <gerhard.gossen@googlemail.com>
This software is copyright (c) 2010 by Gerhard Gossen.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install LaTeX::ToUnicode, copy and paste the appropriate command in to your terminal.
cpanm
cpanm LaTeX::ToUnicode
CPAN shell
perl -MCPAN -e shell install LaTeX::ToUnicode
For more information on module installation, please visit the detailed CPAN module installation guide.