In a previous topic (Biblatex authoryear in brackets and with parenthesis around the year), it has been asked how to put the year in brackets when using authoryear
citation in biblatex
. When I apply the solution to my code, I get no space between each label and the next
One way to solve this is to modify the code in the previous question to include ;<space>
after the command \usebibmacro{cite:shorthand}}
(see the original question). This pretty much solves it
One last thing that I need is to remove the last delimiter because it should not be there since it is attached to the last label.
\begin{filecontents*}{sample.bib}
@ARTICLE{wu2017,
title={{Assessing Impact of Renewable Energy Integration on System Strength Using Site-Dependent Short Circuit Ratio}},
author={Wu, Di and Li, Gangan and Javadi, Milad and Malyscheff, Alexander M and Hong, Mingguo and Jiang, John Ning},
journal={IEEE Transactions on Sustainable Energy},
year={2017},
publisher={IEEE}
}
@article{wu2019method,
title={A method to identify weak points of interconnection of renewable energy resources},
author={Wu, Di and Aldaoudeyeh, Al~Motasem and Javadi, Milad and Ma, Feng and Tan, Jin and Jiang, John N and others},
journal={International Journal of Electrical Power \& Energy Systems},
volume={110},
pages={72--82},
year={2019},
publisher={Elsevier}
}
@INPROCEEDINGS{zhu2015,
author={Y. Zhu and D. Brown},
booktitle={2015 IEEE Power Energy Society General Meeting},
title={{Prepare to meet the challenges in regional transmission planning and development}},
year={2015},
volume={},
number={},
pages={1-5},
keywords={hydroelectric power;investment;power grids;power transmission economics;power transmission planning;power transmission reliability;regional planning;wind power;economical benefit analysis;federal right of first refusal removal;hydro power export;regional cost allocation;regional transmission development;regional transmission planning;system reliability enhancement;transmission investment;weak grid;wind energy delivery;wind energy energy export;Economics;HVDC transmission;Planning;Reactive power;Reliability;Voltage control;Wind farms;Competition;Economic Analysis;FERC Order 1000;Project Screening;Project Selection;ROFR;Regional Transmission Planning;Reliability Analysis;Renewable Energy;Transfer Limit;Weak Grid},
doi={10.1109/PESGM.2015.7286306},
ISSN={1932-5517},
month={July},
}
@inproceedings{lorenzen2016,
title={{Control of a grid connected converter during weak grid conditions}},
author={Lorenzen, S{\o}ren Lund and Nielsen, Alex Buus and Bede, Lorand},
booktitle={Power Electronics for Distributed Generation Systems (PEDG), 2016 IEEE 7th International Symposium on},
pages={1--6},
year={2016},
organization={IEEE}
}
@inproceedings{manjure2001,
title={{Steady state stability assessment using the bus impedance matrix}},
author={Manjure, DP and Makram, EB},
booktitle={Power Engineering, 2001. LESCOPE'01. 2001 Large Engineering Systems Conference on},
pages={153--157},
year={2001},
organization={IEEE}
}
\end{filecontents*}
\documentclass{book}
\usepackage[x11names]{xcolor}
\usepackage{hyperref}
\hypersetup{citecolor=DodgerBlue3, citebordercolor=DodgerBlue3, colorlinks=true}
\usepackage[style=authoryear-comp]{biblatex}
\addbibresource{sample.bib}
\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}
\renewbibmacro*{cite}{%
\iffieldundef{shorthand}
{\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
{\usebibmacro{cite:label}%
\setunit{\addspace}}
{\printnames{labelname}%
\setunit{\nameyeardelim}}%
% \usebibmacro{cite:labelyear+extrayear}}% DELETED
\printtext[parens]{\usebibmacro{cite:labelyear+extrayear}}}% ADDED
{\usebibmacro{cite:shorthand}}}
\makeatother
\begin{document}
\cite{wu2017,wu2019method}
\cite{zhu2015,lorenzen2016,manjure2001}
\printbibliography
\end{document}