Template talk:Related molecular formulas
Layout bugs for heteroatoms
[edit]Looking at the /doc examples, there is a large amount of whitespace between the top block (saturation and methylene variations)) and the bottom block (heteroatom variations). In the first heteroatom row (oxygen), the –O vs +O are on separate lines. The whitespace situation is when there are any heteroatoms (and even when there are no heteroatoms); the oxygen-row situation only happens when there are both O and N rows. DMacks (talk) 11:34, 25 October 2025 (UTC)
- Fixed. Thanks! DMacks (talk) 12:01, 25 October 2025 (UTC)
Bug with explicit =0 heteratom count
[edit]{{Related molecular formulas|C=2|H=3|N=1}}gives "C2H2" and "C2H4N2"{{Related molecular formulas|C=2|H=3}}omits the N-variations row{{Related molecular formulas|C=2|H=3|N=0}}gives "C2H2N-1" and "C2H4N1"
Presumaby that last should be equivalent to omitting the N parameter altogether. DMacks (talk) 11:52, 25 October 2025 (UTC)
- Fixed. Nucleus hydro elemon (talk) 12:24, 25 October 2025 (UTC)
- Thanks. DMacks (talk) 12:26, 25 October 2025 (UTC)
Refactoring
[edit]{{Compose molecular formula}} might be a way to clean up this template-family by factoring out every time you need to format a molecular formula and link to its setindex. DMacks (talk) 05:01, 26 October 2025 (UTC)
- Done. Thanks for the template! Nucleus hydro elemon (talk) 15:49, 1 November 2025 (UTC)
- And thank you for catching my typos, and fixing some other corner-cases. DMacks (talk) 15:55, 1 November 2025 (UTC)