Having spent many hours poring over examples and documentation, I have finally got my references almost up to what I require (yay!). There are still a few bits that I cannot manage, and I'm hoping that you titans of TeX will be able to assist! :) At the bottom I've given a 'minimal' working example... but it's not that short, so I'm going to try to summarise some of the issues here. Mostly it boils down to desiring if/then statements. Possibly I need to use xifthen? (I'm using DeclareBibliographyDriver.)
(1) Some of my items have volume and issue numbers. In this case, I'd like to write these as "Volume.Issue", eg 3.2. I've done this using \printfield{volume}\addperiod\printfield{number}. This is fine when there is a volume and issue number, but when there isn't it prints a fullstop (.), which I don't want. So I'd like to say
\printfield{volume}
if {'number' exists (as a field)} then {\addperiod\printfield{number}}
Similarly, I'd like to print the page numbers in brackets, eg (112--114). Again, I can use \printtext[parens]{\printfield{pages}}, but when there aren't any page numbers this just gives an empty pair of brackets, (), which I don't want. So I'd like to say
if {'pages' exists} then {\printtext[parens]{\printfield{pages}}}
I appreciate that the usual thing is not to have two questions in the same post, but given how similar these are, and that they should (hopefully) be able to both be answered together, I felt it was best to put them like this.
I now give a MWE, and a snapshot of the output.
\documentclass[]{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{FR:giant-mixing,
title = {The Evolution of the Mixing Rate of a Simple Random Walk on the Giant Component of a Random Graph},
volume = {33},
number = {1},
journaltitle = {Random Structures \& Algorithms},
urldate = {2018-03-22},
date = {2008-05-12},
pages = {68-86},
author = {Fountoulakis, Nikolaos and Reed, Bruce A.}
}
@article{AGHH:dynamic-cm,
archivePrefix = {arXiv},
eprinttype = {arxiv},
eprint = {1606.07639},
title = {Mixing Times of Random Walks on Dynamic Configuration Models},
date = {2016-06-24},
author = {Avena, Luca and G{\"u}lda{\c s}, Hakan and van der Hofstad, Remco and den Hollander, Frank},
options = {useprefix=true}
}
\end{filecontents}
\usepackage{csquotes}
\usepackage[hyperref=true,backend=biber,style=numeric]{biblatex}
\addbibresource{\jobname.bib}
\DeclareFieldFormat
[article,book]
{volume}{\textbf{#1}}
\DeclareFieldFormat
{pages}{#1}
\DeclareBibliographyDriver{article}{%
\printnames{author}%
\ \newblock
\printtext[parens]{\printfield{year}}\addperiod%
\newunit
\printfield{title}
\newunit\newblock
\printfield{journaltitle}%
\printfield{eprint}%\addperiod%
\ \newblock
\printfield{volume}\addperiod\printfield{number}%
\ \newblock
\printtext[parens]{\printfield{pages}}%
}
\begin{document}
Document...
\nocite{*}
\printbibliography
\end{document}

\in the code are copy-and-paste artefacts and not intended, is that correct? – moewe May 09 '18 at 15:18\iffieldundefto test for empty fields (and equivalent for lists and names). But, in your case, it seems the punctuation tracker may do the job with\printfield{volume}\setunit*{\adddot}\printfield{number}(untested). – gusbrs May 09 '18 at 15:19pagesfield, I'd say a formating directive would probably be the more adequate. – gusbrs May 09 '18 at 15:23.at the end of the first reference. \ What is a formatting directive? =P – Sam OT May 09 '18 at 15:24\DeclareFieldFormat(and equivalents). That should spare you the conditional and would be more in line with good practice, I think. (Rather than hard code it in your bibdriver). – gusbrs May 09 '18 at 15:26\setunitonly does anything if the last\printactually prints something. So, if no volume, no dot. :) – gusbrs May 09 '18 at 15:27\DeclareFieldFormat{pages}{#1}with\DeclareFieldFormat{pages}{(#1)}, and that is working fine! :) – Sam OT May 09 '18 at 15:30biblatex. – moewe May 09 '18 at 15:48