In biblatex
you unfortunately (?) cannot have two eprinttypes for the same entry, it will take some trickery to do that.
But to go only with the PMCID is a piece of cake.
Add the following lines to your preamble
\DeclareFieldFormat{eprint:pmcid}{%
PMCID\addcolon\space
\ifhyperref
{\href{http://www.ncbi.nlm.nih.gov/pmc/articles/#1}{\nolinkurl{#1}}}
{\nolinkurl{#1}}}
\DeclareFieldAlias{eprint:PMCID}{eprint:pmcid}
\DeclareFieldAlias{eprint:pmc}{eprint:pmcid}
This will tell biblatex
what to do with eprinttype = {pmcid}
s.
A sample entry looks like this
@article{ContEp,
author = {Mark G. Frei and Hitten P. Zaveri and Susan Arthurs and Gregory K. Bergey and Christophe Jouny and Klaus Lehnertz and Jean Gotman and Ivan Osorio and Theoden I. Netoff and Walter J. Freeman and John Jefferys and Gregory Worrell and Michel Le Van Quyen and Steven J. Schiff and Florian Mormannn},
title = {Controversies in epilepsy},
subtitle = {Debates held during the Fourth International Workshop on Seizure Prediction},
journaltitle = {Epilepsy \& Behavior},
volume = {19},
number = {1},
pages = {4-16},
date = {2010-09},
doi = {10.1016/j.yebeh.2010.06.009},
eprint = {PMC2943379},
eprinttype = {pmcid},
}
Note that there is no problem at all to also display DOI and URL.
\documentclass{article}
\usepackage[backend=biber, style=authoryear]{biblatex}
\usepackage{hyperref}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{ContEp,
author = {Mark G. Frei and Hitten P. Zaveri and Susan Arthurs and Gregory K. Bergey and Christophe Jouny and Klaus Lehnertz and Jean Gotman and Ivan Osorio and Theoden I. Netoff and Walter J. Freeman and John Jefferys and Gregory Worrell and Michel Le Van Quyen and Steven J. Schiff and Florian Mormannn},
title = {Controversies in epilepsy},
subtitle = {Debates held during the Fourth International Workshop on Seizure Prediction},
journaltitle = {Epilepsy \& Behavior},
volume = {19},
number = {1},
pages = {4-16},
date = {2010-09},
doi = {10.1016/j.yebeh.2010.06.009},
%eprint = {20708976},
%eprinttype = {pubmed},
eprint = {PMC2943379},
eprinttype = {pmcid},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\DeclareFieldFormat{eprint:pmcid}{%
PMCID\addcolon\space
\ifhyperref
{\href{http://www.ncbi.nlm.nih.gov/pmc/articles/#1}{\nolinkurl{#1}}}
{\nolinkurl{#1}}}
\DeclareFieldAlias{eprint:PMC}{eprint:pmcid}
\DeclareFieldAlias{eprint:PMCID}{eprint:pmcid}
\DeclareFieldAlias{eprint:pmc}{eprint:pmcid}
\begin{document}
\cite{ContEp}
\printbibliography
\end{document}
You could also set up fields for pmid
and pmcid
so they do not take up the eprint
slot and can be used side-by-side.
We will need a datamodel for that (here we use biblatex-dm.cfg
; the file should be put somewhere LaTeX can find it; in the MWE the file is automatically created via the filecontents
environment; read more about datamodel files on page 151 of the biblatex
documentation §4.5.3 Data Model Specification). You could also create a dedicated datamodel file (.dbx
) and load that, see Data model macro cannot be used in preamble, BibTeX fields for DOI, MR, Zbl and arxiv?, How can I create entirely new data types with BibLaTeX/Biber? for explanations and examples of .dbx
files.
\DeclareDatamodelFields[type=field,datatype=verbatim]{pmid}
\DeclareDatamodelEntryfields{pmid}
\DeclareDatamodelFields[type=field,datatype=verbatim]{pmcid}
\DeclareDatamodelEntryfields{pmcid}
So now we have the fields pmid
and pmcid
available for use.
We need to declare their formatting to print these fields (we just do this as we did above).
\DeclareFieldFormat{eprint:pmcid}{%
PMCID\addcolon\space
\ifhyperref
{\href{http://www.ncbi.nlm.nih.gov/pmc/articles/#1}{\nolinkurl{#1}}}
{\nolinkurl{#1}}}
\DeclareFieldAlias{eprint:PMC}{eprint:pmcid}
\DeclareFieldAlias{eprint:PMCID}{eprint:pmcid}
\DeclareFieldAlias{eprint:pmc}{eprint:pmcid}
\DeclareFieldAlias{pmcid}{eprint:pmcid}
\DeclareFieldAlias{pmid}{eprint:pubmed}
Furthermore, we need to print the fields, this is achieved by redefining the doi+eprint+url
macro.
\renewbibmacro*{doi+eprint+url}{%
\iftoggle{bbx:doi}
{\printfield{doi}}
{}%
\newunit\newblock
\printfield{pmcid}%
\newunit\newblock
\printfield{pmid}%
\newunit\newblock
\iftoggle{bbx:eprint}
{\usebibmacro{eprint}}
{}%
\newunit\newblock
\iftoggle{bbx:url}
{\usebibmacro{url+urldate}}
{}}
Note that now, the sample entry looks like this
@article{ContEp,
author = {Mark G. Frei and Hitten P. Zaveri and Susan Arthurs and Gregory K. Bergey and Christophe Jouny and Klaus Lehnertz and Jean Gotman and Ivan Osorio and Theoden I. Netoff and Walter J. Freeman and John Jefferys and Gregory Worrell and Michel Le Van Quyen and Steven J. Schiff and Florian Mormannn},
title = {Controversies in epilepsy},
subtitle = {Debates held during the Fourth International Workshop on Seizure Prediction},
journaltitle = {Epilepsy \& Behavior},
volume = {19},
number = {1},
pages = {4-16},
date = {2010-09},
doi = {10.1016/j.yebeh.2010.06.009},
pmcid = {PMC2943379},
pmid = {20708976},
}
The MWE
\documentclass{article}
\usepackage[backend=biber, style=authoryear]{biblatex}
\usepackage{hyperref}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{ContEp,
author = {Mark G. Frei and Hitten P. Zaveri and Susan Arthurs and Gregory K. Bergey and Christophe Jouny and Klaus Lehnertz and Jean Gotman and Ivan Osorio and Theoden I. Netoff and Walter J. Freeman and John Jefferys and Gregory Worrell and Michel Le Van Quyen and Steven J. Schiff and Florian Mormannn},
title = {Controversies in epilepsy},
subtitle = {Debates held during the Fourth International Workshop on Seizure Prediction},
journaltitle = {Epilepsy \& Behavior},
volume = {19},
number = {1},
pages = {4-16},
date = {2010-09},
doi = {10.1016/j.yebeh.2010.06.009},
pmcid = {PMC2943379},
pmid = {20708976},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{filecontents*}{biblatex-dm.cfg}
\DeclareDatamodelFields[type=field,datatype=verbatim]{pmid}
\DeclareDatamodelEntryfields{pmid}
\DeclareDatamodelFields[type=field,datatype=verbatim]{pmcid}
\DeclareDatamodelEntryfields{pmcid}
\end{filecontents*}
\DeclareFieldFormat{eprint:pmcid}{%
PMCID\addcolon\space
\ifhyperref
{\href{http://www.ncbi.nlm.nih.gov/pmc/articles/#1}{\nolinkurl{#1}}}
{\nolinkurl{#1}}}
\DeclareFieldAlias{eprint:PMC}{eprint:pmcid}
\DeclareFieldAlias{eprint:PMCID}{eprint:pmcid}
\DeclareFieldAlias{eprint:pmc}{eprint:pmcid}
\DeclareFieldAlias{pmcid}{eprint:pmcid}
\DeclareFieldAlias{pmid}{eprint:pubmed}
\renewbibmacro*{doi+eprint+url}{%
\iftoggle{bbx:doi}
{\printfield{doi}}
{}%
\newunit\newblock
\printfield{pmcid}%
\newunit\newblock
\printfield{pmid}%
\newunit\newblock
\iftoggle{bbx:eprint}
{\usebibmacro{eprint}}
{}%
\newunit\newblock
\iftoggle{bbx:url}
{\usebibmacro{url+urldate}}
{}}
\begin{document}
\cite{ContEp}
\printbibliography
\end{document}