Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a23ed9119bdef4d4

Jump to content

Template:Chembox/doc

From Wikipedia, the free encyclopedia

Template {{Chembox}} is an infobox for chemicals. It has a large number of options to add relevant data and images. The infobox is organized in sections like "identifiers" and "hazards".

Usage

The Chembox has a modular design. After the general information like the chemical name and images, it can be built from multiple sections, each covering a group of information (like "pharmacology"). Depending on the compound, sections can be added or left out, and within a section parameters can be added or omitted (left blank).

The sections and their parameters are listed below in three example layouts: § Small, simple form, § Medium form and § Full form.

Within the general chembox template (with its own parameters like |ImageFile= and |IUPACName=), each section is added with this pattern (as the value of a parameter |Sectionx=.

{{Chembox
| ImageFile      = 
| IUPACName      = 
<!-- more general Chembox parameters here -->
| Section1       = {{Chembox Identifiers
| CASNo          = 
| PubChem        = 
<!-- more Identifier parameters here -->
  }}
}}

In this format, spaces and new lines have no meaning and can be used freely to separate sections (though within a data value, a space has a meaning, except generally leading and trailing spaces). Each section has its own number in |Section#=. Then a section is defined with "|Section# = {{Chembox " and ends with "}}". Sections cannot 'nest': one must close one section with }} before adding another |Section#= {{Chembox ....

Keep in mind the advice in the main Infobox documentation to use the {{Unbulleted list}} template to present multiple values for a parameter so as to ensure that the values are each started on a new line and tagged appropriately in the underlying markup. This is particularly important with parameters like |OtherNames=, since many names use commas within them, and using commas as separators leads to ambiguity. For example:

| OtherNames     = {{Unbulleted list
  | 2,4,6(1''H'',3''H'',5''H'')-pyrimidinetrione
  | 2,4,6-trioxohexahydropyrimidine
  | pyrimidinetriol
  | malonylurea
  | 6-hydroxyuracil
  | ''N'',''N''-(1,3-dioxo-1,3-propanediyl)urea
  }}
| (nextparameter)= <!-- etc. -->

Small, simple form

To use, simply copy and paste the left column into the document, filling in whatever you can, and save:

{{Chembox
<!-- Images -->
| ImageFile      = 
| ImageSize      = 
| ImageAlt       = 
<!-- Names -->
| IUPACName      = 
| OtherNames     = 
<!-- Sections -->
| Section1       = {{Chembox Identifiers
| CASNo          = 
| PubChem        = 
| SMILES         = 
  }}
| Section2       = {{Chembox Properties
| Formula        = 
| MolarMass      = 
| Appearance     = 
| Density        = 
| MeltingPt      = 
| BoilingPt      = 
| Solubility     = 
  }}
| Section3       = {{Chembox Hazards
| MainHazards    = 
| FlashPt        = 
| AutoignitionPt = 
  }}
}}

Medium form

To use, simply copy and paste the left column into the document, filling in whatever you can:

{{Chembox
| Reference       = <!-- Reference, use {{tag|ref}} and add {{tag|references|e}} to the page -->
<!-- Names -->
| Name            = <!-- Title (default: article name) -->
| IUPACName       = <!-- IUPAC name -->
| PIN             = <!-- The preferred name -->
| SystematicName = <!-- The systematic name(s) -->
| OtherNames      = {{Unbulleted list <!-- Any other name(s) -->
  | ''name1''
  | ''name2''
  ...
  | ''name50''
  }}
| data page pagename = <!-- A non-default data page name (default, eg for ammonia: "[[Ammonia (data page)]]") -->
<!-- Images -->
| ImageFile       = <!-- Like filename.svg (not [[file:filename.svg]]) -->
| ImageSize       = <!-- Picture width (default=220px; example: ImageSize=100px) -->
| ImageAlt        = <!-- Alt text for picture (example: Fine dry white powder) -->
| ImageName       = <!-- Image link title -->
| ImageClass      = <!-- Set this to "skin-invert" for black-on-transparent chemical diagrams -->
| ImageCaption    = <!-- Picture caption (example: Oxygen in liquid form) -->
| ImageFile1 = | ImageSize1 = | ImageAlt1 = | ImageName1 = | ImageClass1 = | ImageCaption1 = 
| ImageFileL1 = | ImageSizeL1 = | ImageAltL1 = | ImageNameL1 = | ImageClassL1 = 
| ImageFileR1 = | ImageSizeR1 = | ImageAltR1 = | ImageNameR1 = | ImageClassR1 = 
<!-- Sections -->
| Section1 = {{Chembox Identifiers <!-- {{Chembox Identifiers}} -->
| Abbreviations  = <!-- Any abbreviations -->
| CASNo          = <!-- CAS Number, links to eMolecules -->
| ChEBI          = <!-- ChEBI, links to EBI -->
| EINECS         = <!-- EINECS, links to ecb; URL is [http://ecb.jrc.it/esis/index.php?GENRE=ECNO&ENTREE=] -->
| EC_number      = <!-- EINECS, links to ecb, different URL [http://ecb.jrc.it/esis/index.php?GENRE=CASNO&ENTREE=] -->
| InChI          = <!-- InChI, no link -->
| KEGG           = <!-- KEGG, links to genome.ad.jp -->
| MeSHName       = <!-- Medical Subject Headings, links to NIH -->
| PubChem        = <!-- PubChem, links to pubchem -->
| RTECS          = <!-- RTECS, no link -->
| SMILES         = <!-- SMILES, no link -->
  }}
| Section2 = {{Chembox Properties <!-- {{Chembox Properties}}: physical properties -->
| AtmosphericOHRateConstant = <!-- Atmospheric OH rate constant -->
| Appearance     = <!-- Its appearance -->
| BoilingPt      = <!-- Boiling point description; optional. E.g. "Decomposes at" -->
| BoilingPtC     = <!-- Temperature, number only. Can be a range: '100 to 200' -->
| BoilingPt_notes= <!-- Notes on boiling point -->
| Density        = <!-- Density, including unit -->
| Formula        = <!-- The molecular formula -->
| HenryConstant  = <!-- Henry's law constant (kH) -->
| LogP           = <!-- Partition coefficient -->
| MolarMass      = <!-- Molecular weight, including unit -->
| MeltingPt      = <!-- Melting point description; optional. E.g. "Decomposes at" -->
| MeltingPtC     = <!-- Temperature, number only. Can be a range: '100 to 200' -->
| MeltingPt_notes= <!-- Notes on melting point -->
| Solubility     = <!-- Solubility in water -->
| SolubleOther   = <!-- Solubility in other solvents, goes together with next -->
| Solvent        = <!-- In which solvent it is soluble -->
| VaporPressure  = <!-- Vapor pressure -->
  }}
| Section3 = {{Chembox Structure <!-- {{Chembox Structure}}: crystal structure -->
| Coordination   = <!-- Coordination -->
| CrystalStruct  = <!-- Crystal structure -->
| MolShape       = <!-- Molecular shape -->
  }}
| Section4 = {{Chembox Thermochemistry <!-- {{Chembox Thermochemistry}} -->
| DeltaGf = | DeltaHc = | DeltaHf = | Entropy = | HeatCapacity = 
  }}
| Section5 = {{Chembox Explosive <!-- {{Chembox Explosive}} -->
| ShockSens      = <!-- [[Shock sensitivity]] -->
| FrictionSens   = <!-- [[Friction sensitivity]] -->
| DetonationV    = <!-- [[Explosive velocity]] -->
| REFactor       = <!-- [[Relative effectiveness factor]] -->
  }}
| Section6 = {{Chembox Pharmacology <!-- {{Chembox Pharmacology}}: drug data -->
| ATCvet         = <!-- ATCvet=yes if the next two parameters define an ATCvet code -->
| ATCCode_prefix = <!-- ATCCode prefix (first three characters, omit the leading Q for ATCvet codes) -->
| ATCCode_suffix = <!-- ATCCode suffix (last 4 characters), full ATC links to WHO C.C. -->
| ATC_Supplemental= <!-- Other ATC codes (use the {{ATC}} and/or {{ATCvet}} templates) -->
| AdminRoutes = | Bioavail = | Excretion = | HalfLife = | Metabolism = 
| Legal_status   = <!-- Legal status -->
| Legal_AU = | Legal_CA = | Legal_NZ = | Legal_US = | Legal_UK = | Legal_EU = | Legal_UN = 
| Pregnancy_category = <!-- Pregnancy Category -->
| Pregnancy_AU   = <!-- Pregnancy Category in AU -->
| ProteinBound   = <!-- Protein Bound -->
  }}
| Section7 = {{Chembox Hazards <!-- {{Chembox Hazards}} -->
| AutoignitionPt = <!-- Autoignition temperature -->
| ExploLimits    = <!-- Explosion limits -->
| FlashPt        = <!-- Flash point -->
| LD50 = | LC50 = | MainHazards = <!-- Main hazards -->
| NFPA-H         = <!-- [[NFPA 704|NFPA]]-H: Health hazard 0–4 ([[NFPA 704#blue|blue]]) -->
| NFPA-F         = <!-- NFPA-F: Fire hazard 0–4 ([[NFPA 704#red|red]]) -->
| NFPA-I         = <!-- NFPA-I: Instability hazard 0–4 ([[NFPA 704#yellow|yellow]]) -->
| NFPA-S         = <!-- NFPA-S: Special hazards ([[NFPA 704#white|white]]): W, OX, COR, ALK, ACID, CRYO, RA -->
| PEL = | REL = | ExternalSDS = <!-- URL for [[Safety data sheet]] -->
| HPhrases       = <!-- HPhrases: use the {{H-phrases}} template for this -->
| PPhrases       = <!-- PPhrases: use the {{P-phrases}} template for this -->
  }}
| Section9 = {{Chembox Related <!-- {{Chembox Related}}: related substances -->
| OtherAnions = | OtherCations = 
| OtherFunction  = <!-- Other compounds with a given function -->
| OtherFunction_label = <!-- The given function -->
| OtherCompounds = <!-- Other compounds: adds a chemical 'see also' section -->
  }}
}}

Full form

To use, simply copy and paste the left column into the document, and press save to get an empty Chembox:

Indexed parameters

| CASNo = 
| CASNo1 = 
| CASNo2 = 
| CASNo3 = 
| CASNo4 = 
| CASNo5 = 
| CASNoOther =

Indexed parameters take indexes 'blank', 15 (six options together). They should have straight input, such as a correct CAS Registry Number.

  • Eight base parameters are indexed this way, all identifiers:
CASNo, ChEBI, ChEMBL, ChemSpiderID, DrugBank, InChI, KEGG, PubChem, SMILES, UNII, 3DMet, EC_number, RTECS
  • Then |_Other= (like |CASNoOther=) is available for free text input.
Same substance, same index

When the chembox has multiple substances, you can use the index. Make sure that |CASNo3= and |SMILES3= are about the same substance, and |CASNo3= and |SMILES2= are not. Treat index "0" the same way:

|CASNo= is |InChI= is |SMILES=
|CASNo1= is |InChI1= is |SMILES1=
|CASNo= is not |InChI1= is not |SMILES4=
Labeling the substances

By using a parameter like |index2_label=, you can prefix every #2-input with that same prefix.

{{chembox
| Name           = [[Linalool]]
|Section1        = {{Chembox Identifiers
| index_label    = 
| index1_label   = (''R'')
| index2_label   = (''S'')
| index_comment  = (+/−)-linalool
| index1_comment = (−)-linalool
| index2_comment = (+)-linalool
| CASNo          = 78-70-6
| CASNo1         = 126-91-0
| CASNo2         = 126-90-9
| CASNo_Ref      = {{cascite|correct|CAS}}
| PubChem        = 6549
| PubChem1       = 443158
| PubChem2       = 67179
  }}
}}
Linalool
Identifiers
  • Compounds
  • (+/−)-linalool
  • (R): (−)-linalool
  • (S): (+)-linalool
  • For specific additions, each parameter has a |_Comment= option.
| CASNo_Comment  = 
| CASNo1_Comment = 
| CASNo5_Comment =
  • Use of the |CASNo_Ref={{cascite|correct|CAS}} parameter with argument places a small, green check mark,  checkY , after the CAS No., which indicates that an editor has confirmed that the CAS No. is correct. A red x in an infobox that follows any identifier means it has not been verified. See WP:CHEMVAL for more details.

Section subtemplates

The following section subtemplates are available:

And the automated section, that is visible when 'pagename (data page)' exists:

See these subsections for their parameter options.

The order of these sections in the infobox is set by the section number (|Section#=) only. Not by the typed sequence. This documentation keeps this arbitrary order:

| Section1 = {{Chembox Identifiers}}
| Section2 = {{Chembox Properties}}
| Section3 = {{Chembox Structure}}
| Section4 = {{Chembox Thermochemistry}}
| Section5 = {{Chembox Explosive}}
| Section6 = {{Chembox Pharmacology}}
| Section7 = {{Chembox Hazards}}
| Section8 = {{Chembox Related}}

Sections that are not used can be safely removed, renumbering is not necessary.

Container only

{{Chembox}} can be used to show a subsection only, for example Section3={{Chembox Hazards|...}}. When set |container_only=yes: The main {{Chembox}} is not tracked at all (image checks, bot validation categories, etc.), and the Footer (with STP notice) is suppressed. Example: Bromine#Biological role and toxicity. The article will be listed in Category:Chembox container only (55).

Automatic generation

The Wikipedia Drugbox and Chembox Maker can be used to automatically generate chembox templates. For quicker access, this tool can be added to the tools section of Wikipedia's left sidebar via User:Qwerfjkl/scripts/chemboxmaker. The Wikipedia template filling tool by Diberri and Boghog is another option for automatic chembox generation but fills fewer fields.

Adding images

Parameters

Image parameters for the first images:

{{Chembox
<!-- Other chembox parameters can go here -->
<!-- Row 1/7 -->
| ImageFile      = 
| ImageName      = 
| ImageSize      = 
| ImageAlt       = 
| ImageCaption   = 
| ImageFile_Ref  = 
| ImageClass     =
<!-- Row 2/7 -->
| ImageFile1     = 
| ImageName1     = 
| ImageSize1     = 
| ImageAlt1      = 
| ImageCaption1  = 
| ImageFile1_Ref = 
| ImageClass1    =
<!-- Row 3/7 -->
| ImageFileL1    = 
| ImageNameL1    = 
| ImageSizeL1    = 
| ImageAltL1     = 
| ImageCaptionL1 = 
| ImageFileL1_Ref= 
| ImageClassL1   =

| ImageFileR1    = 
| ImageNameR1    = 
| ImageSizeR1    = 
| ImageAltR1     = 
| ImageCaptionR1 = 
| ImageFileR1_Ref= 
| ImageClassR1   =

| ImageCaptionL1R1= 
<!-- More chembox parameters can go here, like |Section1=... -->
}}

Examples

Image parameters for an image (example: File1). All are optional.

Chembox/doc
Skeleton formula of a ring of four carbons and one oxygen, with a carbon-oxygen attached to a carbon next to an oxygen
A caption shows here
{{Chembox
| ImageFile1     = Furfural.svg
| ImageAlt1      = Skeleton formula of a ring of four carbons and one oxygen, with a carbon-oxygen attached to a carbon next to an oxygen
| ImageName1     = 
| ImageCaption1  = A caption shows here
| ImageSize1     = 
| ImageFile1_Ref = ref
| ImageClass1    = skin-invert <!-- Use this for black-on-transparent chemical diagrams -->
}}

Adding three images:

Chembox/doc
Skeleton formula of suvorexant
Ball-and-stick model of the same molecule
3D filled-sphere model of the same molecule
{{Chembox
| ImageFile      = Suvorexant.svg
| ImageClass     = skin-invert
| ImageAlt       = Skeleton formula of suvorexant
| ImageFile1     = Suvorexant-from-xtal-Mercury-3D-bs.png
| ImageClass1    = bg-transparent
| ImageAlt1      = Ball-and-stick model of the same molecule
| ImageFile2     = Suvorexant-from-xtal-Mercury-3D-sf.png
| ImageClass2    = bg-transparent
| ImageAlt2      = 3D filled-sphere model of the same molecule
}}

This gives three images, each image on his own row (note, ImageFile is the first image, ImageFile1 is the second, ImageFile2 is the third).

Adding two images, side by side (L1 and R1):

Chembox/doc
Skeleton formula of taurine
Ball-and-stick model of the same molecule
{{Chembox
| ImageFileL1    = Taurin.svg
| ImageClassL1   = skin-invert
| ImageAltL1     = Skeleton formula of taurine
| ImageFileR1    = Taurine-from-xtal-Mercury-3D-balls.png
| ImageClassR1   = bg-transparent
| ImageAltR1     = Ball-and-stick model of the same molecule
}}

This gives one row with two images. Note that ImageFile is now not supplied.

Multiple images

Chembox image ordering
row 1 ImageFile
row 2 ImageFile1
row 3 ImageFileL1ImageFileR1
row 4 ImageFile2
row 5 ImageFileL2ImageFileR2
row 6 ImageFile3
row 7 ImageFileL3ImageFileR3

This gives the possibility to play a bit with which image is first (rows with empty parameters are not displayed). Example:

Chembox/doc
Skeleton formula of a fused benzene and pyridazine ring, with a hydrazine (-NH-NH₂) group attached to the 3-position of the pyridazine ring
Ball-and-stick model of the same molecule
Ball-and-stick model of the same molecule
Names
IUPAC name
example
{{Chembox
| ImageFileL1    = Hydralazine.svg
| ImageAltL1     = Skeleton formula of a fused benzene and pyridazine ring, with a hydrazine (-NH-NH₂) group attached to the 3-position of the pyridazine ring
| ImageClassL1   = skin-invert
| ImageFileR1    = Hydralazine-based-on-xtals-3D-bs-17.png
| ImageClassR1   = bg-transparent
| ImageAltR1     = Ball-and-stick model of the same molecule
| ImageFile2     = Hydralazine-3D-spacefill.png
| ImageClass2    = bg-transparent
| ImageAlt2      = Ball-and-stick model of the same molecule
| IUPACName      = example
}}

This gives one row with two images, and one row with one image.

Names

{{Chembox
<!-- Names -->
| Name           = <!-- Infobox title (Pagetitle is default) -->
| IUPACName      = <!-- IUPAC name -->
| IUPACNames     = <!-- Using -s makes section header plural -->
| PIN            = <!-- Preferred IUPAC name -->
| SystematicName = <!-- Systematic IUPAC name -->
| OtherNames     = <!-- List of all other name(s) -->
<!-- other parameters -->
}}

Example

cis-3-Hexen-1-ol
Names
IUPAC names
A, B
Preferred IUPAC name
PIN
Systematic IUPAC name
SYS
Other names
  • X
  • Y
  • Z
{{Chembox
| Name           = ''cis''-3-Hexen-1-ol
| IUPACNames     = A, B
| PIN            = PIN
| SystematicName = SYS
| OtherNames     = {{Unbulleted list|X|Y|Z}}
| show_footer    = no
}}

Input from Wikidata

E number, ECHA InfoCard ID, |DTXSID= (CompTox Chemicals Dashboard) are read from Wikidata.

Maintenance

Troubleshooting

  • When supplying a parameter with a value, and nothing or the wrong value shows up, check:
    • Is the parameter placed in the correct section?
    • Are the sections properly defined? Sections start with | Section# = {{Chembox sectionname | and end with }}.
    • Is there inconsistency in the Section numbering? Available numbers for sections are 19.

Tracking categories

TemplateData

See a monthly parameter usage report for Template:Chembox in articles based on its TemplateData.

TemplateData for Chembox

See also