The note field is, in biblatex, a "literal field", which is "printed as is". You can style the whole field with \DeclareFieldFormat, but you can't (normally) operate on elements within the field.
Here's a basic solution.
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@preamble{ "\providecommand{\mystring}[2]{#1 and #2}" }
@article{author1:2015,
author={author1 and author2},
title={Something good},
journal={A very good journal},
year=2015,
month=jun,
volume=26,
pages={20--30},
number=6,
issn={1111-1111},
orignote={Published online in December 2013},
note={Published online in \mystring{Dec.}{2013}},
}
\end{filecontents}
\usepackage[T1]{fontenc}
\usepackage[backend=bibtex,style=ieee]{biblatex}
\addbibresource{biblio.bib}
% \newcommand\mystring[2]{Actually do #2 and #1}
\begin{document}
From a very good journal~\cite{author1:2015}.
\printbibliography
\end{document}
The \providecommand
provides a command if nothing is defined, so you can use \newcommand
in the preamble as needed (it will be seen first).
The point of this solution is that you could provide
a list of commands for each month in your .bib
file with a basic format, and then redefine them in individual .tex
files when you want. Not pretty, really, but using the note
field in this way doesn't align (in my opinion) with best practices to begin with. (And everyone knows that two hacks make it a-right.)
I believe a \DeclareSourcemap
solution is feasible, but I don't have time these days to get one up and running. If no one else does so, I may try to revisit this answer (late) next month. Note that this would require using Biber instead of BibTeX.
note
field is, inbiblatex
, a "literal field", which is "printed as is". You can style the whole field with\DeclareFieldFormat
, but you can't (normally) operate on elements within the field. Withbackend=biber
, however, you can fiddle with things on the fly using regexp. Might be easier to just fix the field yourself, though.backend
is not a problem. So I can usebackend=biber
. The thing is, when you change style, you must come and change the fieldnote
also. Which is not good. That is why I wanted some automatic method.@preamble{ "\providecommand{\mystring}[2]{#1 and #2}" }
and thennote={Published online in \mystring{Dec.}{2013}},
..? (Modify as needed --- e.g., set up something for months with\ifcase
.)biblio.bib
?.tex
file a\newcommand\mystring[2]{Actually do #2 and #1}
and redefine it as necessary. Very portable. Or, like I said, you could use the powers of Biber to change the actual input.