# Change position of year field in authoryear biblatex-style

I'm supposed to adapt this bibliography style for the japanese JSME-Journal.

I already patched the authoryear style quite a bit, but two things I can't get right:

1. Place the (year) always in front of , pp. or the publisher, in case all that is not available just at the end
2. What is the easiest way to get the first letter of vol. and no. uppercase?

Any ideas?

That's how far I got:

\documentclass{article}
\usepackage{filecontents}

\RequirePackage[
natbib,
style=authoryear,
maxnames = 99,
maxcitenames = 1,
uniquelist=false,
url=false,
isbn=false,
sorting=nyt,
abbreviate=true,
firstinits=true,
backend=biber,
bibencoding=utf8,
]{biblatex}

\renewcommand*{\finentrypunct}{}

\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\printfield{number}%
\printfield{eid}%
}

\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\iffieldundef{series}
{}
{\newunit
\printfield{series}%
\usebibmacro{volume+number+eid}%
\usebibmacro{issue+date}%
\usebibmacro{issue}%
\newunit}

\DeclareFieldFormat*{title}{#1}
\DeclareFieldFormat*{subtitle}{#1}
\DeclareFieldFormat*{booktitle}{#1}
\DeclareFieldFormat*{booksubtitle}{#1}
\DeclareFieldFormat*{journaltitle}{#1}
\DeclareFieldFormat[periodical]{issuetitle}{#1}
\DeclareFieldFormat*{maintitle}{#1}

\renewcommand*{\labelalphaothers}{}
\renewcommand*{\intitlepunct}{}
\DefineBibliographyStrings{german}{in={}}
\DefineBibliographyStrings{english}{in={}}

\begin{filecontents*}{\jobname.bib}
@ARTICLE{Sun,
author={Yanhua Sun and Yick-Sing Ho and Lie Yu},
journal={IEEE Transactions on Magnetics},
title={Dynamic Stiffnesses of Active Magnetic Thrust Bearing Including Eddy-Current Effects},
year={2009},
month={Jan},
volume={45},
number={1},
pages={42-142},
}
@book{Moon,
title={Field Theory Handbook},
author={Moon, P. and Spencer, D.E.},
year={1961},
location={Berlin, Heidelberg},
publisher={Springer}
}
@InProceedings{Kucera,
author    = {Kucera, Ladislav and Ahrens, Markus},
title     = {A Model for Axial Magnetic Bearings Including Eddy Currents},
booktitle = {Third International Symposium on Magnetic Suspension Technology},
year      = {1996},
volume    = {45},
number    = {2},
month     = {Jul},
pages     = {421-437},
}
\end{filecontents*}

\bibliography{\jobname.bib}
\begin{document}
\cite{Sun,Moon,Kucera}
\printbibliography
\end{document}


• Maybe use bibstyle=authortitle and citestyle=authoryear. We will still need to change stuff, but the base fits better. – moewe Jul 12 '17 at 7:11
• Of course you know that, but it is always better to ask only one question per question. I know an answer for point 2, but at the moment I'd feel stupid writing an answer when I can't cover point 1. – moewe Jul 12 '17 at 7:12
• @moewe, sorry for that, I thought as it deals with one particular style - it would better fit in one question. But yes you're right. – thewaywewalk Jul 12 '17 at 8:01
• @moewe If you prefer, I split it up – thewaywewalk Jul 12 '17 at 8:04
• It's too late now ;-). But for future questions you might want to keep that in mind. Even though it makes sense for you to ask these two questions at once because they belong to the same style, that does not help those trying to answer (if the only know a partial answer) nor those that seek help (if they have to find out which part of the answer addresses which question). – moewe Jul 12 '17 at 8:07

You can use bibstyle=authortitle and citestyle=authoryear as basis. Then the year is already near the back.

Then use

\renewbibmacro*{in:}{}

\newbibmacro*{pubinstorg+location+date}[1]{%
\usebibmacro{date}%
\newunit
\printfield{chapter}%
\setunit{\bibpagespunct}%
\printfield{pages}%
\newunit\newblock
\printlist{#1}%
\newunit}

\renewbibmacro*{organization+location+date}{\usebibmacro{pubinstorg+location+date}{organization}}
\renewbibmacro*{institution+location+date}{\usebibmacro{pubinstorg+location+date}{institution}}
\renewbibmacro*{publisher+location+date}{\usebibmacro{pubinstorg+location+date}{publisher}}

\renewbibmacro*{chapter+pages}{}


and

\renewbibmacro*{date}{\printtext[parens]{\printdate}}
\renewbibmacro*{issue+date}{%
\printtext[parens]{%
\printfield{issue}%
\printdate}%
\newunit}


For the capitalisation of volume and number, go with

\DeclareFieldFormat*{number}{\bibsentence\bibstring{number}\addnbspace#1}


Full MWE

\documentclass{article}
\usepackage{filecontents}

\RequirePackage[
natbib,
citestyle=authoryear,
bibstyle=authortitle,
sorting=nyt,
maxnames = 99,
maxcitenames = 1,
uniquelist=false,
uniquename=false,
url=false,
isbn=false,
abbreviate=true,
giveninits=true,
backend=biber,
]{biblatex}

\renewcommand*{\finallistdelim}{\multinamedelim}
\renewcommand*{\labelnamepunct}{\newunitpunct}
\renewcommand*{\finentrypunct}{}

\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\printfield{number}%
\printfield{eid}%
}

\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\iffieldundef{series}
{}
{\newunit
\printfield{series}%
\usebibmacro{volume+number+eid}%
\usebibmacro{issue+date}%
\usebibmacro{issue}%
\newunit}

\DeclareFieldFormat*{title}{#1}
\DeclareFieldFormat*{subtitle}{#1}
\DeclareFieldFormat*{booktitle}{#1}
\DeclareFieldFormat*{booksubtitle}{#1}
\DeclareFieldFormat*{journaltitle}{#1}
\DeclareFieldFormat[periodical]{issuetitle}{#1}
\DeclareFieldFormat*{maintitle}{#1}

\renewcommand*{\labelalphaothers}{}
\renewcommand*{\intitlepunct}{}

\renewbibmacro*{in:}{}

\newbibmacro*{pubinstorg+location+date}[1]{%
\usebibmacro{date}%
\newunit
\printfield{chapter}%
\setunit{\bibpagespunct}%
\printfield{pages}%
\newunit\newblock
\printlist{#1}%
\newunit}

\renewbibmacro*{organization+location+date}{\usebibmacro{pubinstorg+location+date}{organization}}
\renewbibmacro*{institution+location+date}{\usebibmacro{pubinstorg+location+date}{institution}}
\renewbibmacro*{publisher+location+date}{\usebibmacro{pubinstorg+location+date}{publisher}}

\renewbibmacro*{chapter+pages}{}

\renewbibmacro*{date}{\printtext[parens]{\printdate}}
\renewbibmacro*{issue+date}{%
\printtext[parens]{%
\printfield{issue}%
\printdate}%
\newunit}

\begin{filecontents*}{\jobname.bib}
@ARTICLE{Sun,
author={Yanhua Sun and Yick-Sing Ho and Lie Yu},
journal={IEEE Transactions on Magnetics},
title={Dynamic Stiffnesses of Active Magnetic Thrust Bearing Including Eddy-Current Effects},
year={2009},
month={Jan},
volume={45},
number={1},
pages={42-142},
}
@book{Moon,
title={Field Theory Handbook},
author={Moon, P. and Spencer, D.E.},
year={1961},
location={Berlin, Heidelberg},
publisher={Springer}
}
\end{filecontents*}

\begin{document}
\cite{Sun,Moon}
\printbibliography
\end{document}


Note how there is no need for

\DefineBibliographyStrings{german}{in={}}
\DefineBibliographyStrings{english}{in={}}


any more.

• Thanks for that fast and complete answer- But there is one detail, which confuses me. I added another reference and with this one No. disappears and the pages appear two times. I guess it comes from \newbibmacro*{pubinstorg+location+date} but I don't know how to avoid that. Any idea? – thewaywewalk Jul 12 '17 at 8:04
• @thewaywewalk Check the edit, please. – moewe Jul 12 '17 at 8:05
• Now the inproceedings works, but the No. and Vol. of the article disappeared. – thewaywewalk Jul 12 '17 at 8:10
• @thewaywewalk Oh, I was missing a few stars, should be fixed now. – moewe Jul 12 '17 at 8:13