Difference between revisions of "Template:Chem2/testcases"
imported>DePiep |
imported>DePiep (linee wrap test) |
||
| Line 1: | Line 1: | ||
{{Testcases notice <!--|toc=on-->}} | {{Testcases notice <!--|toc=on-->}} | ||
==from Doc== | ==from Doc== | ||
| + | :{{tlf|Chems}} | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| Line 72: | Line 73: | ||
* <code><nowiki>{{chem2|auto=yes|CH3CH2CH3CBrFCIClCH3}}</nowiki></code> gives {{chem2|auto=yes|CH3CH2CH3CBrFCIClCH3}} | * <code><nowiki>{{chem2|auto=yes|CH3CH2CH3CBrFCIClCH3}}</nowiki></code> gives {{chem2|auto=yes|CH3CH2CH3CBrFCIClCH3}} | ||
| − | === | + | ===All \sandbox=== |
| + | ;{{tlf|Chems\sandbox}} | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| Line 331: | Line 333: | ||
* Mn2(2+) is {{chem2\sandbox|Mn2(2+)}} | * Mn2(2+) is {{chem2\sandbox|Mn2(2+)}} | ||
* Mn22(2+) is {{chem2\sandbox|Mn22(2+)}} | * Mn22(2+) is {{chem2\sandbox|Mn22(2+)}} | ||
| + | |||
| + | ==Line wrapping== | ||
| + | == Unexpected wrapping == | ||
| + | |||
| + | {| align=right class=wikitable style="margin-left:32px" | ||
| + | ! colspan=3 | Table 1: Incnis Mrsi original post demo<br/>{{nobold|1=(extended by DMacks)}} | ||
| + | |- | ||
| + | !rowspan=17 |Incnis<br/>Mrsi's<br/>original | ||
| + | !Running<br/>text | ||
| + | !class=<br/>"nowrap" | ||
| + | |- | ||
| + | |<div style="max-width:2.75em; overflow:hidden">{{chem2|CO3(2-)}}</div> | ||
| + | |<div style="max-width:2.75em; overflow:hidden" class="nowrap">{{chem2|CO3(2-)}}</div> | ||
| + | |- | ||
| + | |<div style="max-width:2.7em; overflow:hidden">{{chem2|CO3(2-)}}</div> | ||
| + | |<div style="max-width:2.7em; overflow:hidden" class="nowrap">{{chem2|CO3(2-)}}</div> | ||
| + | |- | ||
| + | |<div style="max-width:2.65em; overflow:hidden">{{chem2|CO3(2-)}}</div> | ||
| + | |<div style="max-width:2.65em; overflow:hidden" class="nowrap">{{chem2|CO3(2-)}}</div> | ||
| + | |- | ||
| + | |<div style="max-width:2.6em; overflow:hidden">{{chem2|CO3(2-)}}</div> | ||
| + | |<div style="max-width:2.6em; overflow:hidden" class="nowrap">{{chem2|CO3(2-)}}</div> | ||
| + | |- | ||
| + | |<div style="max-width:2.55em; overflow:hidden">{{chem2|CO3(2-)}}</div> | ||
| + | |<div style="max-width:2.55em; overflow:hidden" class="nowrap">{{chem2|CO3(2-)}}</div> | ||
| + | |- | ||
| + | |<div style="max-width:2.5em; overflow:hidden">{{chem2|CO3(2-)}}</div> | ||
| + | |<div style="max-width:2.5em; overflow:hidden" class="nowrap">{{chem2|CO3(2-)}}</div> | ||
| + | |- | ||
| + | |<div style="max-width:2.45em; overflow:hidden">{{chem2|CO3(2-)}}</div> | ||
| + | |<div style="max-width:2.45em; overflow:hidden" class="nowrap">{{chem2|CO3(2-)}}</div> | ||
| + | |- | ||
| + | |<div style="max-width:2.4em; overflow:hidden">{{chem2|CO3(2-)}}</div> | ||
| + | |<div style="max-width:2.4em; overflow:hidden" class="nowrap">{{chem2|CO3(2-)}}</div> | ||
| + | |- | ||
| + | |<div style="max-width:2.35em; overflow:hidden">{{chem2|CO3(2-)}}</div> | ||
| + | |<div style="max-width:2.35em; overflow:hidden" class="nowrap">{{chem2|CO3(2-)}}</div> | ||
| + | |- | ||
| + | |<div style="max-width:2.3em; overflow:hidden">{{chem2|CO3(2-)}}</div> | ||
| + | |<div style="max-width:2.3em; overflow:hidden" class="nowrap">{{chem2|CO3(2-)}}</div> | ||
| + | |- | ||
| + | |<div style="max-width:2.25em; overflow:hidden">{{chem2|CO3(2-)}}</div> | ||
| + | |<div style="max-width:2.25em; overflow:hidden" class="nowrap">{{chem2|CO3(2-)}}</div> | ||
| + | |- | ||
| + | |<div style="max-width:2.2em; overflow:hidden">{{chem2|CO3(2-)}}</div> | ||
| + | |<div style="max-width:2.2em; overflow:hidden" class="nowrap">{{chem2|CO3(2-)}}</div> | ||
| + | |- | ||
| + | |<div style="max-width:2.15em; overflow:hidden">{{chem2|CO3(2-)}}</div> | ||
| + | |<div style="max-width:2.15em; overflow:hidden" class="nowrap">{{chem2|CO3(2-)}}</div> | ||
| + | |- | ||
| + | |<div style="max-width:2.1em; overflow:hidden">{{chem2|CO3(2-)}}</div> | ||
| + | |<div style="max-width:2.1em; overflow:hidden" class="nowrap">{{chem2|CO3(2-)}}</div> | ||
| + | |- | ||
| + | |<div style="max-width:2.05em; overflow:hidden">{{chem2|CO3(2-)}}</div> | ||
| + | |<div style="max-width:2.05em; overflow:hidden" class="nowrap">{{chem2|CO3(2-)}}</div> | ||
| + | |- | ||
| + | |<div style="max-width:2.0em; overflow:hidden">{{chem2|CO3(2-)}}</div> | ||
| + | |<div style="max-width:2.0em; overflow:hidden" class="nowrap">{{chem2|CO3(2-)}}</div> | ||
| + | |- | ||
| + | !rowspan=3 |DMacks's<br/>additions | ||
| + | |<div style="max-width:2.0em; overflow:hidden">{{chem2|C6H12O6}}</div> | ||
| + | |<div style="max-width:2.0em; overflow:hidden class="nowrap">{{chem2|C6H12O6}}</div> | ||
| + | |- | ||
| + | |<div style="max-width:2.0em; overflow:hidden">{{chem2|C6H12O6}}</div> | ||
| + | |<div style="max-width:2.0em; overflow:hidden"><span class="nowrap">{{chem2|C6H12O6}}</span></div> | ||
| + | |- | ||
| + | |<div style="max-width:2.0em; overflow:hidden">{{chem2|2H2 + O2 -> 2H2O}}{{wbr}}+heat</div> | ||
| + | |<div style="max-width:2.0em; overflow:hidden"><span class="nowrap">{{chem2|2H2 + O2 -> 2H2O}}{{wbr}}+heat</span> | ||
| + | |} | ||
| + | |||
| + | Please, fix. {{serif|I}}’m lazy to investigate because have no privilege to edit many templates on this site. [[User:Incnis Mrsi|Incnis Mrsi]] ([[User talk:Incnis Mrsi|talk]]) 19:53, 16 August 2019 (UTC) | ||
| + | ::Noting for ping purposes that this is a continuation or more limited case than [[User:Jorge Stolfi|Jorge Stolfi]]'s thought in [[#Bad line breaks]]. [[User:DMacks|DMacks]] ([[User talk:DMacks|talk]]) 16:12, 17 August 2019 (UTC) | ||
| + | |||
| + | :The template here is a wrapper around the real functionality in {{module|Chem2}}. Keeping a chemical formula together is pretty important. But <code><[[Span and div|div]] class="nowrap"></code> around the whole result is not sufficient—see my first additional example. Using <code><[[Span and div|span]] class="nowrap"></code> (equivalent to {{tl|nowrap}}), my second example seems better in that regard. But I think we ''do'' want to allow breaking at whitespace, as in a chemical equation rather than just a single formula as in my third example. Even {{tl|wbr}} doesn't seem to allow breaking, despite what that template indicates. | ||
| + | : | ||
| + | :It seems heavy-handed to wrap each non-space chunk in the formula with its own <code>span</code>. Is there a CSS way to allow breaking ''only'' at whitespace (not at other word-breaks)? [[User:DMacks|DMacks]] ([[User talk:DMacks|talk]]) 16:10, 17 August 2019 (UTC) | ||
| + | :: Why namely CSS? A sane HTML code should be generated, not one full of loopholes for bad wrapping. Normally it’s a bad idea to permit one “word” (compound) to be broken, but for long ones—IMHO for cases even longer than examples below—a very thin space can be inserted in places where wrapping is tolerable. See below examples based on U+2009 space. [[User:Incnis Mrsi|Incnis Mrsi]] ([[User talk:Incnis Mrsi|talk]]) 17:04, 17 August 2019 (UTC) | ||
| + | {| class=wikitable | ||
| + | ! colspan=2 | Table 2 | ||
| + | |- | ||
| + | |<div style="max-width:5em; overflow:hidden">C<sub>2</sub>H<sub>5</sub> OH</div> | ||
| + | |<div style="max-width:6em; overflow:hidden">CH<sub>3</sub> COO<sup>−</sub></div> | ||
| + | |- | ||
| + | |<div style="max-width:4.5em;">C<sub>2</sub>H<sub>5</sub> OH</div> | ||
| + | |<div style="max-width:5.4em; overflow:hidden">CH<sub>3</sub> COO<sup>−</sub></div> | ||
| + | |- | ||
| + | |<div style="max-width:4em; overflow:hidden">C<sub>2</sub>H<sub>5</sub> OH</div> | ||
| + | |<div style="max-width:4.8em; overflow:hidden">CH<sub>3</sub> COO<sup>−</sub></div> | ||
| + | |- | ||
| + | |<div style="max-width:3.5em;">C<sub>2</sub>H<sub>5</sub> OH</div> | ||
| + | |<div style="max-width:4.2em; overflow:hidden">CH<sub>3</sub> COO<sup>−</sub></div> | ||
| + | |- | ||
| + | |<div style="max-width:3em; overflow:hidden">C<sub>2</sub>H<sub>5</sub> OH</div> | ||
| + | |<div style="max-width:3.6em; overflow:hidden">CH<sub>3</sub> COO<sup>−</sub></div> | ||
| + | |- | ||
| + | |<div style="max-width:2.5em;">C<sub>2</sub>H<sub>5</sub> OH</div> | ||
| + | |<div style="max-width:3.0em; overflow:hidden">CH<sub>3</sub> COO<sup>−</sub></div> | ||
| + | |- | ||
| + | |<div style="max-width:2.25em; overflow:hidden">C<sub>2</sub>H<sub>5</sub> OH</div> | ||
| + | |<div style="max-width:2.7em; overflow:hidden">CH<sub>3</sub> COO<sup>−</sub></div> | ||
| + | |- | ||
| + | |<div style="max-width:2em; overflow:hidden">C<sub>2</sub>H<sub>5</sub> OH</div> | ||
| + | |<div style="max-width:2.4em; overflow:hidden">CH<sub>3</sub> COO<sup>−</sub></div> | ||
| + | |- | ||
| + | |<div style="max-width:1.75em; overflow:hidden">C<sub>2</sub>H<sub>5</sub> OH</div> | ||
| + | |<div style="max-width:2.1em; overflow:hidden">CH<sub>3</sub> COO<sup>−</sub></div> | ||
| + | |- | ||
| + | | colspan=2 |Attention!<br/>It is not {{chem2}},</br>it is HTML. | ||
| + | |} | ||
| + | {{clear}} | ||
Revision as of 11:37, 11 September 2019
| This is the template test cases page for the sandbox of Template:Chem2. Script error: No such module "Purge". to update the examples. If there are many examples of a complicated template, later ones may break due to limits in MediaWiki, see the HTML comment "NewPP limit report" in the rendered page. You can also use Special:ExpandTemplates to examine the results of template uses. You can test how this page looks in the different skins with these links: |
from Doc
- {{Chems}}
| Symbol | Gives | Example | Output |
|---|---|---|---|
\s |
− | {{chem2|CH3\sCH3}} |
CH 3−CH 3 |
\d |
= | {{chem2|CH2\dCH2}} |
CH 2=CH 2 |
\t |
≡ | {{chem2|HC\tCH}} |
HC≡CH |
\q |
≣ | {{chem2|[Cl4Re\qReCl4](2−)|}} |
[Cl 4Re≣ReCl 4]2− |
\- |
- | ||
\\ |
\ | ||
\h |
η | ||
\h{1} |
η1- | ||
\m{1} |
μ1- | ||
-> |
→ | {{chem2|2H2 + O2 -> 2H2O}} |
2H 2 + O 2 → 2H 2O |
<-> |
⇌ | ||
* |
· | {{chem2|CoCl2*6H2O}} |
CoCl 2·6H2O |
\* |
* | {{chem2|Cp\*2Fe}} |
Cp* 2Fe |
_{} |
{{chem2|CH4_{(g)}|}} * |
CH 4 (g) | |
^{} |
{{chem2|^{13}CH4}} |
13 CH 4 | |
∇ |
∇ | {{chem2|∇}} |
∇ |
^ If the last character of the template input is }, MediaWiki will confuse it with the end-of-template tag }}. Adding | between the two resolves this ambiguity. Other options include instead inserting (space), {{null}} or <nowiki/>.
Formulas (without charge) are just written. Eg.:
{{chem2|CH3(CH2)5CH3}}gives CH
3(CH
2)
5CH
3{{chem2|Fe3S2(CO)9}}gives Fe
3S
2(CO)
9{{chem2|C_{''n''}H_{2''n''+2}|}}gives C
nH
2n+2
Charges are written inside parenthesis, otherwise its treated as +1 or −1, e.g.:
{{chem2|Na+}}gives Na+{{chem2|O2-}}gives O−
2 but can be written as{{chem2|O2(-)}}too.{{chem2|SO4(2-)}}gives SO2−
4{{chem2|S19(2+)}}gives S2+
19
Chemical equations can be written too. E.g.:
{{chem2|2 S + 3 O2 + 2 H2O -> 2 H2SO4}}gives 2 S + 3 O
2 + 2 H
2O → 2 H
2SO
4{{chem2|2S + 3O2 + 2H2O -> 2H2SO4}}gives 2S + 3O
2 + 2H
2O → 2H
2SO
4
The arrows can be written as -> or just →. All characters (and unicode markup) are valid input except \, = (Mediawiki use it), _ and - (endash etc.)
{{chem2|2 H2_{(g)} + O2_{(g)} -> 2H2O_{(g)}|}}gives 2 H
2
(g) + O
2
(g) → 2H
2O
(g){{chem2|NH2RCHCO2H <-> NH3+RCHCO2-}}gives NH
2RCHCO
2H ⇌ NH+
3RCHCO−
2
Hapticity and mu:
{{chem2|W(CO)3(PiPr3)2(\h{2}\-H2)}}gives W(CO)
3(PiPr
3)
2(η2--H
2){{chem2|auto=yes|W(CO)3(PiPr3)2(\h{2}\-H2)}}gives W(CO)
3(PiPr
3)
2(η2--H
2)
Links: Use link=<wiki page> or ordinary wiki link ([[ and ]]), e.g.:
{{chem2|link=Iron(III) chloride|FeCl3}}gives FeCl
3{{chem2|3[[hydrogen|H2]] + 2[[nitrogen|N2]] <-> 2[[ammonia|NH3]]}}gives 3H
2 + 2N
2 ⇌ 2NH
3
Auto links: Automatic link elements: Use auto=<something> (e.g. yes):
All \sandbox
- {{Chems\sandbox}}
| Symbol | Gives | Example | Output |
|---|---|---|---|
\s |
Template:Chem2\sandbox | {{chem2\sandbox|CH3\sCH3}} |
Template:Chem2\sandbox |
\d |
Template:Chem2\sandbox | {{chem2\sandbox|CH2\dCH2}} |
Template:Chem2\sandbox |
\t |
Template:Chem2\sandbox | {{chem2\sandbox|HC\tCH}} |
Template:Chem2\sandbox |
\q |
Template:Chem2\sandbox | {{chem2\sandbox|[Cl4Re\qReCl4](2−)|}} |
Template:Chem2\sandbox |
\- |
Template:Chem2\sandbox | ||
\\ |
Template:Chem2\sandbox | ||
\h |
Template:Chem2\sandbox | ||
\h{1} |
Template:Chem2\sandbox | ||
\m{1} |
Template:Chem2\sandbox | ||
-> |
Template:Chem2\sandbox | {{chem2\sandbox|2H2 + O2 -> 2H2O}} |
Template:Chem2\sandbox |
<-> |
Template:Chem2\sandbox | ||
* |
Template:Chem2\sandbox | {{chem2\sandbox|CoCl2*6H2O}} |
Template:Chem2\sandbox |
\* |
* | {{chem2\sandbox|Cp\*2Fe}} |
Template:Chem2\sandbox |
_{} |
{{chem2\sandbox|CH4_{(g)}|}} * |
Template:Chem2\sandbox | |
^{} |
{{chem2\sandbox|^{13}CH4}} |
Template:Chem2\sandbox | |
∇ |
Template:Chem2\sandbox | {{chem2\sandbox|∇}} |
Template:Chem2\sandbox |
^ If the last character of the template input is }, MediaWiki will confuse it with the end-of-template tag }}. Adding | between the two resolves this ambiguity. Other options include instead inserting (space), {{null}} or <nowiki/>.
Formulas (without charge) are just written. Eg.:
{{chem2\sandbox|CH3(CH2)5CH3}}gives Template:Chem2\sandbox{{chem2\sandbox|Fe3S2(CO)9}}gives Template:Chem2\sandbox{{chem2\sandbox|C_{''n''}H_{2''n''+2}|}}gives Template:Chem2\sandbox
Charges are written inside parenthesis, otherwise its treated as +1 or −1, e.g.:
{{chem2\sandbox|Na+}}gives Template:Chem2\sandbox{{chem2\sandbox|O2-}}gives Template:Chem2\sandbox but can be written as{{chem2\sandbox|O2(-)}}too.{{chem2\sandbox|SO4(2-)}}gives Template:Chem2\sandbox{{chem2\sandbox|S19(2+)}}gives Template:Chem2\sandbox
Chemical equations can be written too. E.g.:
{{chem2\sandbox|2 S + 3 O2 + 2 H2O -> 2 H2SO4}}gives Template:Chem2\sandbox{{chem2\sandbox|2S + 3O2 + 2H2O -> 2H2SO4}}gives Template:Chem2\sandbox
The arrows can be written as -> or just →. All characters (and unicode markup) are valid input except \, = (Mediawiki use it), _ and - (endash etc.)
{{chem2\sandbox|2 H2_{(g)} + O2_{(g)} -> 2H2O_{(g)}|}}gives Template:Chem2\sandbox{{chem2\sandbox|NH2RCHCO2H <-> NH3+RCHCO2-}}gives Template:Chem2\sandbox
Hapticity and mu:
{{chem2\sandbox|W(CO)3(PiPr3)2(\h{2}\-H2)}}gives Template:Chem2\sandbox{{chem2\sandbox|auto=yes|W(CO)3(PiPr3)2(\h{2}\-H2)}}gives Template:Chem2\sandbox
Links: Use link=<wiki page> or ordinary wiki link ([[ and ]]), e.g.:
{{chem2\sandbox|link=Iron(III) chloride|FeCl3}}gives Template:Chem2\sandbox{{chem2\sandbox|3[[hydrogen|H2]] + 2[[nitrogen|N2]] <-> 2[[ammonia|NH3]]}}gives Template:Chem2\sandbox
Auto links: Automatic link elements: Use auto=<something> (e.g. yes):
{{chem2\sandbox|auto=yes|CH3CH2CH3CBrFCIClCH3}}gives Template:Chem2\sandbox
- Examples
{{chem2\sandbox|[Cl4Re\qReCl4](2−)|}}gives Template:Chem2\sandbox{{chem2\sandbox|[Cl4Re\qReCl4](2-)|}}gives Template:Chem2\sandbox{{chem2\sandbox|NH2RCHCO2H <-> NH3+RCHCO2−}}gives Template:Chem2\sandbox
{{chem2\sandbox|\\hallo}}gives Template:Chem2\sandbox{{chem2\sandbox|H3CC\tCH <-> H2C\dC\dCH2}}gives Template:Chem2\sandbox{{chem2\sandbox|4 NH3 + 5 O2 -> 4 NO + 6 H2O}}gives Template:Chem2\sandbox
- "H2O → H2O" is Template:Chem2\sandbox
- "H2O_{(l)} -> H2O_{(g)}" is Template:Chem2\sandbox
- "4 NH3 + 5 O2 → 4 NO + 6 H2O" is Template:Chem2\sandbox
- " 4 NH3 + 5 O2 → 4 NO + 6 H2O" is Template:Chem2\sandbox
- " 4NH3 + 5O2 → 4NO + 6H2O" is Template:Chem2\sandbox
- " 2Mn2(+)" is Template:Chem2\sandbox
- " 2Mn2(+) + 3H2O" is Template:Chem2\sandbox
- Mn– is Template:Chem2\sandbox
- Mn2(2-) is Template:Chem2\sandbox
- Mn2☃+ is Template:Chem2\sandbox, Mn2(2–) is Template:Chem2\sandbox, Mn2(2☃–) is Template:Chem2\sandbox
- Mn2(+) is Template:Chem2\sandbox
- Mn2+ is Template:Chem2\sandbox
- Mn2(-) is Template:Chem2\sandbox
- Mn2- is Template:Chem2\sandbox
- {{chem2\sandbox|C_{''n''}H_{2''n'' + 2}|}} gives Template:Chem2\sandbox
- {{chem2\sandbox|C_{abc}|}} gives Template:Chem2\sandbox
- (chem gives C
nH
2n + 2) - {{chem2\sandbox|CoCl2*1.5H2O}} gives Template:Chem2\sandbox
- Mn22– is Template:Chem2\sandbox
- Cu2C2*H2O is Template:Chem2\sandbox
- Special
- {{chem2\sandbox|[Me2Al(\m{2}Me)]2}} gives Template:Chem2\sandbox
- {{chem2\sandbox|^{13}CO2}} gives Template:Chem2\sandbox
- {{chem2\sandbox|auto=yes|^{13}CO2}} gives Template:Chem2\sandbox
- {{chem2\sandbox|\h{5}(C5H5)2TiCl2}} gives Template:Chem2\sandbox
- {{chem2\sandbox|\h{5}\s(C5H5)}} gives Template:Chem2\sandbox
- {{chem2\sandbox|CH2\dCH2\sCH2\sC\tCH\qMn}} is Template:Chem2\sandbox
- {{chem2\sandbox|RC(OR’)3}} gives Template:Chem2\sandbox
- {{chem2\sandbox|C\\C}} gives Template:Chem2\sandbox
- {{chem2\sandbox|C2*NH3}} gives Template:Chem2\sandbox
- {{chem2\sandbox|C2*2NH3}} gives Template:Chem2\sandbox
- {{chem2\sandbox|C1.2H3.5}} gives Template:Chem2\sandbox
- {{chem2\sandbox|12|6|C}} is Template:Chem2\sandbox
- {{chem2\sandbox|12|C}} is Template:Chem2\sandbox
- {{chem2\sandbox|CH3\i{13}CH2CH3}} is Template:Chem2\sandbox
- {{chem2\sandbox|\{\{abc\}\}}} is Template:Chem2\sandbox
- C2(μ\-C) is Template:Chem2\sandbox
- SO4(2-) is Template:Chem2\sandbox
- 2Mn2(2+) is Template:Chem2\sandbox
- CH3-CH2-OH is Template:Chem2\sandbox
- [ZnCl4]- is Template:Chem2\sandbox
- [ZnCl4](2-) is Template:Chem2\sandbox
- AUTO: ((H2O)5{CoCl2})2 is Template:Chem2\sandbox
- Si(OH)4 is Template:Chem2\sandbox
- AUTO: Cu2C2*H2O is Template:Chem2\sandbox
- Cu2C2*2H2O is Template:Chem2\sandbox
- CuSO*2H2O is Template:Chem2\sandbox
- CuSO4*15H2O is Template:Chem2\sandbox
- CuSO4(H2O)5 is Template:Chem2\sandbox
- H+ + OH- → H2O is Template:Chem2\sandbox
- H → O is Template:Chem2\sandbox
- ZxPo4 is Template:Chem2\sandbox Unknown element
- ((Na)Cl is Template:Chem2\sandbox To many (
- Si(OH))4 is Template:Chem2\sandbox To many )
- Si&☃Si is Template:Chem2\sandbox
- Template:Chem2\sandbox
- More
- {{chem2\sandbox|Cl2O6|link=dichlorine hexoxide}} is Template:Chem2\sandbox
- [Fe(Phen)(Phen)3](2+) is Template:Chem2\sandbox
- AUTO: [Fe(Phen)(Phen)3](2+) is Template:Chem2\sandbox
- {{chem2\sandbox|[C2O2](2+)}} is Template:Chem2\sandbox
- {{chem2\sandbox|link=Tomato|SI4}} is Template:Chem2\sandbox
- H2SO4+ is Template:Chem2\sandbox
- Mn- is Template:Chem2\sandbox
- Mn22+ is Template:Chem2\sandbox, Mn22- is Template:Chem2\sandbox,
- Mn(2+) is Template:Chem2\sandbox
- Mn2(+) is Template:Chem2\sandbox
- Mn(22-) is Template:Chem2\sandbox
- Mn3(22-) is Template:Chem2\sandbox
- Mn(22+) is Template:Chem2\sandbox
- Mn2(22+) is Template:Chem2\sandbox
- Mn2(2+) is Template:Chem2\sandbox
- Mn22(2+) is Template:Chem2\sandbox
- Examples
{{chem2\sandbox|[Cl4Re\qReCl4](2−)|}}gives Template:Chem2\sandbox{{chem2\sandbox|[Cl4Re\qReCl4](2-)|}}gives Template:Chem2\sandbox{{chem2\sandbox|NH2RCHCO2H <-> NH3+RCHCO2−}}gives Template:Chem2\sandbox
{{chem2\sandbox|\\hallo}}gives Template:Chem2\sandbox{{chem2\sandbox|H3CC\tCH <-> H2C\dC\dCH2}}gives Template:Chem2\sandbox{{chem2\sandbox|4 NH3 + 5 O2 -> 4 NO + 6 H2O}}gives Template:Chem2\sandbox
- "H2O → H2O" is Template:Chem2\sandbox
- "H2O_{(l)} -> H2O_{(g)}" is Template:Chem2\sandbox
- "4 NH3 + 5 O2 → 4 NO + 6 H2O" is Template:Chem2\sandbox
- " 4 NH3 + 5 O2 → 4 NO + 6 H2O" is Template:Chem2\sandbox
- " 4NH3 + 5O2 → 4NO + 6H2O" is Template:Chem2\sandbox
- " 2Mn2(+)" is Template:Chem2\sandbox
- " 2Mn2(+) + 3H2O" is Template:Chem2\sandbox
- Mn– is Template:Chem2\sandbox
- Mn2(2-) is Template:Chem2\sandbox
- Mn2☃+ is Template:Chem2\sandbox, Mn2(2–) is Template:Chem2\sandbox, Mn2(2☃–) is Template:Chem2\sandbox
- Mn2(+) is Template:Chem2\sandbox
- Mn2+ is Template:Chem2\sandbox
- Mn2(-) is Template:Chem2\sandbox
- Mn2- is Template:Chem2\sandbox
- {{chem2\sandbox|C_{''n''}H_{2''n'' + 2}|}} gives Template:Chem2\sandbox
- {{chem2\sandbox|C_{abc}|}} gives Template:Chem2\sandbox
- (chem gives C
nH
2n + 2) - {{chem2\sandbox|CoCl2*1.5H2O}} gives Template:Chem2\sandbox
- Mn22– is Template:Chem2\sandbox
- Cu2C2*H2O is Template:Chem2\sandbox
- Special
- {{chem2\sandbox|[Me2Al(\m{2}Me)]2}} gives Template:Chem2\sandbox
- {{chem2\sandbox|^{13}CO2}} gives Template:Chem2\sandbox
- {{chem2\sandbox|auto=yes|^{13}CO2}} gives Template:Chem2\sandbox
- {{chem2\sandbox|\h{5}(C5H5)2TiCl2}} gives Template:Chem2\sandbox
- {{chem2\sandbox|\h{5}\s(C5H5)}} gives Template:Chem2\sandbox
- {{chem2\sandbox|CH2\dCH2\sCH2\sC\tCH\qMn}} is Template:Chem2\sandbox
- {{chem2\sandbox|RC(OR’)3}} gives Template:Chem2\sandbox
- {{chem2\sandbox|C\\C}} gives Template:Chem2\sandbox
- {{chem2\sandbox|C2*NH3}} gives Template:Chem2\sandbox
- {{chem2\sandbox|C2*2NH3}} gives Template:Chem2\sandbox
- {{chem2\sandbox|C1.2H3.5}} gives Template:Chem2\sandbox
- {{chem2\sandbox|12|6|C}} is Template:Chem2\sandbox
- {{chem2\sandbox|12|C}} is Template:Chem2\sandbox
- {{chem2\sandbox|CH3\i{13}CH2CH3}} is Template:Chem2\sandbox
- {{chem2\sandbox|\{\{abc\}\}}} is Template:Chem2\sandbox
- C2(μ\-C) is Template:Chem2\sandbox
- SO4(2-) is Template:Chem2\sandbox
- 2Mn2(2+) is Template:Chem2\sandbox
- CH3-CH2-OH is Template:Chem2\sandbox
- [ZnCl4]- is Template:Chem2\sandbox
- [ZnCl4](2-) is Template:Chem2\sandbox
- AUTO: ((H2O)5{CoCl2})2 is Template:Chem2\sandbox
- Si(OH)4 is Template:Chem2\sandbox
- AUTO: Cu2C2*H2O is Template:Chem2\sandbox
- Cu2C2*2H2O is Template:Chem2\sandbox
- CuSO*2H2O is Template:Chem2\sandbox
- CuSO4*15H2O is Template:Chem2\sandbox
- CuSO4(H2O)5 is Template:Chem2\sandbox
- H+ + OH- → H2O is Template:Chem2\sandbox
- H → O is Template:Chem2\sandbox
- ZxPo4 is Template:Chem2\sandbox Unknown element
- ((Na)Cl is Template:Chem2\sandbox To many (
- Si(OH))4 is Template:Chem2\sandbox To many )
- Si&☃Si is Template:Chem2\sandbox
- Template:Chem2\sandbox
- More
- {{chem2\sandbox|Cl2O6|link=dichlorine hexoxide}} is Template:Chem2\sandbox
- [Fe(Phen)(Phen)3](2+) is Template:Chem2\sandbox
- AUTO: [Fe(Phen)(Phen)3](2+) is Template:Chem2\sandbox
- {{chem2\sandbox|[C2O2](2+)}} is Template:Chem2\sandbox
- {{chem2\sandbox|link=Tomato|SI4}} is Template:Chem2\sandbox
- H2SO4+ is Template:Chem2\sandbox
- Mn- is Template:Chem2\sandbox
- Mn22+ is Template:Chem2\sandbox, Mn22- is Template:Chem2\sandbox,
- Mn(2+) is Template:Chem2\sandbox
- Mn2(+) is Template:Chem2\sandbox
- Mn(22-) is Template:Chem2\sandbox
- Mn3(22-) is Template:Chem2\sandbox
- Mn(22+) is Template:Chem2\sandbox
- Mn2(22+) is Template:Chem2\sandbox
- Mn2(2+) is Template:Chem2\sandbox
- Mn22(2+) is Template:Chem2\sandbox
Line wrapping
Unexpected wrapping
| Table 1: Incnis Mrsi original post demo (extended by DMacks) | ||
|---|---|---|
| Incnis Mrsi's original |
Running text |
class= "nowrap" |
| DMacks's additions |
||
Please, fix. Template:Serif’m lazy to investigate because have no privilege to edit many templates on this site. Incnis Mrsi (talk) 19:53, 16 August 2019 (UTC)
- Noting for ping purposes that this is a continuation or more limited case than Jorge Stolfi's thought in #Bad line breaks. DMacks (talk) 16:12, 17 August 2019 (UTC)
- The template here is a wrapper around the real functionality in Template:Module. Keeping a chemical formula together is pretty important. But
<div class="nowrap">around the whole result is not sufficient—see my first additional example. Using<span class="nowrap">(equivalent to {{nowrap}}), my second example seems better in that regard. But I think we do want to allow breaking at whitespace, as in a chemical equation rather than just a single formula as in my third example. Even {{wbr}} doesn't seem to allow breaking, despite what that template indicates. - It seems heavy-handed to wrap each non-space chunk in the formula with its own
span. Is there a CSS way to allow breaking only at whitespace (not at other word-breaks)? DMacks (talk) 16:10, 17 August 2019 (UTC)- Why namely CSS? A sane HTML code should be generated, not one full of loopholes for bad wrapping. Normally it’s a bad idea to permit one “word” (compound) to be broken, but for long ones—IMHO for cases even longer than examples below—a very thin space can be inserted in places where wrapping is tolerable. See below examples based on U+2009 space. Incnis Mrsi (talk) 17:04, 17 August 2019 (UTC)
| Table 2 | |
|---|---|
C2H5 OH
|
|
C2H5 OH
|
|
C2H5 OH
|
|
| Attention! It is not {{chem2}}, it is HTML. | |