Skip to content
AsciiC6hem

Spectroscopy

AsciiChem captures spectroscopic data — NMR, IR, MS, UV-Vis — in a structured syntax that round-trips to native CML <spectrum> wire.

spectrum[type](params){
position: intensity [multiplicity] ["assignment"]
}
  • type — spectrum kind: nmr, ir, ms, uv
  • params — key=value pairs (e.g. type=1H, solvent=CDCl3)
  • Each peak line: position, intensity, optional multiplicity and quoted assignment
Source Rendered
spectrum[nmr](type=1H,solvent=CDCl3){
Install the asciichem gem to see this rendered.
1.2: 3H s "CH3"
Install the asciichem gem to see this rendered.
7.2: 5H m "ArH"
Install the asciichem gem to see this rendered.
}
Install the asciichem gem to see this rendered.
Source Rendered
spectrum[ir]{
Install the asciichem gem to see this rendered.
3300: 100 "O-H stretch"
Install the asciichem gem to see this rendered.
1700: 80 "C=O stretch"
Install the asciichem gem to see this rendered.
}
Install the asciichem gem to see this rendered.
Source Rendered
spectrum[ms]{
Install the asciichem gem to see this rendered.
18: 100% "M+"
Install the asciichem gem to see this rendered.
17: 20% "M-1"
Install the asciichem gem to see this rendered.
}
Install the asciichem gem to see this rendered.
FieldRequiredExample
positionyes1.2 (ppm for NMR, cm⁻¹ for IR, m/z for MS)
intensityyes3H, 100%, 0.8
multiplicitynos, d, t, q, m (NMR only)
assignmentno"CH3" (in double quotes)

Emits as native <spectrum> with <peakList> of <peak> elements:

<molecule>
<spectrum title="nmr" format="1H" condition="CDCl3">
<peakList>
<peak title="CH3" xValue="1.2" yValue="3H" yMultiplicity="s"/>
</peakList>
</spectrum>
</molecule>
Play