Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Some time ago, Alan Munn asked and lockstep eloquently answered a question about removing parentheses from biblatex authoryear style references. Unfortunately, lockstep's solution injects an unwanted \addperiod\space into "dash" references. For example, given Author, A. cited twice:

\documentclass{article}

\usepackage[style=authoryear]{biblatex}
\usepackage{xpatch}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,author={Author, A.},year={2001},title={Alpha}}
@misc{A02,author={Author, A.},year={2001},title={Beta}}
\end{filecontents}

\addbibresource{\jobname.bib}
\nocite{*}

\begin{document}

\printbibliography

\xpatchbibmacro{date+extrayear}{%
  \printtext[parens]%
}{%
  \addperiod\space%
  \printtext%
}{}{}

\printbibliography

\end{document}

we get:

enter image description here

I've tried building a solution using constructs like \usebibmacro{bbx:dashcheck} without success. How, then, based on lockstep's nice xpatch-based approach, can I conditionally include \addperiod\space only in the case of "non-dash" references?

share|improve this question
    
Comment the line \addperiod\space% and should work. –  Marco Daniel Aug 18 '12 at 7:08
1  
@Marco, no. As in Alan's original question and in lockstep's answer, the \addperiod\space is required after the author field in normal (non-repeated author, "non-dash") cases. To see this more clearly, change the author= field from {Author, A.} to, say, {Author, Anne}. In which case, we want output to look like Author, Anne. 2001a and -- 2001b. Commenting out the \addperiod\space produces Author, Anne 2001a. The question is, how can we conditionally remove the period in the repeated author ("dash") case? –  Nikki Aug 18 '12 at 7:53
    
I didn't notice this. –  Marco Daniel Aug 18 '12 at 7:58

1 Answer 1

up vote 7 down vote accepted

The output of units should be done inside the command \setunit.

\xpatchbibmacro{date+extrayear}{%
  \printtext[parens]%
}{%
  \setunit{\addperiod\space}%
  \printtext%
}{}{}

enter image description here

share|improve this answer
    
Perfect! Thanks Marco. –  Nikki Aug 18 '12 at 21:59
    
This solution no longer works, cf. tex.stackexchange.com/questions/157390/… –  Sverre Feb 3 at 19:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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