1LaTeX::ToUnicode(3) User Contributed Perl Documentation LaTeX::ToUnicode(3)
2
3
4
6 LaTeX::ToUnicode - Convert LaTeX commands to Unicode
7
9 version 0.11
10
12 use LaTeX::ToUnicode qw( convert );
13
14 convert( '{\"a}' ) eq 'ä'; # true
15 convert( '"a', german => 1 ) eq 'ä'; # true, `german' package syntax
16 convert( '"a', ) eq '"a'; # not enabled by default
17
18 # more generally:
19 my $latexstr;
20 my $unistr = convert($latexstr);
21
23 This module provides a method to convert LaTeX-style markups for
24 accents etc. into their Unicode equivalents. It translates commands
25 for special characters or accents into their Unicode equivalents and
26 removes formatting commands. It is not at all bulletproof or complete.
27
28 This module converts values from BibTeX files into plain text. If your
29 use case is different, YMMV.
30
31 In contrast to TeX::Encode, this module does not create HTML of any
32 kind, including for HTML/XML metacharacters such as <, >, "&", which
33 can appear literally in the output. Entities are other handling for
34 these has to happen at another level, if need be.
35
37 convert( $latex_string, %options )
38 Convert the text in $string that contains LaTeX into a plain(er)
39 Unicode string. All escape sequences for accented and special
40 characters (e.g., \i, \"a, ...) are converted. Basic formatting
41 commands (e.g. {\it ...}) are removed.
42
43 %options allows you to enable additional translations. These keys are
44 recognized:
45
46 "german"
47 If this option is set, the commands introduced by the package
48 `german' (e.g. ""a" eq "ä", note the missing backslash) are also
49 handled.
50
52 Gerhard Gossen <gerhard.gossen@googlemail.com> and Boris Veytsman
53 <boris@varphi.com> <https://github.com/borisveytsman/bibtexperllibs>
54
56 This software is copyright (c) 2010-2020 by Gerhard Gossen and Boris
57 Veytsman
58
59 This is free software; you can redistribute it and/or modify it under
60 the same terms as the Perl 5 programming language system itself.
61
62
63
64perl v5.32.1 2021-01-27 LaTeX::ToUnicode(3)