DOKK / manpages / debian 12 / libbibtex-parser-perl / BibTeX::Parser::Entry.3pm.en
BibTeX::Parser::Entry(3pm) User Contributed Perl Documentation BibTeX::Parser::Entry(3pm)

BibTeX::Parser::Entry - Contains a single entry of a BibTeX document.

This class ist a wrapper for a single BibTeX entry. It is usually created by a BibTeX::Parser.

    use BibTeX::Parser::Entry;
    my $entry = BibTeX::Parser::Entry->new($type, $key, $parse_ok, \%fields);
    
    if ($entry->parse_ok) {
            my $type    = $entry->type;
            my $key     = $enty->key;
            print $entry->field("title");
            my @authors = $entry->author;
            my @editors = $entry->editor;
            ...
            print $entry->to_string;
    }

Create new entry.

If the entry was correctly parsed, this method returns a true value, false otherwise.

Return the error message, if the entry could not be parsed or undef otherwise.

Get or set the type of the entry, eg. 'ARTICLE' or 'BOOK'. Return value is always uppercase.

Get or set the reference key of the entry.

Get or set the contents of a field. The first parameter is the name of the field, the second (optional) value is the new value.

Retrieve the contents of a field in a format that is cleaned of TeX markup.

Get an array of BibTeX::Parser::Author objects for the authors of this entry. Each name has been cleaned of accents and braces.

Get an array of BibTeX::Parser::Author objects for the editors of this entry. Each name has been cleaned of accents and braces.

Get or set the authors. Returns an array of BibTeX::Author objects. The parameters can either be BibTeX::Author objects or strings.

Note: You can also change the authors with $entry->field('author', $authors_string)

Get or set the editors. Returns an array of BibTeX::Author objects. The parameters can either be BibTeX::Author objects or strings.

Note: You can also change the authors with $entry->field('editor', $editors_string)

Returns a list of all the fields used in this entry.

Returns a true value if this entry has a value for $fieldname.

Return the text in BibTeX file before the entry

Return raw BibTeX entry (if available).

Returns a text of the BibTeX entry in BibTeX format. Options are a hash.

"canonize_names"
If true (the default), authors' and editors' names are translated into canonical bibtex form. The command "$entry->to_string(canonize_names=>0)" overrides this behavior.
"field_capitalization"
Capitalization of the field names. Can take values 'Uppercase', 'Lowercase' (the default) or 'Titlecase'
"print_pre"
False by default. If true, the text in the Bib file before the entry is printed. Note that at present we assume the text before the entry NEVER has the @ symbol inside
"type_capitalization"
Capitalization of the type names. Can take values 'Uppercase' (the default), 'Lowercase' or 'Titlecase'

version 1.02

Gerhard Gossen <gerhard.gossen@googlemail.com> and Boris Veytsman <boris@varphi.com>

This software is copyright (c) 2013-2016 by Gerhard Gossen and Boris Veytsman

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2021-12-11 perl v5.32.1