# Adjusting biblatex authoryear style (to closely resemble apalike)

After reading yet another few hours I could not find a solution to obtaining the following citation style:

[Senarclens de Grancy and Reimann 2014]

together with the following format in the bibliography

[Senarclens de Grancy and Reimann, 2014] Senarclens de Grancy, G. and Reimann,
M.: "Vehicle routing problems with time windows and multiple service workers: a systematic comparison between ACO and GRASP"; Central European Journal of Operations Research 123, 1-20

Please note the square brackets in both the citation and bibliograpy. A bonus would be the colon followed by the title in quotation marks in the bibliography. Ideally, I'd like to stick with adjusting biblatex' authoryear style, however the closest I got to the above was using regular bibtex with \bibliographystyle{apalike}. A good hint was Biblatex, author-year, square brackets, but I couldn't manage to obtain the remaining adjustments. Any help is appreciated.

EDIT: As requested, here is a screenshot of how the bibliography should be rendered.

EDIT2: A code snippet I'm currently struggling w/ (copied together a few examples that' I honestly don't really understand)

\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\usepackage{filecontents}

\makeatletter

\newrobustcmd*{\parentexttrack}[1]{%
\begingroup
\blx@blxinit
\blx@setsfcodes
\blx@bibopenparen#1\blx@bibcloseparen
\endgroup}

\AtEveryCite{%
\let\parentext=\parentexttrack%
\let\bibopenparen=\bibopenbracket%
\let\bibcloseparen=\bibclosebracket}

\def\act@on@bibmacro#1#2{%
\expandafter#1\csname abx@macro@\detokenize{#2}\endcsname
}
\def\patchbibmacro{\act@on@bibmacro\patchcmd}
\def\pretobibmacro{\act@on@bibmacro\pretocmd}
\def\apptobibmacro{\act@on@bibmacro\apptocmd}
\def\showbibmacro{\act@on@bibmacro\show}

\makeatother

\begin{filecontents}{\jobname.bib}
@Article{ SenarclensAndReimann:2014,
author={{Senarclens~{d}e~Grancy}, Gerald and Reimann, Marc},
title={Vehicle routing problems with time windows and multiple service
workers:   a systematic comparison between ACO and GRASP},
issn={1435-246X},
year={2014},
journal={Central European Journal of Operations Research},
publisher={Springer Berlin Heidelberg},
doi={10.1007/s10100-014-0341-z},
pages={1-20}
}
\end{filecontents}

\begin{document}
\textcite{SenarclensAndReimann:2014} \\
\parencite{SenarclensAndReimann:2014} \\
\autocite{SenarclensAndReimann:2014} \\
\printbibliography
\end{document}

