23–25
This template should always be substituted (i.e., use {{subst:Page range}} ). Any accidental transclusions will be automatically substituted by a bot. |
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 –.
{{subst:page range|vi|ix}}
→ vi–ix{{subst:page range|vi-ix}}
or {{subst:page range|vi - ix}}
→ vi–ixThis template should always be substituted with {{subst:page range|...}}
, except inside a <ref>...</ref>
citation (where substitution does not work); in that case, just use {{page range|...}}
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 {{subst:page range|7|9}}
→ plates 7–9. Because of the white-space stripping, it is also not appropriate for date (or other complex) ranges.
Two parameters:
{{subst:page range|23|25}}
One parameter:
{{subst:page range|23-25}}
, {{subst:page range|23 – 25}}
, etc.
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.
{{page range|48|49}}
→ 48–49{{page range| 50| 51}}
→ 50–51{{page range|52 |53 }}
→ 52–53{{page range| 54 | 55 }}
→ 54–55{{page range|60-61}}
→ 60–61{{page range| 62-63}}
→ 62–63{{page range| 64-65 }}
→ 64–65{{page range|66 - 67}}
→ 66–67{{page range| 68 - 69 }}
→ 68–69Consequently, you cannot do something like Yang (2024), pp.{{subst:page range| 70|71}}
; it needs to be Yang (2024), pp. {{subst:page range|70|71}}
Doing <ref>Yang (2024), pp. {{subst:page range|70|71}}</ref>
will not actually work to substitute the template, due to a limitation of the MediaWiki parser. What will happen is the {{subst:page range|70|71}}
wikicode itself will display in the citation instead of the template's intended output.
Instead, just do <ref>Yang (2024), pp. {{page range|70|71}}</ref>
, and a bot that looks for "This template should always be substituted" templates like this one will fix it later.
This template is not "magic" and is not doing complicated parsing of three of more parameters.
pp. {{subst:page range|vi|ix}}, {{subst:page range|23|25}}, 27, 92, {{subst:page range|120|121}}, appendix 2
pp. {{subst:page range|vi-ix}}, {{subst:page range|23-25}}, 27, 92, {{subst:page range|120-121}}, appendix 2
{{date range}}
{{frac}}
{{ratio}}