From what I've read here, there is a tweak one can make or change to have authors in both the author column and the tag editor are listed and sorted with the last name first and the the first name last (as in Adams, Douglas instead of Douglas Adams). Whenever I tried to go to preferences, then tweak, my eyes started to glaze over and I slowly rose from my chair before running, screaming maniacally, from the room in utter confusion and frustration.

Could someone please explain how to do this in simple, step by step language a three year old (or a senile, computer challenged 61 year old) can understand?

There are two ways of doing that:
In the upper tweaks field, look for author_sort_copy_method (it's gonna be preceded by a bunch of lines starting with hash signs (#) explaining how to use that tweak). Copy that line to the lower field and set it to "copy" instead of "invert".
Alternatively, you just type "author_sort_copy_method = 'copy'" into the lower tweaks field. Without the double quotation signs, of course.
Regardless of what method you use, you need to recalculate the author_sort values if your author values are already set to "LN,FN" (Do that via right-clicking in the tags browser and selecting "Manage authors"). If the author values are not already set, you need to set those first. I'd suggest using the search & replace facility if that's the case.

I wasn't kidding when I said I needed detailed instructions (and yes, I did go to tweaks). What may seem basic to you is Greek to me. Sorry about that.

This is my understanding FWIW, I store authors LN, FN too...

You found the tweaks section in Preferences so that's a good start Think of the box at the top as a set of default values, that if you never ever made changes Calibre will use to control it's behaviour. There are lines of instructions in there for each one (as comments, the lines starting with #) and then below each set of comments is the actual line of code (tweak) with the value Calibre is going to use unless you tell it differently.

The "Current tweaks" box at the bottom, is where you can put any values that you want to have different, i.e. overriding the default behaviour of Calibre.

In your case, paste the following into the bottom box:

Code:

author_sort_copy_method = 'copy'

Then close Calibre and start it up again, as changes to "tweaks" will only take effect when Calibre is restarted.

That tweak fixes the problem for any *new* authors you add. Without the tweak above, you typing in a new author of "Smith, James" would have the sort stored as "James, Smith", because the default behaviour is to "invert" the name which is *not* what you want. Instead you want Calibre to *copy* the value from author, so that both will have "Smith, James" stored in it. Having applied the tweak above you will have that problem sorted from now on.

The second part of the problem (and I struggled with this too) is to realise that for all the *existing* authors in Calibre, you need to change them in a particular way to get Calibre to correctly add new books for them in the future. Calibre separately stores for each author a list recording that for a particular author name how it should be sorted.

So you need the "tag viewer" pane visible on the left side of the screen, where it has a list of stuff you can expand like "Authors", "Series", "Formats" etc. Then right-click on the "Authors" at the top of that list and choose "Manage Authors". This dialog will show you all the existing authors you have, and how each will be sorted. I suggest you then work your way down the first column, changing the values where needed so they are "Last Name, First Name" which is what you are after. You might want to double check the value on the author_sort column on the right matches how you want them to be sorted too.

Ouch. I only have 465 existing authors. There has to be an easier way.

There is a button in the manage_authors dialog box that will recompute the author sort for all authors in one swell foop. Use that button (after you set the tweak), then look for mistakes, such as a) Asian names or b) European names with de, du, von, van, del, della, or c) compound last names that should be sorted on a name appearing later in the surname.

There is a button in the manage_authors dialog box that will recompute the author sort for all authors in one swell foop.

If I understand her, I think her concern is that her authors are currently firstname lastname, and she wants a fast way to make them lastname, firstname. Then she can work on author sorts (of which there are two - one for the books and one for the authors).

If I understand her, I think her concern is that her authors are currently firstname lastname, and she wants a fast way to make them lastname, firstname. Then she can work on author sorts (of which there are two - one for the books and one for the authors).

The search and replace function comes to mind for her main problem.

Yeah I "assumed" like you Starson that she is in the position of having a database of authors that are FN LN that she now wants to become LN, FN. That Recompute button is going to do nothing to help her with that data entry problem?

In find/replace, is it possible to take the value from the author_sort field and put it into the author field? Presumably her existing author_sort is probably pretty correct already. If she could do that it would save a lot of typing.

This is one of those areas of Calibre that you kind of wish in hindsight you had been prompted to decide on what you wanted when you first create a library, as it is a complicated pain to sort out after you have imported a load of books. We haven't even mentioned the whole book sorts vs author sorts issue which was what got me confused when I first tried this until I got help here in the forums...

The "Current tweaks" box at the bottom, is where you can put any values that you want to have different, i.e. overriding the default behaviour of Calibre.

In your case, paste the following into the bottom box:

Code:

author_sort_copy_method = 'copy'

That tweak fixes the problem for any *new* authors you add. Without the tweak above, you typing in a new author of "Smith, James" would have the sort stored as "James, Smith", because the default behaviour is to "invert" the name which is *not* what you want. Instead you want Calibre to *copy* the value from author, so that both will have "Smith, James" stored in it. Having applied the tweak above you will have that problem sorted from now on.

