Citation template for articles in magazines and periodicals.
- Module: Module:Cite magazine
TemplateData
Citation template for articles in magazines and periodicals
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Author | author | Author of the article | String | suggested |
| Article name | articlename | Title of the article | String | suggested |
| Magazine or journal | magazine | Name of the magazine or journal | String | suggested |
| Issue or volume | issue | Issue, volume, or number information (e.g. vol. 12, no. 3) | String | suggested |
| Publication date | date | Publication date of the article | Date | suggested |
| Pages | pages | Page range of the article | String | suggested |
| Page | page | Single page reference (used if pages is not set) | String | optional |
local p = {}
function p.cite(frame)
local args = require('Module:Arguments').getArgs(frame)
local parts = {}
-- Author
if args.author then
table.insert(parts, args.author)
end
-- Article title (quoted)
if args.articlename then
table.insert(parts, '"' .. args.articlename .. '"')
end
-- Magazine title (italicized)
if args.magazine then
table.insert(parts, "''" .. args.magazine .. "''")
end
-- Issue / volume
if args.issue then
table.insert(parts, args.issue)
end
-- Date
if args.date then
table.insert(parts, args.date)
end
-- Join core citation parts
local output = table.concat(parts, ", ")
-- Page or pages
if args.pages then
output = output .. ", pp. " .. args.pages
elseif args.page then
output = output .. ", p. " .. args.page
end
return output
end
return p