1BibTeX::Parser::Entry(3U)ser Contributed Perl DocumentatiBoinbTeX::Parser::Entry(3)
2
3
4
6 BibTeX::Parser::Entry - Contains a single entry of a BibTeX document.
7
9 This class ist a wrapper for a single BibTeX entry. It is usually
10 created by a BibTeX::Parser.
11
12 use BibTeX::Parser::Entry;
13
14 my $entry = BibTeX::Parser::Entry->new($type, $key, $parse_ok, \%fields);
15
16 if ($entry->parse_ok) {
17 my $type = $entry->type;
18 my $key = $enty->key;
19 print $entry->field("title");
20 my @authors = $entry->author;
21 my @editors = $entry->editor;
22
23 ...
24
25 print $entry->to_string;
26 }
27
29 new
30 Create new entry.
31
32 parse_ok
33 If the entry was correctly parsed, this method returns a true value,
34 false otherwise.
35
36 error
37 Return the error message, if the entry could not be parsed or undef
38 otherwise.
39
40 type
41 Get or set the type of the entry, eg. 'ARTICLE' or 'BOOK'. Return value
42 is always uppercase.
43
44 key
45 Get or set the reference key of the entry.
46
47 field($name [, $value])
48 Get or set the contents of a field. The first parameter is the name of
49 the field, the second (optional) value is the new value.
50
51 cleaned_field($name)
52 Retrieve the contents of a field in a format that is cleaned of TeX
53 markup.
54
55 cleaned_author
56 Get an array of BibTeX::Parser::Author objects for the authors of this
57 entry. Each name has been cleaned of accents and braces.
58
59 cleaned_editor
60 Get an array of BibTeX::Parser::Author objects for the editors of this
61 entry. Each name has been cleaned of accents and braces.
62
63 author([@authors])
64 Get or set the authors. Returns an array of BibTeX::Author objects. The
65 parameters can either be BibTeX::Author objects or strings.
66
67 Note: You can also change the authors with $entry->field('author',
68 $authors_string)
69
70 editor([@editors])
71 Get or set the editors. Returns an array of BibTeX::Author objects. The
72 parameters can either be BibTeX::Author objects or strings.
73
74 Note: You can also change the authors with $entry->field('editor',
75 $editors_string)
76
77 fieldlist ()
78 Returns a list of all the fields used in this entry.
79
80 has($fieldname)
81 Returns a true value if this entry has a value for $fieldname.
82
83 pre ()
84 Return the text in BibTeX file before the entry
85
86 raw_bibtex ()
87 Return raw BibTeX entry (if available).
88
89 to_string ([options])
90 Returns a text of the BibTeX entry in BibTeX format. Options are a
91 hash.
92
93 "canonize_names"
94 If true (the default), authors' and editors' names are translated
95 into canonical bibtex form. The command
96 "$entry->to_string(canonize_names=>0)" overrides this behavior.
97
98 "field_capitalization"
99 Capitalization of the field names. Can take values 'Uppercase',
100 'Lowercase' (the default) or 'Titlecase'
101
102 "print_pre"
103 False by default. If true, the text in the Bib file before the
104 entry is printed. Note that at present we assume the text before
105 the entry NEVER has the @ symbol inside
106
107 "type_capitalization"
108 Capitalization of the type names. Can take values 'Uppercase' (the
109 default), 'Lowercase' or 'Titlecase'
110
112 version 1.02
113
115 Gerhard Gossen <gerhard.gossen@googlemail.com> and Boris Veytsman
116 <boris@varphi.com>
117
119 This software is copyright (c) 2013-2016 by Gerhard Gossen and Boris
120 Veytsman
121
122 This is free software; you can redistribute it and/or modify it under
123 the same terms as the Perl 5 programming language system itself.
124
125
126
127perl v5.32.0 2020-07-28 BibTeX::Parser::Entry(3)