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.

been trying too long now on this: I would like to enclose e.g. the following text:

(cit. Doe, Commercial Laws) [name in smallcaps]

in the end of each of my entries in the bibliography before the period, e.g.:

Doe John, Commercial Laws of Canada, Toronto 1999 (cit. Doe, Commercial Law). [name in smallcaps]

Using biblatex and biber, I found the following and put in in the preamble of my *.tex file:

\renewbibmacro*{begentry}{
   \printtext[parens]{
   \unspace{cit. }\printnames{shortauthor}\addcomma\addspace\printfield{shorttitle}\unspace
   \printnames{shorttitle}}
}

This generates (position in the beginning instead of the end!):

(cit. Doe, Commercial Laws) Doe John, Commercial Laws of Canada, Toronto 1999.

Does anyone have a solution to my problem? Also, is it possible to generate shortauthor and shorttitle with biblatex without defining these labels in the *.bib file?

share|improve this question
    
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  Guido Jan 27 '13 at 21:54

1 Answer 1

up vote 3 down vote accepted

If you want to put the text at the end of the entry you have to use the finentry biblatex macro, not the begentry one, thus, you can replace begentry with finentery in your code, and add \finentry at the end to print the final period.

\renewbibmacro*{finentry}{
   \printtext[parens]{
   \unspace{cit. }\printnames{shortauthor}\addcomma\addspace\printfield{shorttitle}\unspace
   \printnames{shorttitle}}%
   \finentry
}

Notice that the \unspace are not necesasry and they can be elimated.

The field shortauthor and shorttitle should be given in the bib file (it is possible to use some of the map features of biber to extract them from author and title). However, it seems to me that what you want can be achieved using the labelname and labeltitle fields (for labeltitle should use shorttitle if present in the bib).

\renewbibmacro{finentry}{%
  \printtext[parens]{%
  \printtext{cit.}\addspace
  \textsc{\printnames{labelname}}\addcomma\addspace
  \printfield{labeltitle}}
  \finentry
  }
share|improve this answer
1  
All that \unspace business should be avoided with %. –  Audrey Jan 27 '13 at 22:36
    
Great, thanks to both of you (didn't know %)! –  user19581 Jan 27 '13 at 23:21
    
@Audrey Indeed. I copied the old code. I have updated the answer. –  Guido Jan 27 '13 at 23:23

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.