Catman...BibTeX(3pm)

πŸ’– Catman...BibTeX β€” the tea β˜•

ok so bestie, you found the manual page for Catmandu::Exporter::BibTeX (that's the Catman...BibTeX(3pm) one, yep yep), and honestly? it's giving "export your data as BibTeX and look cute doing it." no cap. let's get into it πŸŽ€


✨ NAME ✨

Catmandu::Exporter::BibTeX β€” a BibTeX exporter. that's it, that's the name, she's an exporter and she's iconic for it πŸ’…


🌸 SYNOPSIS 🌸

ok so here's the vibe, literally copy-paste coded:

use Catmandu::Exporter::BibTeX;

my $exporter = Catmandu::Exporter::BibTeX->new(fix => 'myfix.txt');

$exporter->add_many($arrayref);
$exporter->add_many($iterator);
$exporter->add_many(sub { });

$exporter->add($hashref);

$exporter->add({
 type    => 'book',
 _citekey => '389-ajk0-1',
 title    => 'the Zen of {CSS} design',
 author   => ['Dave Shea','Molley E. Holzschlag'],
 isbn     => '0-321-30347-4'
});

printf "exported %d objects\n" , $exporter->count;

like, you make one, you feed her $arrayrefs or $iterators or even a sub { } (main character energy), you add a $hashref, and then you flex your count with a printf. periodt. πŸ”₯


πŸ¦‹ DESCRIPTION πŸ¦‹

ngl, the BibTeX Catmandu::Exporter wants one thing from you: a Perl hash (or a fix, if that's your thing) packed with BibTeX fields and values β€” and those values can be a string or an array reference. that's the whole assignment bestie 🫢


πŸ‘‘ SUPPORTED FIELDS πŸ‘‘

Two special fields can be set in the Perl hash, and they're the ones running the show:

  • "type" or "_type" β€” this describes the document type (article, book, ...). and if you don't say anything? it's set to 'misc' by default. she's got a fallback, she's prepared πŸ’…
  • "_citekey" or "_id" β€” this describes the citation key. if you don't hand one over, the next counter value (starting from 1) is used by default. so like, she'll number them for you, no stress πŸ“

and now the moment you've all been waiting for β€” the following BibTeX fields are supported. every other field? ignored. sorry not sorry πŸ’€

abstract
address
author
booktitle
chapter
day
edition
editor
eprint
howpublished
institution
isbn
issn
journal
keywords
language
location
month
note
number
organization
pages
publisher
school
series
title
type
url
doi
volume
year

that's the whole list, don't skip a single one, she notices ✨


🌈 SEE ALSO 🌈

wanna expand a date field with year, month, and day into the corresponding BibTeX fields? use Catmandu::Fix::expand_date. it's the glow-up your dates deserve πŸ’–


ok that's the whole page bestie, you're officially a BibTeX exporter expert, go forth and slay 🧚

and a lil sign-off for the credits stans: this page is from perl v5.36.0, dated 2023-02-02, and it lives in the Catman...BibTeX(3pm) section of the User Contributed Perl Documentation. iykyk πŸ’œ

πŸ“¦ where this page comes from