Hi,
At present, the drawing code will ignore things like '\n'.  I suppose it
could be made to recognise newline and produce 2 lines of output.  I will
add it to the list of things to do on a wet weekend, though it won't appear
in a release until 2022.09.1 at the earliest.  In the meantime, you could
try adding the labels explicitly to the drawing, using ideas in this
discussion:
https://github.com/rdkit/rdkit/discussions/4832#discussioncomment-1882386
That shows how to label atoms and bonds with torsion angles and bond
lengths.

HTH,
Dave


On Fri, May 13, 2022 at 2:46 PM Márton Vass <marciavassklan...@gmail.com>
wrote:

> Hi,
> Is it possible to have a multi-line atom label?
> I've tried adding ...\n... or <p>...<br>...</p> to the atomNote property,
> but these didn't work (though <sub> and <sup> work).
>
> mol = Chem.MolFromSmiles("CCC")
> mol.GetAtomWithIdx(0).SetProp('atomNote',"line1\nline2")
> Chem.Draw.MolToFile(mol,"/Users/vass/Downloads/x.svg")
>
> Thanks,
> Marton
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>


-- 
David Cosgrove
Freelance computational chemistry and chemoinformatics developer
http://cozchemix.co.uk
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to