Template:Page range/doc

This is a convenience template for those with difficulty remembering which character to use between page-number ranges, or who have accessibility or other issues getting to the correct character, en dash –.


 * It will take two page numbers (including roman numerals and such) and create a range from them: →
 * It can also take copy-pastes of existing ranges in any sensible format as a single parameter and create ranges from them: or  →

This template should always be substituted with, inside a p citation (where substitution does not work); in that case, just use  and a bot will replace it later. This substitution/replacement is so that wikicode junk is not retained where unnecessary or where it "pollutes" the citation metadata.

Because is trims out unnecessary whitespace, it cannot be used for complex cases that contain spaces, such as "plate 7 – plate 9", though this information can be done more concisely using this template as  → plates. Because of the white-space stripping, it is also not appropriate for date (or other complex) ranges.

Usage
Two parameters:


 * The first parameter is the first page number of the range.
 * The second parameter is the ending page number of the range.

One parameter:

,, etc.


 * The single parameter is the entire page range, with the first and last pages separated by any dash/hyphen sort of character that is apt to be found in Western languages (plus a few East Asian ones).

All of these characters are detected: -, –, —, ‒, −, ―, ⁓, ‐, ‑, ﹘, ﹣, －. This should handle copy-pasted page ranges from source material in just about any format, especially since it automatically handles any whitespacing.

Trims whitespace


Consequently, you cannot do something like ; it needs to be

Substitution does not work inside ref tags!
Doing  will not actually work to substitute the template, due to a limitation of the MediaWiki parser. What will happen is the  wikicode itself will display in the citation instead of the template's intended output.

Instead, just do, and a bot that looks for "This template should always be substituted" templates like this one will fix it later.

Complex cases
This template is not "magic" and is not doing complicated parsing of three of more parameters.
 * If you have something like "pp. vi–ix, 23-25, 27, 92, 120–121, appendix 2" to mark up, use one of: