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.

The idea is the following: Normally, \fullcite just prints the full bibliography entry by calling \usedriver. In my style biblatex-fiwi I added the option to suppress stuff like foreword and afterword. At the moment, this option is for both, the bibliographic entry and the result of \fullcite.

I'd like to have the possibility to distinguish between the result of \printbibliography and \fullcite. But since \fullcite relies on the same mechanism as \printbibliography, this is tricky. What I need is a test which tells me whether we are currently inside a \cite command. This would then allow me to add a \fullcite-only option.

As far as I know, no test of this kind exists.

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

Anything wrong with \ifbibliography (see section 4.6.2 of the manual for details)?

\documentclass{article}

\usepackage{biblatex}

\renewbibmacro{begentry}{\ifbibliography{}{\clearname{foreword}}}

\usepackage{filecontents}

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

\addbibresource{\jobname.bib}

\begin{document}

\fullcite{A01}

\printbibliography

\end{document}

enter image description here

share|improve this answer
    
D'oh, not only is there \ifbibliography, there is also \ifcitation. Thanks a lot. –  Simifilm Nov 5 '12 at 14:03
add comment

I don't think there's a built-in way to do this [update: wrong]: at least, if there is, I don't know it [that part, sadly, was not: see Lockstep's answer for the correct approach].

The easiest way, I think, would be to do something with \AtBeginBibliography. Options include: setting some sort of toggle which you can test in your driver, and which would indicate that it was being called within a bibliography environment [that's unnecessary, because one is already provided], or setting up a driver alias to trigger at that point, so that you effectively replace the driver that \fullcite will "see" with another driver that only takes effect in the bibliography [I think that remains a possible alternative, which could be sensible if there was a lot that needed changing].

share|improve this answer
    
See also tex.stackexchange.com/q/67621/16895 –  Guido Nov 5 '12 at 10:42
1  
@Guido The test used there ensures \fullcite generates the same output as the bibliography. For the problem here \ifbibliography or \ifcitation work just fine. –  Audrey Nov 5 '12 at 14:21
add comment

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.