LaTeX forum ⇒ BibTeX, biblatex and biberBibliography: how can I define a new field?

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Linguist
Posts: 39
Joined: Mon Nov 07, 2011 12:07 pm

Bibliography: how can I define a new field?

Postby Linguist » Thu Aug 02, 2018 11:12 pm

I’m wondering how I can define a new bibtex field which will behave like the author or editor field. Specifically I want to add a “collector” field so that authors, editors and collectors of references which have the same name end up sorted correctly in the reference list.

So if I have one work which has author = {Author, Arthur} and another with editor = {Author, Arthur} they get sorted correctly in the reference list (according to year or, if that is the same, by title) and the second gets a nice little note saying that Arthur Author is an editor. I also want to have collector = {Author, Arthur} and have this get sorted correctly.

The dumb way to do this is to make the author field author = {Author, Arthur (collector)} but this will be treated as an author with the name Arthur (collector) Author and thus appear after all instances of Arthur Author, even if the year field, title field etc. mean that it should get sorted before them.

I’m guessing I’ll need to make a custom bibliography style, so let me know how I’d go about doing this.

A minimal working example is something like this:

  1. \begin{filecontents}{shortbib.bib}
  2. @Book{book1,
  3. author = {Author, Arthur},
  4. year = {2000},
  5. title = {The first book in the list},
  6. publisher = {Publisher},
  7. }
  8.  
  9. @Book{book2,
  10. author = {Author, Arthur},
  11. year = {3000},
  12. title = {The last book in the list},
  13. publisher = {Publisher},
  14. }
  15.  
  16. @Book{book3,
  17. editor = {Author, Arthur},
  18. year = {2050},
  19. title = {Book which was edited not written},
  20. publisher = {Publisher},
  21. }
  22. \end{filecontents}
  23.  
  24. \documentclass{article}
  25. \usepackage{natbib}
  26.  
  27. \begin{document}
  28.  
  29. \cite{book2}
  30. \cite{book1}
  31. \cite{book3}
  32. %\cite{book4}
  33.  
  34. \bibliographystyle{apalike}
  35. \bibliography{shortbib}
  36. \end{document}
  37.  
  38. % I want to be able to cite this reference with a note: ", collector"
  39. % (much like the editor note) and have it sorted correctly in the reference list.
  40. % In this case the year field would mean it appears second last in the list.
  41.  
  42. %@Book{book4,
  43. % collector = {Author, Arthur},
  44. % year = {2075},
  45. % title = {Collection by Arthur Author},
  46. % publisher = {Publisher},
  47. %}

Return to “BibTeX, biblatex and biber”

Who is online

Users browsing this forum: No registered users and 15 guests