Memory Beta:Category sort keys

In the category tree, it is important to use a sort key when tagging an article with a categorization. This aids in the ordering of the articles when they are viewed from the category they are suggested to be placed into.

Category sort keys are entered into the " [[Category: " tag by means of a piped link. A few different general sorting rules are applied here, but be careful -- individual categories may have special rules, dependant of the topic of the article -- they will be listed on individual [[Help:talk page|talk pages]] if they apply. Otherwise, the following situations are standard:

Surnames
For species with definitive first and last name structures, such as humans or Cardassians, use the following form to alphabetize them by last name:
 * in Skrain Dukat
 * in Elim Garak
 * Remember it would be inappropriate to sort by the last name only -- Categorizing John Q. Phillips as would be incorrect because omitting the first name will ruin the sort if there are more than one person. Please do not assume that just because there aren't two people by that name now, there won't be later -- it would be very troublesome of you categorized everyone's last names without the first, whether they are the only Phillips or not.
 * Remember it would be inappropriate to sort by the last name only -- Categorizing John Q. Phillips as would be incorrect because omitting the first name will ruin the sort if there are more than one person. Please do not assume that just because there aren't two people by that name now, there won't be later -- it would be very troublesome of you categorized everyone's last names without the first, whether they are the only Phillips or not.
 * Remember it would be inappropriate to sort by the last name only -- Categorizing John Q. Phillips as would be incorrect because omitting the first name will ruin the sort if there are more than one person. Please do not assume that just because there aren't two people by that name now, there won't be later -- it would be very troublesome of you categorized everyone's last names without the first, whether they are the only Phillips or not.

This will alphabetize the results in the category:
 * Skrain Dukat
 * Elim Garak

Roman numerals
For items listed with roman numerals, the sort key should convert them to digits with an appropriate number of leading zeroes. For example, planets are numbered with two digit places:
 * in Alpha IX

If you didn't add the sort key, the following problem would occur:
 * Alpha IV (04)
 * Alpha IX (09)
 * Alpha V (05)
 * Alpha X (10)

Numerical
For items listed with numbers, leading zeroes need to be added in order to maintain the sort. For example, sectors are numbered with six digit places - five for the maximum number of digits plus one leading zero to list all articles under the same heading:
 * in Sector 30

If you didn't add the sort key, the following problem would occur:
 * Sector 29999
 * Sector 30
 * Sector 30000

Titles
For titles of novels or other works, alphabetization never includes "The" or "A" occurring at the beginning of the title:
 * in The Eyes of the Beholders
 * in A Rock and a Hard Place
 * in A Rock and a Hard Place

The stories sort correctly:
 * Encounter at Farpoint
 * The Eyes of the Beholders
 * A Rock and a Hard Place

Sort keys can of course be omitted if the articles are ready to be alphabetized as they were originally titled.