# Biblatex : custom articles and books

I recently started to use Biblatex and customize it a bit with some of your answers (A lot actually !!) but I'm still struggling with some of the features I like as I, sadly, don't understand much to most of the commands...

First, I'd like to show you what I've already done because there is probably a lot to say about it!

    \usepackage[language=french,sorting=nyt, hyperref=true,urldate=long,
bibstyle=authortitle,citestyle=verbose,dateabbrev=false]{biblatex}

\setcounter{secnumdepth}{-1}
\chapter{Bibliographie thématique}
\markboth{\itshape Bibliographie thématique}{}
}

%******** Custom Bibliography *********

\makeatletter
\def\MKbibnamefirst#1{\expandafter\mkbibnamefirst@i#1..\@nil}
\def\mkbibnamefirst@i#1.#2.#3\@nil{#1}

\renewbibmacro*{name:last-first}[4]{%
\ifuseprefix
{\usebibmacro{name:delim}{#3#1}%
\usebibmacro{name:hook}{#3#1}%
\ifblank{#3}{}{%
\ifcapital
{\mkbibnameprefix{{#3}}\isdot}
{\mkbibnameprefix{#3}}%
\mkbibnamelast{#1}\isdot
{\usebibmacro{name:delim}{#1}%
\usebibmacro{name:hook}{#1}%
\mkbibnamelast{#1}\isdot
}}
\makeatother

% Commas as separators

% Comma before and after journal volume
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\printfield{number}%
\printfield{eid}}

% Prefixes for journal volume and number
\DeclareFieldFormat[article]{volume}{\bibstring{volume}~#1}% volume of a journal
\DeclareFieldFormat[article]{number}{\bibstring{number}~#1}% number of a journal

% Comma before date; date not in parentheses
\renewbibmacro*{issue+date}{%
\iffieldundef{issue}
{\usebibmacro{date}}
{\printfield{issue}%
\usebibmacro{date}}% NEW
\newunit}

% Issue/date macros removed after journal number
\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\iffieldundef{series}
{}
{\newunit
\printfield{series}%
\usebibmacro{volume+number+eid}%
\newunit}

% "In:" removed for articles; issue/date macros added after note+pages macro
\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}%
\usebibmacro{issue+date}
\usebibmacro{issue}
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{issn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\usebibmacro{finentry}}

\DeclareFieldFormat[book]{title}{\mkbibquote{\mkbibemph{#1}}}

%Switch t. to vol.
\DeclareFieldFormat[article]{volume}{vol.~#1}

%Put ibid, op cit & co in italics
\renewcommand*{\mkibid}{\emph}

%Interligne entre les items Biblio
\DeclareFieldFormat{shorthandwidth}{#1}
\setlength{\bibitemsep}{6pt}

%Change p. to pp.
\DefineBibliographyStrings{french}{%

\begin{document}
(...)
\nocite{*}
\begin{singlespace}
\hyphenpenalty 10000
\end{singlespace}
\end{document}


I'd like to modify the appearance of my articles and books :

FOR ARTICLES :
I'm getting :
LASTNAME Firstname, « Title », Journal, Vol. 10, no 3, pp. 56 – 79, month year.
And I'd like :
LASTNAME Firstname, « Title », Journal, month year, vol. 10, no 3, pp. 56 – 79.
Which means:
- Get the month year block after the journal

FOR BOOKS :
I'm getting :
LASTNAME Firstname, «Title», Address : Publisher, year, 271 p.
And I'd like :
LASTNAME Firstname, «Title», Publisher, Address, year, 271 p.
Which means:
- Get the year after the adress
- Get in order the publisher separated from the adress with a comma

I realise that it's a lot to ask!! But I couldn't get nowhere with my experimentations and I'm lacking time to do more sad failures!!

Tks very much in advance for any help, or comment on my present modifications ! ;-)

-
@Doompa: This is a big list to look at, and I won't promise anything. But one question: Why don't you choose an authortitle style instead of authoryear? –  lockstep Feb 21 '11 at 21:42
@ Lockstep : Tkx for not being scared by all those requests!! Well... I actually never really tought about it... as no style fits what I'd like... But you're right, it's better! i'm getting the year without brackets, the title in italics with books, and almost the total pages! I'm changing this right now! See how that long list of requests is now almost short?! No? –  user3743 Feb 21 '11 at 22:23
@Doompa: You should edit your question so that it reflects the "short list of requests". Besides that, please tell what \DeclareRangeCommands{\pno\ppno} does (or should do). –  lockstep Feb 21 '11 at 22:37
@ Lockstep : I've edited my question! Besides, how shameful do you think it is to have to write that I can't even remember what it was for..., but was to scared to delete it and miss it later? –  user3743 Feb 21 '11 at 23:09

This answer will be a work in progress, and it will quite possibly not cover all requests. That said, do the following:

• Delete the code line \DeclareRangeCommands{\pno\ppno};
• Add the code line \DeclareFieldFormat[book]{title}{\mkbibquote{\mkbibemph{#1}}};
• Add the package option dateabbrev=false.

One way to switch from "t." to "vol." for articles would be to choose language=english. Is that what you want? Please explain.

EDIT: For @book entries, use the pagetotal field instead of the pages field.

EDIT 2: For @book & friends, add the following to your preamble:

\renewbibmacro*{publisher+location+date}{%
\printlist{publisher}%
\printlist{location}%
\usebibmacro{date}%
\newunit}


To be consistent, you should also change the bibmacros institution+location+date and organization+location+date along these lines. (The originals are located in standard.bbx.)

EDIT 3: For @article, the following seems to work at first glance (and I didn't bother to check it thouroughly):

\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\iffieldundef{series}
{}
{\newunit
\printfield{series}%
\usebibmacro{issue+date}%
\usebibmacro{issue}%
\usebibmacro{volume+number+eid}%
\newunit}


@Doompa: That's it for now. If your style still needs finetuning, please add any requests to your original question (your edits became quite confusing for me). Also think about why you want a particular change.

-
I've adopted your modifications but couldn't comment properly as you haven't told me what it was for! I'm joking those where easy! It's definetely going in the right direction! I've edited my question. For the "t." to "vol.", it's interesting because it also get me my pages like I want them, but the change of language cause me other problems as it switch the number field in a wrong way, and also I get the months in english and need them in french! Thx for your involvement dear Lockstep! –  user3743 Feb 22 '11 at 1:42
@ Lockstep : It's perfect!!! I really want to thank you for all your efforts as I know I had a lot of requests! –  user3743 Feb 25 '11 at 23:00
@Doompa: Marking my answer as "accepted" would be a good first step. ;-) –  lockstep Feb 25 '11 at 23:12
@ Lockstep : Done! –  user3743 Feb 26 '11 at 0:06

For @ARTICLES, I found how to transform the "t." to "vol." :

\DeclareFieldFormat[article]{volume}{Vol.~#1\addcomma}


Today is my lucky day! I've just found the answer to my problem with pages : For @ARTICLES, to switch p. to pp. :

\DefineBibliographyStrings{french}{%

@Doompa: What happens if you drop \addcomma? biblatex should take care about the punctuation with macros like \newunit\newblock. –  lockstep Feb 24 '11 at 22:07