1TeX::Encode::BibTeX(3)User Contributed Perl DocumentationTeX::Encode::BibTeX(3)
2
3
4

NAME

6       TeX::Encode::BibTeX - Encode/decode Perl utf-8 strings into BibTeX
7

SYNOPSIS

9         use TeX::Encode;
10         use Encode;
11
12         $tex = encode('bibtex', "This will encode an e-acute (".chr(0xe9).") as \'e");
13         $str = decode('bibtex', $tex); # Will decode the \'e too!
14

DESCRIPTION

16       This module provides encoding to LaTeX escapes from utf8 using mapping
17       tables in Pod::LaTeX and HTML::Entities. This covers only a subset of
18       the Unicode character table (undef warnings will occur for non-mapped
19       chars). This module is intentionally vague about what it will handle,
20       see Caveats below.
21
22       Mileage will vary when decoding (converting TeX to utf8), as TeX is in
23       essence a programming language, and this module does not implement TeX.
24
25       I use this module to encode author names in BibTeX and to do a rough
26       job at presenting LaTeX abstracts in HTML. Using decode rather than
27       seeing $\sqrt{\Omega^2\zeta_n}$ you get something that looks like the
28       formula.
29
30       The next logical step for this module is to integrate some level of TeX
31       grammar to improve the decoding, in particular to handle fractions and
32       font changes (which should probably be dropped).
33

METHODS

35       TeX::Encode::BibTeX::encode STRING [, CHECK]
36           Encodes a utf8 string into TeX. CHECK isn't implemented.
37
38       TeX::Encode::BibTeX::encode_url STRING
39           Make a URL safe for inclusion in BibTeX.
40
41       TeX::Encode::BibTeX::decode STRING [, CHECK]
42           Decodes a TeX string into utf8. CHECK isn't implemented.
43
44       TeX::Encode::perlio_ok
45           Returns 0. PerlIO isn't implemented.
46

CAVEATS

48       Proper Encode checking is not implemented.
49
50       LaTeX comments (% ...) are ignored because chopping a lot of text may
51       not be what you actually want.
52
53   encode()
54       Converts non-ASCII Unicode characters to their equivalent TeX symbols
55       (unTeXable characters will result in undef warnings).
56
57   decode()
58       Attempts to convert TeX symbols (e.g. \ae) to Unicode characters. As an
59       experimental feature this also handles Math-mode TeX by inserting HTML
60       into the resulting string (so you end up with an HTML approximation of
61       the maths - NOT MathML).
62

SEE ALSO

64       Encode::Encoding, Pod::LaTeX, Encode
65

AUTHOR

67       Timothy D Brody, <tdb01r@ecs.soton.ac.uk>
68
70       Copyright (C) 2005-2007 by Timothy D Brody
71
72       This library is free software; you can redistribute it and/or modify it
73       under the same terms as Perl itself, either Perl version 5.8.7 or, at
74       your option, any later version of Perl 5 you may have available.
75
76
77
78perl v5.30.0                      2019-07-26            TeX::Encode::BibTeX(3)
Impressum