# Custom biblatex style for articles

I have to use a quite unique citation style for my dissertation and have therefore strated to customize a biblatex.cfg file. I use verbose style as a base and came quite far already with other items, however, articles still pose a problem. Articles have to be cited in the following format:

author, title, journalshort year, firstpage (pageref).

In consequent citations the title is dropped. If journalshort is not available, then I have to use journaltitle

For now I have the following biblatex.cfg:

 % -- comma between bibliography units

% -- No prefix for pages
\DeclareFieldFormat{pages}{#1}
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}

% -- No italic titles
\DeclareFieldFormat{title}{#1}
\DeclareFieldFormat{booktitle}{#1}
\DeclareFieldFormat{citetitle}{#1}
\DeclareFieldFormat{journaltitle}{#1}

% -- No "'" for title
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{citetitle}{#1}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{#1}

% -- Authors and editors in italic and only show surname
\DeclareNameFormat{family}{\mkbibemph{%
\usebibmacro{name:family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}%
\usebibmacro{name:andothers}}
\DeclareNameAlias{default}{family}
\DeclareNameAlias{sortname}{default}
\DeclareNameAlias{labelname}{default}

% -- "/" between names but "," and "and" in textcite
\DeclareDelimFormat{multinamedelim}{\slash}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}

\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}%
\setunit{\printdelim{nametitledelim}}\newblock
\usebibmacro{maintitle+title}%
\iffieldundef{shortjournal}{\iffieldundef{journaltitle}{}{\printtext[journaltitle]{\printfield{journaltitle}}}}{\printtext[journaltitle]{\printfield[titlecase]{shortjournal}}}%
\printfield{year}%
\mkfirstpage{\printfield{pages}}%
\parentext{\usebibmacro{pageref}}%
\newunit\newblock
\iftoggle{bbx:related}{\usebibmacro{related:init}%
\usebibmacro{related}}{}%
\usebibmacro{finentry}}


Using this example:

\documentclass{article}
\usepackage[backend=biber, style=verbose]{biblatex}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{citation,
title = {Short title: Long title},
shorttitle = {Short title},
author = {Doe, John},
date = {1995},
journaltitle = {Journal Title},
shortjournal = {JT},
pages = {120--130}
}
\end{filecontents}

\begin{document}

\cite[125]{citation}

\cite[127]{citation}

\printbibliography

\end{document}


I get:

Doe, Short title: Long title, JT 1995(), 125

Doe, Short title, 127

References

Doe, Short title: Long title, JT 1995120–130().

But I would need:

Doe, Short title: Long title, JT 1995, 120 (125).

Doe, JT 1995, 120 (128).

References

Doe, Short title: Long title, JT 1995, 120.

1. How can I show the first page of the article appears on? I cannot seem to show \mkfirstpage{\printfield{pages}}.
2. How can I put pageref in parenthesis?
3. How can I drop the title in subsequent citations?
• I had just started looking at your earlier, now deleted question. Is the code any different? (I've already made some modifications and would like to avoid having to go through them again if it can be helped.) Note that it is usually better to ask about separate issues in separate questions, since that makes the question easier to answer and more helpful for other people (tex.meta.stackexchange.com/q/7425/35864). – moewe Jan 6 at 15:22
• The code is the same but I explained a bit more. – philipp_th Jan 6 at 16:17

1. \mkfirstpage{\printfield{pages}} won't work as expected. You need to use \mkfirstpage in \DeclareFieldFormat, because it expects simple text and not a complex macro as input. (Plus it is always recommended to use formatting commands only in \DeclareFieldFormat and not directly in bibmacros or drivers. Using macros around \printfield can have other unintended consequences especially if the field happens to be empty.) So you want

\DeclareFieldFormat[article]{pages}{\mkfirstpage{#1}}

2. The pageref macro does not format the page number you pass to your \cite command. That page number is formatted by postnote. pageref is used for back-references. You need to modify the postnote field format and probably want to leave pageref alone.

3. This is trickier. Printing the journal name in subsequent short citations, but not the title obviously only makes sense for @article entries and not for other types, so you need type-specific short citations. This can be implemented as shown in Customize verbose citation style, Custom type disappears in subsequent citations and Make style=verbose's short citations for @online more verbose.

In total you could try something like this

\documentclass{article}
\usepackage[backend=biber, style=verbose]{biblatex}

\renewcommand*{\mkbibnamefamily}{\mkbibemph}

\DeclareNameFormat{family}{%
\usebibmacro{name:family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}%
\usebibmacro{name:andothers}}

\DeclareNameAlias{default}{family}
\DeclareNameAlias{sortname}{default}
\DeclareNameAlias{labelname}{default}

\DeclareDelimFormat{multinamedelim}{\slash}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}

\DeclareFieldFormat{title}{#1}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{#1}
\DeclareFieldFormat{booktitle}{#1}
\DeclareFieldFormat{citetitle}{#1}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{citetitle}{#1}
\DeclareFieldFormat{journaltitle}{#1}

\DeclareFieldFormat{pages}{#1}
\DeclareFieldFormat[article]{pages}{\mkfirstpage{#1}}
\DeclareFieldFormat{postnote}{\mknormrange{#1}}
\DeclareFieldFormat[article]{postnote}{%
\ifpages{#1}
{\mkbibparens{\mknormrange{#1}}}
{\mknormrange{#1}}}
\DeclareFieldFormat{multipostnote}{#1}

\DeclareDelimFormat{postnotedelim}{%
\ifboolexpr{
test {\ifentrytype{article}}
and test {\iffieldpages{postnote}}}
}

\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}%
\setunit{\printdelim{nametitledelim}}\newblock
\usebibmacro{maintitle+title}%
\iffieldundef{shortjournal}
{\printfield{journaltitle}}
{\printtext[journaltitle]{%
\printfield[titlecase]{shortjournal}}}%
\printdate
\setunit{\bibpagespunct}%
\printfield{pages}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}

\renewbibmacro*{cite:short}{%
\ifbibmacroundef{cite:short:@\strfield{entrytype}}
{\usebibmacro{cite:short:standard}}
{\usebibmacro*{cite:short:@\strfield{entrytype}}}}

\newbibmacro*{cite:short:standard}{%
\printnames{labelname}%
\setunit*{\printdelim{nametitledelim}}%
\printfield[citetitle]{labeltitle}}}

\newbibmacro*{cite:short:@article}{%
\printnames{labelname}%
\setunit*{\printdelim{nametitledelim}}%
\iffieldundef{shortjournal}
{\printfield{journaltitle}}
{\printtext[journaltitle]{%
\printfield[titlecase]{shortjournal}}}%
\printdate
\setunit{\bibpagespunct}%
\printfield{pages}}}

\begin{filecontents}{\jobname.bib}
@article{citation,
author       = {Doe, John},
title        = {Short title},
subtitle     = {Long title},
date         = {1995},
journaltitle = {Journal Title},
shortjournal = {JT},
pages        = {120--130},
}
\end{filecontents}