3

Is it possible to prevent citations from being shown out of the page margin?

Example:

\documentclass{article}

\usepackage[a4paper, showframe]{geometry}
\usepackage{filecontents}

\usepackage{natbib}
\bibliographystyle{abbrvnat}
\setcitestyle{authoryear}

\begin{filecontents}{bibl.bib}
  @book{book1,
    author = {Primeiro Ultimo},
    title = {Example without special characters},
    year = {2016}
  }

  @book{book2,
    author = {Primeiro \'Ultimo},
    title = {Example with accent},
    year = {2016}
  }
\end{filecontents}

\begin{document}

  bbbbbbbbbbbb bbbbbbbbbbb bbbbbbbbb bbbbbbbbb bbbbbbbbbbbb bbbbbbbbbbbbb  \cite{book1}
  % hyphenated

  bbbbbbbbbbbb bbbbbbbbbbb bbbbbbbbb bbbbbbbbb bbbbbbbbbbbb bbbbbbbbbbbbb  \cite{book2}
  % out of margin

  bbbbbbbbbbbb bbbbbbbbbbb bbbbbbbbb bbbbbbbbb bbbbbbbbbb bbbbbbbbbb \cite{book1}
  % out of margin

  bbbbbbbbbbbb bbbbbbbbbbb bbbbbbbbb bbbbbbbbb bbbbbbbbbb bbbbbbbbbb \cite{book2}
  % out of margin

  \bibliography{bibl}

\end{document}

I have tried to solve this by loading the packages breakcites and cite, but they did not help.

Thank you.

I have also asked this elsewhere, but I haven't got any answers so far.

2