• Please see Biblatex, author-year, square brackets, Adding an AuthorYear block at the beginning of bibliography entries and squared bracketed citation in references list for starters. Furthermore, \renewcommand*{\subtitlepunct}{\addcolon\space} might be for you. – moewe Oct 10 '14 at 19:41
• @moewe: thanks for your comments; I've added a picture; Most important is to have square brackets in both the citation and bibliography surrounding the whole citation part. Separating the authors and the title with a colon and surrounding the title with quotation marks would just be a plus (considering other papers submitted at the journal I'm trying to fit the style to). – Gerald Senarclens de Grancy Oct 10 '14 at 19:43
• Well, if you submit to a journal, you should check if they have .bst styles available for you to use, submitting biblatex can be quite a pain and might not be appreciated by all journals. I had initially misunderstood your request about the colon, it is \renewcommand*{\labelnamepunct}{\addcolon\space}, of course. The quotation marks can be achieved for all entry types (not sure if that's what you want) with \DeclareFieldFormat*{title}{\mkbibquote{#1\isdot}} – moewe Oct 10 '14 at 19:49
• @moewe: thanks again; I'm using the .sty file provided by the journal. Unfortnately, all templates they provide contain manual \bibitem definitions at the end (no bibtex at all) and that's what I'm trying to avoid. I may have to end up copying the generated bibitems to the final submission if the journal's build process doesn't allow otherwise, but it would be fantastic to have these items generated from the bib database I usually use. – Gerald Senarclens de Grancy Oct 10 '14 at 19:55
• @YanKingYin: just checked the paper I wrote at that time. Looks like I resorted to using \bibliographystyle{apalike} and removed biblatex from that paper. Sorry I don't have better news. Good luck! – Gerald Senarclens de Grancy Nov 28 '17 at 10:54

The part of the citations is working with your code. The part of bibliography is possible modifying the macros of the style.

a. The bibliography style authortitle is more similar to the style in the question that the authoryear. The it is suggested to use bibstyle=authortitle in the load of biblatex.

b. The example only use the initial of firstnames, then it is necessary to use firstinits=true

c. The style bibliography needs print all auhtor. This is possible using maxbibnames=99. (The name between brackets is treated below).

d. The first part in a bibliography item is the a "label" formed by the names of authors. The names are truncated if the number of author is greater to 2. Then is possible redefine the begentry macro. I.e

\renewbibmacro*{begentry}{%
\mkbibbrackets{% Print between brackets
% Fist author only, if num. of authors is greater to 2.
\printnames[][1-\ifnumgreater{\value{labelname}}{2}{1}{\value{maxnames}}]{labelname}
\space\printfield{year}}\space%
}


e. The @article entry don't use the word in: between title and journal. Then the in: macro is redefined to:

\newbibmacro*{in:}{}


f. The journal title is not emphasized. Then the journaltitle format is redefined to:

\DeclareFieldFormat{journaltitle}{{#1}}


g. The page part do not use the abbreviation of page word, then the formats of pages and pagetotal are redefined to:

\DeclareFieldFormat{pages}{{#1}}
\DeclareFieldFormat{pagetotal}{{#1}}


h. Finally, the sorting of author names is 'lastname'-'firstname' then are defined the format of author, editor and translator in the same form of the format last-first.

\DeclareNameAlias{author}{last-first}
\DeclareNameAlias{editor}{last-first}
\DeclareNameAlias{translator}{last-first}


The above 'code' do not reproduce all entries in the image in the questions, because is very difficult guess the style rules view only the picture. But is a answer to how add the brackets part in the bibliography and how edit a default style. I tried to reproduce the '[Hicks et al. 1998]' and [[Senarclens de Grancy and Reimann, 2014] citations. In the last I do not understand what is '123'. This part is not in the bibentry of the MWE.

MWE:

\documentclass{article}
\usepackage[style=authoryear, maxbibnames=99, bibstyle=authortitle, firstinits=true,doi=false]{biblatex}
\usepackage{filecontents}

\makeatletter

\newrobustcmd*{\parentexttrack}[1]{%
\begingroup
\blx@blxinit
\blx@setsfcodes
\blx@bibopenparen#1\blx@bibcloseparen
\endgroup}

\AtEveryCite{%
\let\parentext=\parentexttrack%
\let\bibopenparen=\bibopenbracket%
\let\bibcloseparen=\bibclosebracket}

\def\patchbibmacro{\act@on@bibmacro\patchcmd}
\def\pretobibmacro{\act@on@bibmacro\pretocmd}
\def\apptobibmacro{\act@on@bibmacro\apptocmd}
\def\showbibmacro{\act@on@bibmacro\show}

\makeatother

\renewbibmacro*{begentry}{%
\mkbibbrackets{%
\printnames[][1-\ifnumgreater{\value{labelname}}{2}{1}{\value{maxnames}}]{labelname}%
\space\printfield{year}}\space%
}

\newbibmacro*{in:}{}

\DeclareFieldFormat{journaltitle}{{#1}}

\DeclareFieldFormat{pages}{{#1}}
\DeclareFieldFormat{pagetotal}{{#1}}

\DeclareNameAlias{author}{last-first}
\DeclareNameAlias{editor}{last-first}
\DeclareNameAlias{translator}{last-first}

\begin{filecontents}{\jobname.bib}
@Article{ SenarclensAndReimann:2014,
author={{Senarclens~{d}e~Grancy}, Gerald and Reimann, Marc},
title={Vehicle routing problems with time windows and multiple service
workers:   a systematic comparison between ACO and GRASP},
issn={1435-246X},
year={2014},
journal={Central European Journal of Operations Research},
publisher={Springer Berlin Heidelberg},
doi={10.1007/s10100-014-0341-z},
pages={1-20},
}

@Article{othercite,
author={Hicks, D. and Leggett, J. and N{\"u}rnberg, P. and Schnase, J.},
title={A hypermedia version control framework},
number={2},
year={1998},
month={4},
journal={ACM Trans. Inf. Sys.},
publisher={Springer},
volume={16},
pages={127-160},
}

\end{filecontents}

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

\begin{document}
\textcite{SenarclensAndReimann:2014} \\
\parencite{SenarclensAndReimann:2014} \\
\autocite{SenarclensAndReimann:2014} \\

\cite{othercite}
\printbibliography
\end{document}


A image:

• thanks for the attempt. When I run the MWE you provided via pdflatex->bibtex->pdflatex I get '''I found no \citation commands---while reading file temp.aux ...''' and when using biber instead (adding backend=biber to the biblatex import) the resulting references lack the names of the authors in the square brackets. Any misconfiguration I have to take care of? Again, thanks for your help. – Gerald Senarclens de Grancy Oct 15 '14 at 17:18
• My .bib` file seems to have some entries without year, so it gives an error while running the above code. – Yan King Yin Nov 27 '17 at 5:53