0

I want to cite a few books which were edited/translated which means, I want both the author and the editor to appear in the bibliography. How do I cite them properly using:

\bibliography{sources}?

So far, I created my own .bst file using

latex makebst

and implemented it using

\bibliographystyle{custom_style}.

I created the library in jabref. As I said, a few of the cited books have both an author and an editor/translator. During compilation, Latex throws errors like "can't use both author and editor field in [key]".

How do I force latex to add an editor to the output?

Edit: It appears that I might have to change the .bst file: http://www.verycomputer.com/18_e96f98b02315074c_1.htm

For now, the .bst file looks like:

FUNCTION {book}
{ output.bibitem
  author empty$
    { format.editors "author and editor" output.check
      add.colon
    }
    { format.authors output.nonnull
      add.colon
      crossref missing$
        { "author and editor" editor either.or.check }
        'skip$
      if$
    }
  if$
  new.block
  format.btitle "title" output.check
  crossref missing$
    { format.bvolume output
      new.block
      format.number.series output
      new.sentence
      format.publisher.address output
    }
    {
      new.block
      format.book.crossref output.nonnull
    }
  if$
  format.edition output
  format.date "year" output.check
  new.block
  format.url output
  new.block
  format.note output
  fin.entry
}

Any suggestions what to do? I guess I'll have to change something in the "author empty" line, because I want the editor always to be displayed, not only if there's no author. However, once I just change

    { format.authors output.nonnull
      add.colon
      crossref missing$
        { "author and editor" editor either.or.check }
        'skip$
      if$
    }

to

    {
        %format.authors output.nonnull
        %add.colon
        %crossref missing$
            %{ "author and editor" editor either.or.check }
                %'skip$
        %if$
    editor empty$
        {
        format.authors output.nonnull
            add.colon
            crossref missing$
                { "author and editor" editor either.or.check }
                'skip$
            if$
        }
        {
        format.authors format.editors output.nonnull
            add.colon
            crossref missing$
                { "author and editor" editor either.or.check }
                'skip$
            if$
        }

I get other error messages pointing to line 1565 in my .bst file, which is:

ITERATE {call.type$}

Any advices are very welcome.

  • What output would you like to see? "Anne Uthor (author) Edward Ditor (editor): A Book" or "Anne Uthor: A Book, edited by Edward Ditor", or ... biblatex's standard styles allow for both an author and editor and would give you roughly the second option (see tex.stackexchange.com/q/25701/35864) – moewe Jul 18 '18 at 12:49
  • I would prefer "Anne Uthor and Edward Ditor (Editor): A Book" as it is set up in "unsrtdin.bst", which is basically "unsrt.bst". – Forrest Thumb Jul 18 '18 at 12:55
  • Ok, and what do you do if you have multiple editors and multiple authors? How can you tell which is which? – moewe Jul 18 '18 at 12:56
  • To be honest, I don't have multiple editors. That's why I didn't come across the conflict you implied. Probably I would do something like "Anne Uthor, William Riter, Edward Ditor (editor) and Thomas Ranslator (editor)". But if there is no simple solution to that (which is weird, because there are a lot of books out there with both authors and editors), I'll just copy the editor to the list of authors with something like ''(editor)". Didn't think it would be that complicated :/ – Forrest Thumb Jul 18 '18 at 13:16
  • Can you upload your current .bst to a plain-text sharing website (pastebin, GitHub Gists, GitLab snippets, ...). That way I have something concrete to play around with. – moewe Jul 18 '18 at 15:48
1

Alright, I was able to get (almost) what I wanted.

Here is the new .bst file: https://pastebin.com/qsw2HziY

And here is the old one: https://pastebin.com/PPZ92dJQ

What I did: I changed my mind and wanted to get the reference:

"F. A. Uthor and S. A. Uthor: A book (edited by F. E. Ditor and S. E. Ditor)"

Then I changed the .dbj file which was created by makebst to present the editors of incollections the way I mentioned:

%<<EDITOR IN COLLECTIONS:
%    %: (def) Same as for edited book (names before booktitle)
% edby,%: In booktitle, edited by ..  (where .. is names)
 edby-par,%: In booktitle (edited by ..) 
% edby-parc,%: In booktitle, (edited by ..) 
% edby,edbyx,%: In booktitle, editor .. 
% edby,edbyw,%: In booktitle, (editor) .. 
% edby-par,edbyx,%: In booktitle (editor..) 
% edby-parc,edbyx,%: In booktitle, (editor..) 
% edby,edbyy,%: In booktitle, .., editor 
% edby-par,edbyy,%: In booktitle (.., editor) 

And checked what this would change in the .bst file. Then I saw that the .bst file (in case of no author etc.) just changes the booktitle by appending (edited by ...) to it:

FUNCTION {incollection}
{ output.bibitem
  format.authors "author" output.check
  add.colon
  new.block
  format.title "title" output.check
  new.block
  crossref missing$
    { format.in.ed.booktitle "booktitle" output.check %<-- this guy it is
      format.bvolume output
      format.number.series output
      format.chapter.pages output
      new.sentence
      format.publisher.address output
      format.edition output
      format.date "year" output.check
    }
    { format.incoll.inproc.crossref output.nonnull
      format.chapter.pages output
    }
  if$
  new.block
  format.url output
  new.block
  format.note output
  fin.entry
}

So I went to the function

FUNCTION {format.in.ed.booktitle}
{ format.booktitle duplicate$ empty$ 'skip$
    {
      editor "editor" format.names.ed duplicate$ empty$ 'pop$
        {
          bbl.edby %<-- this one inserts (edited by ...)
          " " * swap$ *
          "(" swap$ * ")" *
          swap$
          " " * swap$
          * }
      if$
      word.in swap$ * %<-- This line adds 'In: ' in front of the booktitle, dont need this in pure books
    }
  if$
}

And wrote a new function doing a similar thing (except the 'In: ' stuff):

FUNCTION {format.ed.btitle}
{ format.btitle duplicate$ empty$ 'skip$
    {
        editor "editor" format.names.ed duplicate$ empty$ 'pop$
            {
            bbl.edby
            " " * swap$ *
            "(" swap$ * ")" *
            swap$
            " " * swap$
            * }
        if$
        %word.in swap$ *
    }
    if$
}

Then I just replaced format.btitle "title" output.check in the {book} function with format.ed.btitle "title" output.check. That's it! However, the warnings about can't use both author and editor fields in [key] remain. Don't know how to remove them; it works anyway.

0

Another way to do this, is by adding editor information in an \emph{} environment after the title. For instance:

@book{abcd99a,
Address = {Ohio},
Author = {Arny, Anthony},
Date-Added = {2019-07-15 15:26:13 -0500},
Date-Modified = {2019-09-09 23:25:52 -0500},
Keywords = {Remember},
Publisher = {The Edwin Mellen Press},
Title = {On False and False Ideas. \emph{translated by Emacs Squared}},
Year = {1990}}

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.