local typeIchnospeciesAuthority = ''
local typeOogenus = ''
local typeOogenusAuthority = ''
local typeOospecies = ''
local typeOospeciesAuthority = ''
if l.system == '' then
typeGenus = l.italicizeTypeName(args['type_genus'] or args['type genus'] or '')
typeGenusAuthority = args['type_genus_authority'] or args['type genus authority'] or ''
typeSpecies = l.italicizeTypeName(args['type_species'] or args['type species'] or '')
typeSpeciesAuthority = args['type_species_authority'] or args['type species authority'] or ''
elseif l.system == 'ichnos' then
typeIchnogenus = l.italicizeTypeName(args['type_ichnogenus'] or args['type ichnogenus'] or '')
typeIchnogenusAuthority = args['type_ichnogenus_authority'] or args['type ichnogenus authority'] or ''
typeIchnospecies = l.italicizeTypeName(args['type_ichnospecies'] or args['type ichnospecies'] or '')
typeIchnospeciesAuthority = args['type_ichnospecies_authority'] or args['type ichnospecies authority'] or ''
elseif l.system == 'veterovata' then
typeOogenus = l.italicizeTypeName(args['type_oogenus'] or args['type oogenus'] or '')
typeOogenusAuthority = args['type_oogenus_authority'] or args['type oogenus authority'] or ''
typeOospecies = l.italicizeTypeName(args['type_oospecies'] or args['type oospecies'] or '')
typeOospeciesAuthority = args['type_oospecies_authority'] or args['type oospecies authority'] or ''
end
-- ------------------------------------------------
-- now call Taxobox/core with all of its parameters
-- ------------------------------------------------
res = res .. :expandTemplate{ title = 'Taxobox/core', args =
{ ichnos = ichnos,
veterovata = veterovata,
['edit link'] = 'e',
temporal_range = fossilRange,
display_taxa = args['display_parents'] or args['display parents'] or '1',
parent = taxon,
authority = authority,
parent_authority = parentAuthority,
grandparent_authority = args['grandparent_authority'] or args['grandparent authority'] or '',
greatgrandparent_authority = args['greatgrandparent_authority'] or args['greatgrandparent authority'] or '',
greatgreatgrandparent_authority = args['greatgreatgrandparent_authority'] or args['greatgreatgrandparent authority'] or '',
name = name,
colour = colour,
status = args['status'] or '',
status_system = args['status_system'] or args['status system'] or '',
status_ref = args['status_ref'] or args['status ref'] or '',
status2 = args['status2'] or '',
status2_system = args['status2_system'] or args['status2 system'] or '',
status2_ref = args['status2_ref'] or args['status2 ref'] or '',
trend = args['trend'] or '',
extinct = args['extinct'] or '',
image = args['image'] or '',
upright = args['image_upright'] or args['image upright'] or '',
image_alt = args['image_alt'] or args['image alt'] or '',
image_caption = args['image_caption'] or args['image caption'] or '',
image2 = args['image2'] or '',
upright2 = args['image2_upright'] or args['image2 upright'] or '',
image2_alt = args['image2_alt'] or args['image2 alt'] or '',
image2_caption = args['image2_caption'] or args['image2 caption'] or '',
classification_status = args['classification_status'] or args['classification status'] or '',
diversity = args['diversity'] or '',
diversity_ref = args['diversity_ref'] or args['diversity ref'] or '',
diversity_link = args['diversity_link'] or args['diversity link'] or '',
bold_first = boldFirst,
offset = offset,
genus = genusManual,
genus_authority = genusAuthority,
species = speciesManual,
binomial = binomial,
binomial_authority = binomialAuthority,
trinomial = args['trinomial'] or '',
trinomial_authority = args['trinomial_authority'] or args['trinomial authority'] or '',
type_genus = typeGenus,
type_genus_authority = typeGenusAuthority,
type_species = typeSpecies,
type_species_authority = typeSpeciesAuthority,
type_ichnogenus = typeIchnogenus,
type_ichnogenus_authority = typeIchnogenusAuthority,
type_ichnospecies = typeIchnospecies,
type_ichnospecies_authority = typeIchnospeciesAuthority,
type_oogenus = typeOogenus,
type_oogenus_authority = typeOogenusAuthority,
type_oospecies = typeOospecies,
type_oospecies_authority = typeOospeciesAuthority,
subdivision = subdivision,
subdivision_ref = subdivisionRef,
subdivision_ranks = subdivisionRanks,
type_strain = args['type_strain'] or args['type strain'] or '',
type_strain_ref = args['type_strain_ref'] or args['type strain ref'] or '',
range_map = args['range_map'] or args['range map'] or '',
range_map_upright = args['range_map_upright'] or args['range map upright'] or '',
range_map_alt = args['range_map_alt'] or args['range map alt'] or '',
range_map_caption = args['range_map_caption'] or args['range map caption'] or '',
range_map2 = args['range_map2'] or args['range map2'] or '',
range_map2_upright = args['range_map2_upright'] or args['range map2 upright'] or '',
range_map2_alt = args['range_map2_alt'] or args['range map2 alt'] or '',
range_map2_caption = args['range_map2_caption'] or args['range map2 caption'] or '',
range_map3 = args['range_map3'] or args['range map3'] or '',
range_map3_upright = args['range_map3_upright'] or args['range map3 upright'] or '',
range_map3_alt = args['range_map3_alt'] or args['range map3 alt'] or '',
range_map3_caption = args['range_map3_caption'] or args['range map3 caption'] or '',
range_map4 = args['range_map4'] or args['range map4'] or '',
range_map4_upright = args['range_map4_upright'] or args['range map4 upright'] or '',
range_map4_alt = args['range_map4_alt'] or args['range map4 alt'] or '',
range_map4_caption = args['range_map4_caption'] or args['range map4 caption'] or '',
synonyms_ref = args['synonyms_ref'] or args['synonyms ref'] or '',
synonyms = args['synonyms'] or ''
} }
-- put page in error-tracking categories if required
local errCat1 = ''
if genusManual ~= * or speciesManual ~= * or binomial ~= * then errCat1 = * end
local errCat2 = ''
if taxonParaMissingError then errCat2 = '' end
res = res .. :expandTemplate{ title = 'Main other', args = {errCat1..errCat2} }
return res
end  
-- =============================================================================
-- l.setfossilRange(, fossilRange, oldestFossil, youngestFossil) checks
-- the parameters that determine the fossil range, returning an appropriate
-- range.
-- =============================================================================
-- temporary public function for debugging
function p.chkFossilRange
local args = .args
local fossilRange = args['temporal_range'] or args['temporal range'] or args['fossil_range'] or args['fossil range'] or ''
local oldestFossil = args['oldest_fossil'] or args['oldest fossil'] or ''
local youngestFossil = args['youngest_fossil'] or args['youngest fossil'] or ''
local fossilRange = l.setfossilRange(, fossilRange, oldestFossil, youngestFossil)
return fossilRange
end  
function l.setfossilRange(, fossilRange, oldestFossil, youngestFossil)
local res = ''
if fossilRange ~= '' then
if mw.ustring.find(:expandTemplate{ title = 'Period start', args = { fossilRange } }, '[Ee]rror') then
res = fossilRange
else
res = :expandTemplate{ title = 'Geological range', args = { fossilRange } }
end
elseif oldestFossil ~= '' then
if youngestFossil == '' then youngestFossil = 'Recent' end
if mw.ustring.find(:expandTemplate{ title = 'Period start', args = { oldestFossil } }, '[Ee]rror') or
mw.ustring.find(:expandTemplate{ title = 'Period start', args = { youngestFossil } }, '[Ee]rror') then
res = oldestFossil..'–'..youngestFossil
else
res = :expandTemplate{ title = 'Geological range', args = { oldestFossil, youngestFossil } }
end
end
return res
end  
-- =============================================================================
-- l.italicizeTypeName(typeName) checks whether the name of a type genus or
-- species should be italicized, because it appears to be a bare name.
-- =============================================================================  
function l.italicizeTypeName(typeName)
if typeName and not (string.find(typeName, "<", 1, true) or string.find(typeName, ">", 1, true)) then