CharacterSettings superscriptCharacterSettings = new CharacterSettings()
{
VerticalAlignment = RunVerticalAlignment.Superscript,
FontSize = new Extent(10, ExtentUnitType.Points),
};
CharacterSettings subscriptCharacterSettings = new CharacterSettings()
{
VerticalAlignment = RunVerticalAlignment.Subscript,
FontSize = new Extent(10, ExtentUnitType.Points),
};
ParagraphNode pn = new ParagraphNode();
pn.ChildNodes.Add(rn);
this.xamRichTextEditor1.Document.RootNode.Body.ChildNodes.Add(pn);
RunNode rn = new RunNode();
rn.SetText("Normal text");
pn.ChildNodes.Add(rn);
rn = new RunNode();
rn.SetText("Subscripted text");
rn.Settings = subscriptCharacterSettings;
pn.ChildNodes.Add(rn);
rn = new RunNode();
rn.SetText("Superscripted text");
rn.Settings = superscriptCharacterSettings;
pn.ChildNodes.Add(rn);