Bibliography sorting question

In my custom style I want the bibliography sorted according to Author and title.

Occasionally I have encyclopedia articles which do not give an author. Those need to be sorted only according to title.

Now I have the unlikely, but not impossible case, that the title of such and unnamed encyclopedia article happens to be identical with the name of an author. This article now gets sorted in the middle of the many books by this author. Is there a way to make it sort _after_ the books by this author?
  • The way to do this would be to make a new macro for sorting that takes the output of the Author macro and adds some text (like “zzzz”) if type="entry-encyclopedia" (or better, if variable="author editor translator" match="none"). Use this macro in sorting, but not in any place where it would display.
  • That's an ingenious solution, and I was able to include that easily into the current sorting macro. Thanks!!
  • edited November 18, 2018
    Minor note: in case you happen to be working with books in other languages, 'zzzzz' would not be the last-sorted string (for example, Russian names in Cyrillic are always sorted after Latin). You could guess what might be last (some high-value Chinese character in Unicode?), but the most reliable approach would be to do the opposite, and sort 'real' authors first. Through some trial and error I've found that some but not all of the basic ASCII symbols do get sorted first (others are ignored, I believe). "0" comes close, but some of "!@#$%..." also work, not sure that space does. So a random string of those would work for this purpose. Of course "zzzz" would be fine almost all of the time, and always if you never expect to use other languages.
    Alternatively, just use an independent macro, not adding to the author macro, and use "a" (or "1") to sort first, and "z" (or "2") for last, with nothing else in that macro. That way it won't be relevant whether the author field has Latin characters ornot.
Sign In or Register to comment.