Skip to content

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){ 1.2: 3H s "CH3" 7.2: 5H m "ArH" }
spectrum [ nmr ] type 1H solvent CDCl3 1.2 3H s CH3 7.2 5H m ArH
Source Rendered
spectrum[ir]{ 3300: 100 "O-H stretch" 1700: 80 "C=O stretch" }
spectrum [ ir ] 3300 100 O-H stretch 1700 80 C=O stretch
Source Rendered
spectrum[ms]{ 18: 100% "M+" 17: 20% "M-1" }
spectrum [ ms ] 18 100% M+ 17 20% M-1
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