Is there a 'biblatex
in a nutshell' guide out there?
I'd like if someone explained to me the essentials on how to use biblatex
(what lines I have to write in my document, which files I have to have, how many times and what I have to compile), so then I can go to http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf to customise it further.
[Tex/LaTex] biblatex in a nutshell (for beginners)
biblatex
Related Solutions
AUCTeX has nothing to do with this. The problem is that \addbibresource
has been added to biblatex from version 1.2, which is not in TeX Live 2009.
The best is to upgrade by downloading MacTeX 2010 from http://tug.org/mactex and running TeX Live Manager to get an up-to-date distribution (I assume you are on Mac OS X from the
% biblatex-examples.bib is located in ~/Library/texmf/bibtex/bib/
line).
There is NO CSE Name-Year biblatex
style package yet. But I am trying to work on it. Pardon me for the ugly code. If you have some suggestions, please tell me so that I can learn from you, or better yet, improve the code yourself.
I have several hesitations in answering this question since it happens to be too broad. Perhaps that is partly because this being my first question, I did not know how to ask. I have borrowed answers from several posts, notably:
- Guidelines for customizing biblatex styles
- Biblatex: changing the order of entries
- \DeclareNameAlias{sortname}{last-first} does not sort the name of editor
- biblatex conditional for printing an extradate
- biblatex: remove commas between last and first names in bibliography
And here is the biblatex.cfg
file.
\ProvidesFile{biblatex.cfg}
\DefineBibliographyStrings{english}{%
references = {Cited References}, % Use "Cited References" as bibliography heading
january = {Jan}, % Change how the names of months appear
february = {Feb},
march = {Mar},
april = {Apr},
may = {May},
june = {Jun},
july = {Jul},
august = {Aug},
september = {Sep},
october = {Oct},
november = {Nov},
december = {Dec}
}
\ExecuteBibliographyOptions{
firstinits=true,
isbn=true,
dashed=false,
eprint=true,
maxbibnames=99,
alldates=long,
doi=true,
uniquename=init
}
% ... and remove italization of titles
\renewcommand{\bibinitperiod}{}
\renewcommand{\bibinitdelim}{}
\renewcommand{\finalnamedelim}{, }
\renewcommand*{\revsdnamepunct}{}
% Remove quotation marks around journal titles etc.
\DeclareFieldFormat
[article,inbook,incollection,inproceedings,patent,thesis,unpublished]
{title}{#1\isdot}
% Print last name first before first name
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{default}{last-first} % changes that of the editor and others
%\DeclareNameAlias{editorname}{last-first}
\DeclareNameAlias{editora}{editor}
\DeclareNameAlias{editorb}{editor}
\DeclareNameAlias{editorc}{editor}
% ... and remove italization of titles
\DeclareFieldFormat{journaltitle}{#1}
\DeclareFieldFormat{maintitle}{#1}
\DeclareFieldFormat{sorttitle}{#1}
\DeclareFieldFormat{title}{#1}
\DeclareFieldFormat{booktitle}{#1}
\DeclareFieldFormat{issuetitle}{#1}
\DeclareFieldFormat{pages}{#1}% no prefix for the `pages` field in the bibliography
% Make all titles except for journal title and journalsubtitle Sentence case
\DeclareFieldFormat{titlecase}{\MakeTitleCase{#1}}
\newrobustcmd{\MakeTitleCase}[1]{%
\ifthenelse{%
\ifcurrentfield{booktitle}\OR\ifcurrentfield{booksubtitle}%
\OR\ifcurrentfield{maintitle}\OR\ifcurrentfield{mainsubtitle}%
\OR\ifcurrentfield{journaltitle}\OR\ifcurrentfield{journalsubtitle}%
%\OR\ifcurrentfield{issuetitle}\OR\ifcurrentfield{issuesubtitle}%
%\OR\ifentrytype{book}\OR\ifentrytype{mvbook}\OR\ifentrytype{bookinbook}%
%\OR\ifentrytype{booklet}\OR\ifentrytype{suppbook}%
%\OR\ifentrytype{collection}\OR\ifentrytype{mvcollection}%
%\OR\ifentrytype{suppcollection}\OR\ifentrytype{manual}%
%\OR\ifentrytype{periodical}\OR\ifentrytype{suppperiodical}%
%\OR\ifentrytype{proceedings}\OR\ifentrytype{mvproceedings}%
%\OR\ifentrytype{reference}\OR\ifentrytype{mvreference}%
%\OR\ifentrytype{report}\OR\ifentrytype{thesis}
}
{#1}
{\MakeSentenceCase{#1}
}}
% Remove parentheses around dates
\renewbibmacro*{date+extrayear}{%
\iffieldundef{year}
{}
{\printtext{%
\addperiod\space\printfield{labelyear}%
\printfield{extrayear}}}}
\NewBibliographyString{available}
\NewBibliographyString{cited}
\DefineBibliographyStrings{english}{%
available = {Available from},
}
% Redefined url+urldate macro
\DeclareFieldFormat{url}{\bibstring{available}\addcolon\space\url{#1}}
\DeclareFieldFormat{urldate}{#1}
\DeclareFieldFormat{urlday}{#1}
\renewbibmacro*{url+urldate}{%
\iffieldundef{urlyear}
{}
% {\setunit*{\addspace}%
% }
{\printtext{[}%
\iffieldundef{urlupyear}
{}
{\printtext{updated}\space\printfield{urlupyear}
\mkbibmonth{\thefield{urlupmonth}}
\stripzeros{\thefield{urlupday}}\addsemicolon\space
}%
\printtext{cited}\space%
\printfield{urlyear}
\mkbibmonth{\thefield{urlmonth}}
\stripzeros{\thefield{urlday}}%
\printtext{].}\space%
\printfield{url}%
}
}
% Add another bibtex entry for medium designator in online titles
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=medium, fieldtarget=usera]
\step[fieldsource=urlupdate, fieldtarget=extradate]
}
}
}
% This is a problematic part
\renewbibmacro*{title}{%
\ifboolexpr{
test {\iffieldundef{title}}
and
test {\iffieldundef{subtitle}}
}
{}
{\printtext[title]{%
\printfield[sentencecase]{title}%
\setunit{\subtitlepunct}%
\printfield[sentencecase]{subtitle}
\setunit{}%
\iffieldundef{usera}
{}
{\printtext{[}\printfield{usera}\printtext{]}}}%
\newunit}%
\printfield{titleaddon}}
\DeclareBibliographyDriver{online}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{bytranslator+others}%
\newunit\newblock
\printfield{version}%
\newunit\newblock
\usebibmacro{publisher+location+date}
\addsemicolon
\newunit\newblock
\usebibmacro{url+urldate}
\usebibmacro{finentry}}
% Driver for article
% Order of fields for article
\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{bytranslator+others}%
\newunit\newblock
\printfield{version}%
\newunit\newblock
\usebibmacro{journal+issuetitle}%
\newunit
\usebibmacro{byeditor+others}%
\newunit
\usebibmacro{note+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{issn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\usebibmacro{related}%
\usebibmacro{finentry}}
% cbx part
\renewcommand*{\nameyeardelim}{\addspace}
\endinput
There is also a biblatex-dm.cfg
file:
\DeclareDatamodelFields[type=field, datatype=date, skipout]{urlupdate}
\DeclareDatamodelFields[type=field, datatype=integer]{
urlupday,
urlupendday,
urlupendmonth,
urlupendyear,
urlupmonth,
urlupyear}
\DeclareDatamodelEntryfields{
urlupdate,
urlupday,
urlupendday,
urlupendmonth,
urlupendyear,
urlupmonth,
urlupyear}
\endinput
Now, I know that this answer complicates things since this question requires that the answer duplicates other answers in the site. However, I believe that prospective users of this style can benefit directly by copying the above codes and modifying at their will. And so I am also making this answer CW.
I have discussed this answer with Joseph Wright at chat some time ago and I am currently working to make this into a biblatex
style package.
Best Answer
A minimal document for
biblatex
would bewhich requires a
<database>
file in.bib
format. You then run:Normally, you'd also select a bibliography style by loading this an an optional argument to the
biblatex
lineSee How to use biber and Biblatex with Biber: Configuring my editor to avoid undefined citations for more if your editor is not set up to offer Biber 'out of the box'.
For some time,
biblatex
has supported two 'backends' (the program that extracts references from the.bib
file), BibTeX and Biber. As of version 2, Biber is the default backend, so I have used it above. Biber is more powerful and works natively with UTF-8 input, but where it is not available one can fall back on more limited support using BibTeX. The workflow is pretty similar:and you then need to run
As you'll see, this is very little difference from using Biber: basically replace 'Biber' with 'BibTeX'.
You should use the '8-bit' version of BibTeX as a minimum, rather than the ancient 7-bit BibTeX. At the Command line, this is used by doing
where
<filename>
is the name of your LaTeX file.There is more you can do, but this should get you started.
Recent versions of
biblatex
have deprecatedin favour of the more general
The latter is more general, but you must include the file extension (usually
.bib
).