From the bottom of my heart THANK YOU SO MUCH, this has been driving me crazy from forever. I have been manually changing this and now with this solution - done! I knew there was a way to do this within the system just never had the time to figure it out and besides, I never would have messed with the Tweaks without some help. Unlike Lady, all of my authors are already LN, FN so I don't have to fix that issue, but going forward, just knowing all books added will be the way I want is invaluable.

In find/replace, is it possible to take the value from the author_sort field and put it into the author field? Presumably her existing author_sort is probably pretty correct already. If she could do that it would save a lot of typing.

Possible, but probably not a good idea, because it will produce incorrect results for books with multiple authors. The problem arises because authors is a multiple field, but author_sort is a single field. S/R does the work for each item in a multiple field, so each author would be set to the combined author sort. The result would be a mess.

Better would be to use a regexp on author to flop the names around. One would first select all books with no comma in the authors' names, then apply something like the following:

Possible, but probably not a good idea, because it will produce incorrect results for books with multiple authors. The problem arises because authors is a multiple field, but author_sort is a single field. S/R does the work for each item in a multiple field, so each author would be set to the combined author sort. The result would be a mess.

Ok, fair point on multiple authors, I just wasn't sure if it was even technically possible with that dialog, clearly it is. I would suspect out of 465 authors she has there would be very few that were multiple authors and it would still save an awful lot of typing (then go back into "Manage authors" to review the result and fix the few that were wrong).

You provided a regex alternative which is great, at least people have some options.

From the bottom of my heart THANK YOU SO MUCH, this has been driving me crazy from forever. I have been manually changing this and now with this solution - done! I knew there was a way to do this within the system just never had the time to figure it out and besides, I never would have messed with the Tweaks without some help. Unlike Lady, all of my authors are already LN, FN so I don't have to fix that issue, but going forward, just knowing all books added will be the way I want is invaluable.

You are welcome, glad it was helpful. Just trying to "pay it forward" from the help others have given me here in these forums.

One last point for you and others to make this thread complete, since it sounds like you have been manually overtyping things for a while. After applying the tweak you might become a "victim" of a quirk of how Calibre stores the author sort data that I haven't gone into detail on before now. Here's the long story as I understand it.

Calibre stores the author_sort values in two places. Once in a table that says for each author what it's sort should be. That makes sense, and is what you change via the "Manage authors" dialog. Think of this as the "default" sort value that will be applied when you add a new book for that author name.

However Calibre also stores an author_sort value with each and every single book. Ordinarily this will be identical to that stored for the author, in fact I can't think of a situation where you would want them to be different. Ever go into the Edit Metadata dialog and see the author sort box be red? That means the sort value stored for the book differs from the sort value stored for the author. If you are sure the value stored on the book is how you want it despite the box being red, that is a sign you need to go into the "Manage Authors" dialog and change the default for that author.

Why does Calibre store at book level as well at author level? That I have no idea on. The only reason I can think of as a performance optimisation - compared to the grief it causes I hope it was worthwhile It drove me insane to find say some books by "Smith, James" sorted under J and the rest under S when this went wrong for me in the early days of my using Calibre (even though both displayed the author as "Smith, James").

So... how does it go wrong and what can you do about it? Well for me it was a combination of changing the tweak and then manually changing book authors without changing the their default in the "Manage Authors" dialog. It could also be that you added some authors in LN, FN format before the tweak (so their author_sort was inverted to be FN, LN by default). Hence I ended up with a mish-mash mess which only a trip to the forums saved my insanity from.

Moral of the story. If you decide to go with this tweak don't forget to visit the Manage Authors dialog and make sure the values in there reflect what you want. If you focus on getting the "Author" column correct, you can then click the "Recalculate all author sort values" box to get it to *copy* all the author values to author sort, since you usually want them to be identical. Then when you click OK, Calibre will actually go update all of the books for each of those authors, so that the author_sort stored on each book is the same as that default value you just set for the author. From that point onwards you should rarely need to visit that dialog again.

Why does Calibre store at book level as well at author level? That I have no idea on. The only reason I can think of as a performance optimisation - compared to the grief it causes I hope it was worthwhile It drove me insane to find say some books by "Smith, James" sorted under J and the rest under S when this went wrong for me in the early days of my using Calibre (even though both displayed the author as "Smith, James").

It isn't performance.

It is mostly legacy. I added the individual author sort values sometime around the 0.7.15. Before that, the book's author sort what all that existed. Authors lists were sorted by author (not the sort), so people who used FN LN order saw the tag browser sorting differently from the library display.

Legacy aside, it can be useful to have a value per book in addition to a value per author. I have had situations where I wanted a book to sort by its second author (often edited books), and I am too compulsive to reorder the authors. In other cases I have had two spellings for the same author (myself included), and wanted some of the articles to sort with one spelling and some with the other. Some people mess with author_sort to get things to work on a specific device; before plugboards the kindle required that sort of thing to deal with its idiocies involving commas in names.

As a side note, I find it rather amusing that LN, FN in calibre is becoming mainstream. Last February when I added the basic tweak almost no one cared (I had one take-up on my first patch), which is why it ended up as a tweak (the very first one) instead of in the GUI. Just goes to show that no good deed goes unpunished.