2

I am using the named bibliography style with the following citation formulation provided by karlkoeller:

\makeatletter
\let\@internalcite\cite
\def\cite{\def\citeauthoryear##1##2{##1, ##2}\@internalcite}
\def\shortcite{\def\citeauthoryear##1##2{##2}\@internalcite}
\def\@biblabel#1{\def\citeauthoryear##1##2{##1, ##2}[#1]\hfill}
\makeatother

While this formulation produces the desired style, it is printing a large number of citation beyond the text width, into the margin space:

enter image description here

Is there a way to force these citations remaining within the text body?

  • 1
    You can use \sloppy, but \linebreak[3] at the front of \cite might work better. If you had provided an NWE I would run some tests. – John Kormylo Aug 28 '15 at 16:16
  • \sloppy does it, \linebreak[3] has no effect; please insert this as an answer. P.S.: You can use the MWE provided by karlkoeller to test. – Luís de Sousa Aug 29 '15 at 14:28
1

Normally, \hfil will expand as much as \parendskip, but \hfil\linebreak[3] doesn't seem to expand at all.

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Book{Batty:2007,
author    = {Michael Batty},
title     = {Cities and Complexity},
publisher = {MIT Press},
year      = 2007}
\end{filecontents*}

\makeatletter
\let\@internalcite\cite
\def\cite{\def\citeauthoryear##1##2{##1, ##2}\@internalcite}
\def\shortcite{\def\citeauthoryear##1##2{##2}\@internalcite}
\def\@biblabel#1{\def\citeauthoryear##1##2{##1, ##2}[#1]\hfill}
\makeatother

\begin{document}
\sloppy
yadayada yadayada yadayada yadayada yadayada yada
This a citation \cite{Batty:2007}

\fussy
yadayada yadayada yadayada yadayada yadayada yada
This a citation \hfil\linebreak[3]\cite{Batty:2007}
This a citation \hfil\linebreak[3]\cite{Batty:2007}

\bibliographystyle{named}
\bibliography{\jobname}

\end{document} 

overline prevention

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.