Template:Cite UN World Population Prospects/doc

Generates a citation for the "World Population Prospects" spreadsheet of the United Nations Department of Economic and Social Affairs, Population Division.

Usage
1=

Parameters
One required positional parameter, and multiple named parameters:


 * 1, year of the report. Required, no default; legal values: 2019, 2022.

All named parameters are optional. These four are unique to this template; normally, just use the first one or two, and default the rest:
 * rows, enter comma-separated spreadsheet row numbers or colon-separated ranges; e.g.,.
 * cols, enter comma-separated alphabetic spreadsheet column id's or colon ranges; e.g.:.
 * yes, abbreviates title, author, publisher; drops version and archive linkage; default: includes all fields and uses the long form.
 * tab, which tab on the spreadsheet contains the data; default: . Alias: sheet. Ex: if the WP article cites the "Medium variants" tab of the spreadsheet, then include Medium variants.

The remaining parameters are available if you need to override the defaults provided by the template, but should be left out otherwise. These parameters wrap Citation parameters of the same name; see Citation#Parameters for more information about these.
 * edition, default: See Citation#Edition, series, volume.
 * volume, default: the id in the header of the spreadsheet (in the 2022 version, cell 'E12': ) See Citation#Edition, series, volume.
 * version, series number of the population data; e.g., 2022 = '27'. See Citation#Edition, series, volume.
 * ref, you may use this param with harvid to set your own ref for sfn linkage, as a #CITEREF reference anchor. See Citation#Anchor. For usage examples, see below.
 * id, unique id; see Citation#Identifiers.

As inline citation
The template may be used as an inline citation, by placing it between ref tags:

This creates a footnote marker inline, generating and linking it with the complete citation in the references section in the footer of the article, just as if a complete Citation template had been used at that point in the body.

If desired, as with any inline citation, the ref tag may be named, to enable re-use inline in other parts of the transcluding demographic article: Some population data. . . . Some additional data needing a citation.

In cases where subsequent inline citations refer to different rows (country data) or columns (population or other statistics) from the spreadsheet, the rp template may be used with parameter at to specify different rows or columns than the first inline citation uses: Some population data. . . . Some data from country B.

With shortened footnotes
This template is designed for easy use with short citations, so you can add the cite UN WPP citation just once to the References section of the article, and then include multiple short footnote templates in-line in the article, each one with different value for the loc param, which will encode the row and column locations. Each inline short citation will link to the unique cite UN WPP citation in the References section of the article, so the long citation doesn't need to be repeated; it only has to be there once. See Help:Shortened footnotes for an introduction to shortened footnotes.

Note that you can put any text string as the value of loc, in particular, it doesn't have to be exactly 'rows' and 'cols'; it could be: undefined, or undefined, or  undefined, or whatever makes sense.

If you are using the UN WPP report on a page that uses shortened footnotes, then you can place just one copy of cite UN WPP in the "References" section (sometimes called "Bibliography", or "Works cited"), and refer to the citation using either standard &lt;ref>...&lt;/ref> tags, or using the sfn template. In this case, use the simplest version of cite UN WPP with only the required year; leave parameters rows and cols out. The row and column information will be provided in the sfn templates using the loc parameter of sfn, separated by a comma, so that each sfn reference can point to different rows and columns as necessary. See below.

For details about usage of sfn with loc, see.

Under the hood: Internally, the template automatically creates a simple #CITEREF reference anchor which is equivalent to the output of. So for 2022, it's equivalent to (i.e., ). This may be used in shortened footnotes to link to the full citation, such as via. See Anchored citations.

Examples
Example one – short footnotes

{{smalldiv| Monaco's 2021 population is small, with a low birth rate of 9.5.{{sfn|UN WPP|2022|loc=row 14133, cols M,Z}} Botswana's pop is bigger, and has a 26.1 CBR.{{tlc|sfn|UN WPP|2022|loc=row 7941, cols M,Z}} Belgium's is biggest, but has an NRR of 0.82.{{tlc|sfn|UN WPP|2022|loc=rows 13773, cols M,AB}}