pan>
</summary>
<pre><code class="python">def smi2svg(self,smi,opacity=None):
  molSize=self._molsize    
  mol = self.smi2mol(smi)
  mc = Chem.Mol(mol.ToBinary())    
  drawer = rdMolDraw2D.MolDraw2DSVG(molSize[0],molSize[1])
  drawer.DrawMolecule(mc)
  drawer.FinishDrawing()
  svg = drawer.GetDrawingText()
  
  if opacity:
    svg = re.sub(&#34;rect style=&#39;opacity:[^\;]+;&#34;,
                 &#34;rect style=&#39;opacity:{};&#34;.format(opacity),svg)
  return svg</code></pre>
</details>
</dd>
</dl>
