12

I'm exploring the great possibilities of biblatex ... and there are a few questions I can't resolve.

I'll start :) with one (edit !) of them :

I'm using "crossref" to cite several chapters in a book. Currently, when a second chapter in the same book is cited, all information about the publisher etc is reprinted. I'd like only the first reference to the book to have the full information, the following chapter could just have "author, chapter, in : bookname, op. cit."

Something tells me this should be possible ... would you know how to achieve this ?

Thanks in advance, Jos

Here's a small code :

\documentclass[ngerman,french]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}

\makeatletter
\usepackage{lmodern}
\usepackage{perpage}
\MakePerPage{footnote}
%% Biblatex %%
\usepackage[language=french,%
autopunct=true,%
  citestyle=verbose-trad2,%
   strict,% 
   citepages=suppress,% 
   idemtracker=true,% 
   loccittracker=true,%
   opcittracker=true,%
  related=false,
      bibstyle=reading,entryhead=false,entrykey=false,annotation=false,abstract=false,library=false,file=false,%
backend=biber]%
{biblatex}%

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Book{MH_Holzwege,
  keywords =     {MH,D},
  author =   {Martin Heidegger},
  title =    {Holzwege},
  publisher =    {Vittorio Klostermann},
  address =      {Frankfurt a. M.},
  year =     2003,
  series =   {Einzelausgabe des Bd. 5 der Gesamtausgabe},
  edition =      {8., unver\"{a}nderte Auflage},
  addendum =     {1. Publikation: 1950}}

@InBook{MH_Kunstwerk,
  keywords =     {MH,D},
  author =   {Martin Heidegger},
  title =    {Der Ursprung des Kunstwerkes},
  pages =    {1--74},
  crossref = {MH_Holzwege}
}

@InBook{MH_NietzscheGott,
  keywords =     {MH,D},
  author =   {Martin Heidegger},
  title =    {Nietzsches Wort `{Gott} ist tot'\,},
  pages =    {193--247},
  crossref = {MH_Holzwege}
}

@InBook{MH_Weltbild,
  keywords =     {MH,D},
  author =   {Martin Heidegger},
  title =    {Die Zeit des Weltbildes},
  pages =    {69--104},
  crossref = {MH_Holzwege}

@Book{MH_SZ,
  keywords =     {MH,D},
  author =   {Martin Heidegger},
  title =    {{Sein und Zeit}},
  address =      {T\"{u}bingen},
  publisher =    {Max Niemeyer},
  year =     2001,
  edition =      {18. Auflage},
  addendum =     {1. Publikation: 1927}}
    }

\end{filecontents}
\addbibresource{\jobname.bib}

\makeatother

\usepackage{babel}
\addto\extrasfrench{\providecommand{\og}{\leavevmode\flqq~}\providecommand{\fg}{\ifdim\lastskip>\z@\unskip\fi~\frqq}}

\begin{document}

\title{Titre}


\author{A. Teur}

\maketitle

Texte\footcite[20]{MH_Kunstwerk}.

Plus de texte \footcite{MH_Weltbild}.

Et hop \footcite{MH_SZ}

Une derni\`ere\footcite{MH_NietzscheGott}

\printbibliography[title={Oeuvres de Martin Heidegger},keyword=MH,keyword=D] 

\end{document}
Jos
  • 571
  • Welcome here! For the future, you're better off asking one question in each post. – pst Apr 21 '14 at 17:19
  • Ad 2: Have a look at biblatex-publist. This will change the bibliography style for all bibliographies though, at present it is not really possible to change the bibstyle between two \printbibliography statements (see also biblatex: different bibstyles in the same document?). – moewe Apr 21 '14 at 17:27
  • OK, than I'll stop looking for a way to resolve problem n. 2, thanks for telling me. And my question reduces itself to number 1. – Jos Apr 21 '14 at 18:53
  • Maybe you would like to edit your question then to remove #2 (you can ask a new question about issue #2 later, if one arises). – moewe Apr 21 '14 at 19:09
  • No. 1 is one of the most infuriating aspects of switching to biblatex. Mostly, things are so much nicer but then there are these odd bumps in it where it can't cope with stuff easily managed by bibtex. (The 'In' issue is another one.) – cfr Apr 21 '14 at 19:12
  • As it stands now, what you want seems to be quite hard to achieve, since there is no way (AFAIK) for biblatex to know whether an entry with the same crossref has been cited before (we could check if the crossref is in the bibliography though [this will always give op cit., not what you want], we could also find out if the crossref has been cited before, also not exactly what you want.) – moewe Apr 21 '14 at 19:13
  • As I see it, one would have to define a new tracker, like ifentryrefused (read as "ref[erence; i.e. xref or crossref] used", not "refused" :-)), that toggles to true (for an entry foo), if another entry (let's call that entry bar) that crossref'd or xref'd foo has been seen before (i.e. bar's \ifciteseen yields true). That is, \ifentryrefused{foo} is true iff there is another entry that ref's (xrefs or crossrefs) foo (let that particular entry be known as bar) and if bar's \ifentryseen{bar} yields true. I'd love to be proved wrong though. – moewe Apr 21 '14 at 19:48
  • It's not me who's going to prove you're wrong ... Thanks for the information ; btw, I edited my question to remove issue no. 2. Maybe a workaround (for issue 1, the only one remaining here) would be to print only a limited amount of information in the footnote, and have the full record in the bibliography ? I'll look for a way to distinguish between fields that are printed in the footnotes and in the bibliography tomorrow. – Jos Apr 21 '14 at 20:32
  • There is some support for that with style=philosophy-verbose that maybe used for inspiration. (If you just try your example with that style you have to define the bibliography string 'cited' for French, though.) – pst Apr 21 '14 at 21:44
  • We can certainly find out if we are in a citation or bibliography situation (there are \ifcitation and \ifbibliography for that, p. 178 of the biblatex documentation). So limiting the information depending on where it is to be found is not a problem. – moewe Apr 22 '14 at 06:59
  • Indeed, phylosophy-verbose seems to be able to handle this : "With the verbose style, when citing @incollections entries, the data of the @collection are printed entirely in the first citation and shortened afterwards. Anyway in the final bibliography the @incollection is always complete of all the informations about the corresponding @collection." But how should the 'cited' string be defined ? – Jos Apr 22 '14 at 08:02
  • The bibstring cited can be defined with \NewBibliographyString{cited}\DefineBibliographyStrings{french}{cited = {cit\adddot}}. – moewe Apr 22 '14 at 08:23
  • OK, thanks, I missed the \NewBibliographyString command. This works like a charm ! I could have thought that writing a philosophy paper would require biblatex-philosophy sooner or later ... but thanks for convincing me ! But there are other answers below that I'll have to look at ... this "comment and answer' interface kind of confuses the new user that I am. – Jos Apr 22 '14 at 09:56

1 Answers1

13

I think it can be done, without undue difficulty. Here's a sort of proof of concept:

\newbibmacro*{cite:seen:related}{%
 {\xifinlistcs{\thefield{crossref}}{blx@bsee@\the\c@refsection}
   {}
   {\listcsxadd{blx@bsee@\the\c@refsection}{\thefield{crossref}}}}}

\newcommand{\ifrelatedunseen}[2]{%
  \xifinlistcs{\thefield{crossref}}{blx@bsee@\the\c@refsection}
   {#2}
   {#1}}

\renewbibmacro*{cite}{%
  \usebibmacro{cite:citepages}%
  \global\togglefalse{cbx:fullcite}%
  \global\togglefalse{cbx:loccit}%
  \bibhypertarget{cite\the\value{instcount}}{%
    \ifciteseen
      {\iffieldundef{shorthand}
         {\ifciteibid
            {\usebibmacro{cite:ibid}}
            {\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}
         {\usebibmacro{cite:idem}}
               {\usebibmacro{cite:name}}%
             \usebibmacro{cite:title}}%
          \usebibmacro{cite:save}}
         {\usebibmacro{cite:shorthand}}}
      {\ifboolexpr {
         test {\iffieldundef{crossref}}
         or not ( test {\ifentrytype{inbook}}
               or test {\ifentrytype{incollection}} ) }
       {\usebibmacro{cite:full}%
        \usebibmacro{cite:save}}
       {\ifrelatedunseen
        {\usebibmacro{cite:seen:related}%
         \usebibmacro{cite:full}%
         \usebibmacro{cite:save}}
        {\usebibmacro{related:info}}}}}}

\newbibmacro*{related:info}{%
  \usedriver{}{inbook:rel}}

\DeclareBibliographyDriver{inbook:rel}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{in:}%
  \usebibmacro{maintitle+booktitle}%
  \newunit%
  \bibstring{opcit}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit\newblock
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}

Basically: we modify cite so that it looks for a crossref in inbook or incollection types. If there is one uses the (ordinary) method for seeing if the crossref has been previously cited, and calls a modified macro (which in turn calls a revised driver) if it has. If the crossref not been previously cited (directly or indirectly) it calls a macro which records the citation of the crossref as if it had been cited.

It's a bit rough of course; "production" code would need to deal with (e.g)

  • shorthands (as well as "op. cit"), and perhaps idem and ibid as well, but I don't see insuperable difficulties, though the cite saving mechanism would need to be modified to deal with the "note" classes.

  • (perhaps) the incollection type separately from inbook (since one might want to print editors' names)

  • xref fields as well as crossref (which is what I have used, since that was what was in the MWE) (and I've always found the xref mechanism rather difficulty in any event)

It does have certain merits, however: if the "main work" is cited, the citetracker picks it up automatically. And if there is a \citereset, it works as it should (i.e. we lose the op.cit.)

This code inserted (between \makeatletter ... \makeatother into the above MWE gives the following.

output

Paul Stanley
  • 18,151
  • 1
    Great answer +1. Maybe you would like to switch between blx@bsee@ and blx@fsee@ depending on \iffootnote, as I understand it, the former is for the body text, the latter list for footnote citations. (I'm not sure, if this will work properly though.) – moewe Apr 22 '14 at 09:12
  • 1
    @moewe You may well be right! I was in rather a rush, and I'm sure there are quite a number of refinements which would be desirable to make this robust enough to be general. I'll try experimenting a little this evening. – Paul Stanley Apr 22 '14 at 09:15
  • 1
    Great! It would be good to see quite a generally-applicable and robust solution, as this is a question that comes up from time to time, and has not received a satisfying answer (I think). – moewe Apr 22 '14 at 09:23
  • 2
    for your information, I have adapted this code to a package http://www.ctan.org/pkg/biblatex-opcit-booktitle – Maïeul Aug 30 '15 at 16:34