3

I am using bibtex to organize my bibliography. I want to cite a chapter from a book. The best way I read when one has both author and editors, is to use crossref and an inbook and book entry, e.g.: (bib_test.bib)

@inbook{inbook,
  author = {A. Inbook-Author},
  title = {The title of the inbook entry},
  pages = {1--5},
  chapter = {1},
  crossref = "book",
}

@book{book,
  title = {A title of the book entry},
  booktitle = {A title of the book entry},
  year = 2013,
  editor = {E. Book-Editor},
  publisher = {Book Publishing Inc.},
}

However, if I run bibtex, on a latex file

\documentclass{scrartcl}

\begin{document}
\cite{inbook}
\bibliographystyle{style}
\bibliography{bib_test}
\end{document}

it always gives me the warning:

Warning--can't use both author and editor fields in inbook

I don't understand this, since that was the reason I splitted it into inbook and book, but still I am gettings this error. In the bibstyle file I found

FUNCTION {inbook}
{ output.bibitem
  author empty$
    { format.editors "author and editor" output.check
    } 
    { format.authors output.nonnull
      crossref missing$
        { "author and editor" editor either.or.check }
        'skip$
      if$
    }
  if$
  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
  format.btitle "title" output.check
  format.edition output 
  crossref missing$
    {
      format.publisher.address output
      format.bvolume output
      format.chapter.pages "chapter and pages" output.check
      format.number.series output
    }
    {
      format.chapter.pages "chapter and pages" output.check
      format.book.crossref output.nonnull
    }
  if$

  format.date "year" output.check
  date.block
  format.pages "pages" output.check
  format.doi output
  format.note output
  fin.entry
} 

I tested a few things and it seems that crossref missing$ gives always True as an answer. He should NOT test on both author and editor fields being present if a crossref is given. This is weird, since he definitely recognizes the crossref, otherwise he would show an error...

Guiste
  • 195
  • Please show not only code snippets but a MWE. Is there a good reason for using old BibTeX instead of biblatex with biber? – Schweinebacke Jan 29 '17 at 13:01
  • I have added a MWE. Not that I know of, I always used bibtex in combination with pdflatex. Is there an advantage of using biblatex? What is biber? – Guiste Jan 29 '17 at 13:44
  • I'm still confused by this behaviour. crossref missing$ is always true, no matter if crossref field exists or not. Similarly, crossref empty$ is always true, even when cross-referencing other records. If so, why the .bst even have crossref missing$ sections? – Ran G. Oct 31 '21 at 18:33

1 Answers1

4

The solution is to change the entry type of the first entry from @inbook to @inproceedings.

enter image description here

\RequirePackage{filecontents}
\begin{filecontents}{mybib.bib}
@inproceedings{inbook,
  author = {A. Inbook-Author},
  title = {The title of the inbook entry},
  pages = {1--5},
  chapter = {1},
  crossref = "book",
}
@book{book,
  title = {A title of the book entry},
  booktitle = {A title of the book entry},
  year = 2013,
  editor = {E. Book-Editor},
  publisher = {Book Publishing Inc.},
  address   = "Anytown",
}
\end{filecontents}

\documentclass{article}
\bibliographystyle{style} % downloaded from site indicated by OP

\begin{document}
\cite{inbook}
\bibliography{mybib}
\end{document}
Mico
  • 506,678
  • But what is the purpose of the "inbook" type then? – Guiste Jan 29 '17 at 18:35
  • 1
    @Guiste - I believe @inbook should be used only if the piece being cited is something like a chapter in a book -- and if the chapter and the entire book have the same author (or editor). For a multi-author anthology that was edited by one or more persons who needn't be same as the authors of any of the chapters, the entry type @inproceedings should be used. Note that the ``@inproceedings` entry type isn't just limited to conference proceedings -- anthologies will do as well. – Mico Jan 29 '17 at 21:37
  • this is exactly my case. So I want to cite a chapter out of a book with the same author for the chapter and the book, but additionally editors for the whole book, how to handle that? – Guiste Jan 30 '17 at 07:15
  • @Guiste - Is the entry type @inproceedings not working for you? It would help if you edited your posting and replaced the two "dummy" entries with real (or at least more realistic) entries. – Mico Jan 30 '17 at 07:31
  • It is working, but I don't understand why I have to use it. I am crossreferencing to a book not proceedings... – Guiste Jan 31 '17 at 08:34
  • @Guiste - I'm afraid I can't offer any insights into why the particular terminology was chosen. BibTeX has been around for more than 30 years, and some of its terminology and jargon could stand a refresher, that's for sure. Just take note of the fact that the @inproceedings entry type is quite general and should not be used solely for, well, conference proceedings. – Mico Jan 31 '17 at 08:53