Some recent changes to biblatex-chem
broke this answer. The solution provided was also incomplete. Here is an update.
Select bibliographic data can be suppressed in the citation output using the \AtEveryCitekey
hook and the \clearfield
, \clearname
, \clearlist
commands. This approach is flexible and should be robust to package updates. It also saves you from having to edit lengthy bibliography drivers.
DOIs and URLs can easily be embedded into titles by redefining the title
bibliography macro. chem-acs
includes a period when printing titles, which causes some odd punctuation in citations. To avoid this, I've redefined the title format and threw a period in the title
macro to delimit article and journal titles. This approach will likely have to be updated with subsequent versions of biblatex-chem
.
As with the answer linked by the OP, use of vanilla footnotes remains a problem. Here I've defined a new footnote command that uses roman marks to avoid interfering with the citation footnotes. One refinement would be to order the footnotes in a more readable manner. This is topic is covered in another question.
Note that babel french
redefines the appearance of footnotes. Changing this will require edits to \@makefntextFB
, not \@makefntext
.
\documentclass{scrbook}
\usepackage[french]{babel}
\usepackage[colorlinks=true]{hyperref}
\usepackage[style=chem-acs,hyperref=true,babel=hyphen]{biblatex}
\usepackage{filecontents}
\ExecuteBibliographyOptions{%
citetracker=true,sorting=none,alldates=long,dateabbrev=false,%
articletitle=true,maxcitenames=1}
% No brackets around the number of each bibliography entry
\DeclareFieldFormat{labelnumberwidth}{#1\addperiod}
% Suppress article title, doi, url, etc. in citations
\AtEveryCitekey{%
\ifentrytype{article}
{\clearfield{title}}
{}%
\clearfield{doi}%
\clearfield{url}%
\clearlist{publisher}%
\clearlist{location}%
\clearfield{note}}
% Print year instead of date, when available; make use of urldate
\DeclareFieldFormat{urldate}{\bibstring{urlseen}\space#1}
\renewbibmacro*{date}{% Based on date bib macro from chem-acs.bbx
\iffieldundef{year}
{\ifentrytype{online}
{\printtext[urldate]{\printurldate}}
{\printtext[date]{\printdate}}}
{\printfield[date]{year}}}
% Remove period from titles
\DeclareFieldFormat*{title}{#1}
% Embed doi and url in titles, when available
\renewbibmacro*{title}{% Based on title bib macro from biblatex.def
\ifboolexpr{ test {\iffieldundef{title}}
and test {\iffieldundef{subtitle}} }
{}
{\ifboolexpr{ test {\ifhyperref}
and not test {\iffieldundef{doi}} }
{\href{http://dx.doi.org/\thefield{doi}}
{\printtext[title]{%
\printfield[titlecase]{title}%
\setunit{\subtitlepunct}%
\printfield[titlecase]{subtitle}}}}
{\ifboolexpr{ test {\ifhyperref}
and not test {\iffieldundef{url}} }
{\href{\thefield{url}}
{\printtext[title]{%
\printfield[titlecase]{title}%
\setunit{\subtitlepunct}%
\printfield[titlecase]{subtitle}}}}
{\printtext[title]{%
\printfield[titlecase]{title}%
\setunit{\subtitlepunct}%
\printfield[titlecase]{subtitle}}}}%
\newunit}%
\printfield{titleaddon}%
\clearfield{doi}%
\clearfield{url}%
\ifentrytype{article}% Delimit article and journal titles with a period
{\adddot}
{}}
%---------------------------------------------------------------
% Essentially verbatim from Joseph Wright
% http://www.texdev.net/2010/03/08/biblatex-numbered-citations-as-footnotes/
\makeatletter
\DeclareCiteCommand{\sfcite}[\cbx@superscript]%
{\usebibmacro{cite:init}%
\let\multicitedelim=\supercitedelim
\iffieldundef{prenote}
{}
{\BibliographyWarning{Ignoring prenote argument}}%
\iffieldundef{postnote}
{}
{\BibliographyWarning{Ignoring postnote argument}}}
{\usebibmacro{citeindex}%
\usebibmacro{sfcite}%
\usebibmacro{cite:comp}}
{}
{\usebibmacro{cite:dump}}
\newbibmacro*{sfcite}{%
\ifciteseen
{}
{\xappto\cbx@citehook{%
\noexpand\footnotetext[\thefield{labelnumber}]{%
\fullcite{\thefield{entrykey}}\addperiod}}}}
\newrobustcmd{\cbx@superscript}[1]{%
\mkbibsuperscript{#1}%
\cbx@citehook%
\global\let\cbx@citehook=\empty}
\let\cbx@citehook=\empty
\makeatother
%---------------------------------------------------------------
\long\def\vfootnote#1{%
\begingroup%
\def\thefootnote{\roman{footnote}}\footnote{#1}%
\endgroup}
\begin{filecontents}{\jobname.bib}
@article{ref1,
hyphenation = {american},
title = {Natural Products as Sources of New Drugs over the Last 25 Years},
author = {Newman, D.J. and Cragg, G.M.},
journal = {J. of Nat. Prod.},
volume = {70},
number = {3},
pages = {461--477},
year = {2007},
doi = {10.1021/np068054v}}
@article{ref2,
hyphenation = {american},
title = {Natural products as leads to potential drugs:
{An} old process or the new hope for drug discovery?},
author = {Newman, D.J.},
journal = {J. of Med. Chem.},
volume = {51},
number = {9},
pages = {2589--2599},
year = {2008}}
@online{ref3,
author = {Quintin, C.},
title = {Les eponges},
url = {http://christophe.quintin.pagesperso-orange.fr/Liste_Doc.html},
urldate = {2009-05-03}}
@article{ref4,
hyphenation = {american},
author = {Lewis, Frederick D and Zuo, Xiaobing},
doi = {10.1021/ja035066j},
issn = {0002-7863},
journal = {J. Am. Chem. Soc.},
month = jul,
number = {29},
pages = {8806--13},
pmid = {12862475},
title = {Activated decay pathways for planar vs twisted singlet phenylalkenes},
url = {http://www.ncbi.nlm.nih.gov/pubmed/12862475},
volume = {125},
year = {2003}}
@Book{Armarego2003,
hyphenation = {british},
title = {Purification of Laboratory Chemicals},
publisher = {Butterworth--Heine\-mann},
year = {2003},
author = {Armarego, W. L. F. and Chai, Christina Lin Li},
location = {London},
edition = {5}}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\chapter{Title}
\null\vfill\noindent
Vanilla footnote.\vfootnote{Vanilla footnote text.}
First citation.\sfcite[cf.][461]{ref1}
Vanilla footnote.\vfootnote{Vanilla footnote text.}
First citation.\sfcite[e.g.][2589]{ref2}
First ``multi'' citation.\sfcite{ref3,Armarego2003}
\chapter{Title}
\null\vfill\noindent
Second citation.\sfcite{ref2}
Second citation.\sfcite{ref3}
Vanilla footnote.\vfootnote{Vanilla footnote text.}
Second citation.\sfcite{ref1}
First citation.\sfcite{ref4}
\printbibliography
\end{document}
Output for the first chapter:
The second:
And the bibliography:
I would prefer another solution:
\makeatletter
%Works without the last bracket ;-)
\let\abx@macro@citeOrig\abx@macro@cite
\renewbibmacro{cite}{%
\bibhyperref{%
\let\bibhyperref\relax\relax%
\abx@macro@citeOrig%
}%
}
\let\abx@macro@textciteOrig\abx@macro@textcite
\renewbibmacro{textcite}{%
\bibhyperref{%
\let\bibhyperref\relax\relax%
\abx@macro@textciteOrig%
}%
}%
\makeatother
You can use it for every cite-command.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[style=authoryear-comp,backend=biber,hyperref]{biblatex}
\usepackage[colorlinks]{hyperref}
\bibliography{biblatex-examples}
\makeatletter
%Works without the last bracket ;-)
\let\abx@macro@citeOrig\abx@macro@cite
\renewbibmacro{cite}{%
\bibhyperref{%
\let\bibhyperref\relax\relax%
\abx@macro@citeOrig%
}%
}
\let\abx@macro@textciteOrig\abx@macro@textcite
\renewbibmacro{textcite}{%
\bibhyperref{%
\let\bibhyperref\relax\relax%
\abx@macro@textciteOrig%
}%
}%
\makeatother
\begin{document}
A reference to \parencite{kastenholz,sigfridsson} and~\cite{sigfridsson}.
\printbibliography
\end{document}
EDIT:
I change the code of the example above.
\makeatletter
\patchcmd{\blx@citeprint}%
{\blx@loopcode}%
{\blx@imc@bibhyperlink{#1}{\blx@loopcode}}%
{}{}
\makeatother
The problem: The last bracket isn't part of the link.
Best Answer
I've found a way (thanks to Mr. Lehman!)
As
\href
changes the formatting, it's best to use it inside abiblatex
formatting primitive, so it will get handled consistently. The code isOf course, one should add some logic (
\iffieldundef{doi}
,\ifhyperref
); I only decided to keep the example simple.