This template formats 9-digit SBN's, 10- and 13-digit ISBNs according to the rules determined by the International ISBN Agency.[1]


Usage

The template takes as argument a valid ISBN and yields the formatted version of that ISBN. Any existing hyphens in the ISBN are ignored, whether or not they are correctly placed:

((format ISBN|97-8-1-57181655-9)) → 978-1-57181-655-9

((Format ISBN)) is intended to be substituted so that the template call in wikitext is replaced with the formatted ISBN. Substitution may be accomplished in two ways. The easiest and most reliable method is to simply write the template like you would write any other template. After your edit is published, AnomieBOT will, usually within a few hours, perform the substitution. The other method is to write an explicitly substitutable form of the template which will cause the template to be substituted when your edit is published:

((subst:format ISBN|9781571816559)) → 978-1-57181-655-9

Warning: subst: does not work inside <ref>...</ref> tags (see phab:T4700). For use inside <ref>...</ref> tags, use the template directly and allow AnomieBOT to do the substitution:

<ref> ... ((format ISBN|9781571816559)) ... </ref>

Note that if you write this:

<ref> ... ((subst:format ISBN|9781571816559)) ... </ref>

AnomieBOT will not substitute the template.

Parameters

This template accepts three parameters; one unnamed and two named:

Invalid ISBNs

If the unnamed parameter to this template does not consist of 9, 10, or 13 digits, or the check digit is not what was expected from the rest of the number, the input number is returned without modification. In such a case formatting is not possible, because any of the digits might be wrong, and that would affect the placement of the hyphens. The template is intended for use within an enclosing template, which will report any errors with the length, check digit, or invalid characters. In this example of the Format ISBN template, the input to ((Format ISBN)) has an incorrect check digit so the template returns its input unmodified:

((format ISBN|9789295055123)) → 9789295055123

When this template, using the same invalid ISBN, is enclosed in ((ISBN)) or ((cite book)), appropriate error messages are displayed by those templates:

Nota bene: Substitution will occur regardless of the validity of the input ISBN; previewing your edits is suggested.

More examples

ISBN13

ISBN10

SBN

Invalid input

Using the optional parameters

References

  1. ^ "Structure of the ISBN" (PDF). ISBN Users' Manual: International Edition (7th ed.). London: International ISBN Agency. 2017. pp. 11–12. ISBN 978-92-95055-12-4 – via Kungliga Biblioteket.
  2. ^ a b Rowe, Adam (November 29, 2019). "The 10-Digit ISBN Is Getting Retired Next Year". Forbes. Archived from the original on 2019-12-02. In order to stop misidentifications, all US systems will need to effectively retire the 10-digit signifier before they start processing new titles with the 979 prefix.

See also