# Place the citation flush right csQuotes

I very much like the way the citations are done in this answer here Quote environment with reference at the end right Is there any way to get the same effect using csQuotes? Beneath is a somewhat minimal example =)

\begin{filecontents}{biblio.bib}
@book{Feynman,
author = "Richard P. Feynman",
title = "Surely You're Joking, Mr.Feynman!",
publisher = "WW.Norton Company, Inc",
year = "1985"
}
\end{filecontents}

\documentclass[12pt,a4paper]{article}
\usepackage[sort,numbers,square]{natbib}
\usepackage[norsk]{babel}
\usepackage[autostyle]{csquotes}
\usepackage[lipsum]

\begin{document}

\textquote[Feynman \citep[s39-41]{Feynman}]{\lipsum[1]}{}{}

\bibliographystyle{plain}
\bibliography{biblio}

\end{document}


Here is what I get

And here is what I want =)

I did try a few dirty fixes, such as defining new environments and what not. But most likely the people here are far more experienced in using these packages =)

There are two problems here. Left to its own devices, lipsum puts a \par at the end of the text -- that is why your concluding quote mark (and \cite) came out on the next line. You need to use \lipsum*[1] so that the \par token is not inserted.

The other problem is getting the flushright effect: You need to redefine \mktextquote:

\renewcommand{\mktextquote}[6]{#1#2#4#3\hfill\hbox{#6}#5}


So the whole file looks like this:

\begin{filecontents}{biblio.bib}
@book{Feynman,
author = "Richard P. Feynman",
title = "Surely You're Joking, Mr.Feynman!",
publisher = "WW.Norton Company, Inc",
year = "1985"
}
\end{filecontents}

\documentclass[12pt,a4paper]{article}
\usepackage[sort,numbers,square]{natbib}
\usepackage[norsk]{babel}
\usepackage[autostyle]{csquotes}
\usepackage{lipsum}

\newcommand{\signat}[1]{%
{%
\unskip
\nobreak
\hfil
\penalty50%
\hskip2em%
\hbox{}%
\nobreak
\hfil
#1%
\parfillskip=0pt%
\finalhyphendemerits=0%
\endgraf
}%
}

\renewcommand{\mktextquote}[6]{#1#2#4#3\signat{#6}#5}

\begin{document}

\textquote[{\cite[s39-41]{Feynman}}]{\lipsum*[1]}{}{}

\bibliographystyle{plain}
\bibliography{biblio}

\end{document}


I have modified my answer to include a version of Knuth's \signed that takes only one argument. You can try that. However, as I run your file (on TeXLive2013), I am not getting a name ("Feynman") but a number ("1") so I cannot replicate your problem with a long name which was what, by the way?

For the sake of completeness, \mkblockquote can be redefined analogously:

\renewcommand{\mkblockquote}[5]{#1#2#3\signat{#4}#5}

• Is there a reason to use \hfill\hbox{} instead of the \signed. I tried your code, and ran into a few problems with long names. The problem imgur.com/MYEOmkl and the code pastebin.com/WfUz4Z3N. I found that removing the parenthesis and using the \signed command from the linked question fixes this. I would recommend using this instead, (or find your own way to fix the brokenlines) Otherwise a really useful answer, thanks! Dec 17, 2013 at 16:47