5

I have the following requirement: For the first time an author / the authors are mentioned, there has to be a "full" citation, matching the entry of the bibliography. After that, a short form is used, which already works.

Now I found in the BibLaTeX documentation the option citetracker which I set to true. I also found the macros \ifciteseen and \ifentryseen. However, I cannot figure out how to use them in my .cbx file in order to solve the problem. Do I have to rewrite a macro? And how do I get the bibliography string generated with the help of a .bbx file?

If you need more information or find a similar post (in spite of my search), feel free to comment.

Minimal example:

\documentclass{article}
\usepackage{lipsum}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
  @book{Knu86,
    author = {Knuth, Donald E.},
    year = {1986},
    title = {The \TeX book},
  }
\end{filecontents}

\begin{filecontents}{cs.cbx}
\RequireCitationStyle{authoryear}
\DeclareFieldFormat{citetitle}{#1\isdot}
\DeclareFieldFormat[article]{citetitle}{#1}
\DeclareNameFormat{labelname}{%
    \ifcase\value{uniquename}%
    \usebibmacro{name:last}{#1}{#3}{#5}{#7}%
    \or
    \ifuseprefix
        {\usebibmacro{name:last}{#1}{#3}{#5}{#8}}
        {\usebibmacro{name:last}{#1}{#4}{#6}{#8}}%
    \or
    \usebibmacro{name:last}{#1}{#3}{#5}{#7}%
    \fi
    \usebibmacro{name:andothers}
}
\end{filecontents}

\usepackage[citestyle = cs, bibstyle = standard, backend=bibtex8, citetracker=true]{biblatex}
\bibliography{\jobname}

\begin{document}
\lipsum[1]\footcite[S.85]{Knu86}
\lipsum[1]\footcite[S.96]{Knu86}
\printbibliography
\end{document}

I want to provide a piece of pseudocode which will hopefully make clear what I mean.

If the current bib entry (e.g. Knu86) was already cited

(true:) use the citation way defined in the cite style

(false:) print the string from the bibliography

  • More information is needed, especially what style you are using. In general, you should post a minimal example that starts with \documentclass{...} and ends with \end{document} and only loads the minimal set of packages needed to demonstrate your question/problem. – jon Apr 15 '13 at 19:50
  • @jon: Now you should see both the bibliography entry and the customized citation style. – PWillms Apr 15 '13 at 21:51
  • Are you trying (more or less) combine how citestyle=authortitle (for the first cite) and citestyle=authoryear (for subsequent citations) work, where the only significant difference is that the first citation should look like a bibliography entry rather than a normal citation? – jon Apr 16 '13 at 2:10
  • @Jon: Yes, this is correct. However, I would appreciate if I did not need two different BibLaTeX citestyles. – PWillms Apr 16 '13 at 6:47
  • @PWillms Just adapt the verbose citation style or one of its variants. Often it is easier to customize an existing style instead of writing your own from scratch. For example loading biblatex with citestyle=verbose and bibstyle=authoryear should get you most of the way there. – Audrey Apr 16 '13 at 13:27
4

This type of citation label is already implemented in the verbose style and its variants, but with short author-title instead of author-year labels. In verbose.cbx, use of the \ifciteseen test is demonstrated in the cite bibliography macro, defined by:

\newbibmacro*{cite}{%
  \usebibmacro{cite:citepages}%
  \ifciteseen
    {\iffieldundef{shorthand}
       {\usebibmacro{cite:short}}
       {\usebibmacro{cite:shorthand}}}
    {\usebibmacro{cite:full}}}

To obtain the desired output, we can then edit the cite:short macro to print labelyear in place of labeltitle. Full citations are generated by the cite:full macro via:

\usedriver{\DeclareNameAlias{sortname}{default}}{\thefield{entrytype}}

which gives the almost same output as the entry's bibliography item, except the name list at the beginning of the entry is printed in the default first-last format instead of last-first/first-last. Identical output can be obtained with

\usedriver{}{\thefield{entrytype}}

although the pages field may cause some confusion with page references in postnotes. To address this, the verbose style and its variants offer an additional option called citepages.

\documentclass{article}
\usepackage[german]{babel}
\usepackage{csquotes}
\usepackage[style=verbose,labelyear]{biblatex}

% experiment with these settings
\ExecuteBibliographyOptions{citepages=omit,citetracker=true}

% replace labeltitle with labelyear
\renewbibmacro*{cite:short}{%
  \printnames{labelname}%
  \setunit{\nameyeardelim}%
  \usebibmacro{cite:labelyear+extrayear}}

% full citations same as bibliography
\renewbibmacro*{cite:full}{%
  \usebibmacro{cite:full:citepages}%
  \printtext[bibhypertarget]{%
    \usedriver{}{\thefield{entrytype}}}%
  \usebibmacro{shorthandintro}}

% from authoryear.cbx
\newbibmacro*{cite:labelyear+extrayear}{%
  \iffieldundef{labelyear}{}{%
    \printtext[bibhyperref]{\printfield{labelyear}\printfield{extrayear}}}}

\bibliography{biblatex-examples}

\begin{document}
\null\vfill\noindent
Filler text \autocite{baez/article,baez/online}.
Filler text \autocite[85]{bertram}.
Filler text \autocite[96]{bertram}.
Filler text \parencite{baez/article,baez/online}.
\printbibliography
\end{document}

enter image description here

Note that the extrayear field appended to labelyear for disambiguation is not incorporated in author-title bibliographies. This field could be added, but an author-year bibliography style would be more reader-friendly. You can achieve this by replacing

\usepackage[style=verbose,labelyear]{biblatex}

with

\usepackage[citestyle=verbose,bibstyle=authoryear]{biblatex}
  • OK, the \printtext[bibhypertarget]{% \usedriver{}{\thefield{entrytype}}} line was the thing that I actually looked for. Now the general combination of verbose and authoryear works, although a colon in the bibliography entry is not displayed in the footnote. I will look this up in the next days. Thank you very much! – PWillms Apr 16 '13 at 22:47

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.