4

I've got a lewis dot structure diagram as seen in the following image:

H3O

However, I would like to have brackets on the outside to indicate the positive charge, since this is supposed to represent H3O 1+. Any suggestions would be appreciated.

Here's my current code:

% Preamble
{\color[rgb]{0.500000,0.500000,0.500000}\documentclass[10pt]{article}
\usepackage[usenames]{color} %used for font color
\usepackage{amssymb} %maths
\usepackage{amsmath} %maths
\usepackage[utf8]{inputenc} %useful to type directly diacritic characters
\usepackage{chemfig}
\newcommand{\pol}[1]{\rlap{${}^{^{\color{red} \delta #1}}$}}
\newcommand{\ind}[0]{\text{ }}}
% ========================= end preamble ============================

\chemfig{\lewis{,H}\pol{+}-\lewis{2:,O}\pol{-}(-[6]\lewis{,H}\pol{+})-\lewis{,H}\pol{+}}
1
  • Welcome to TeX.sx! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question.
    – Werner
    Feb 24, 2014 at 21:29

3 Answers 3

10

I actually figured this issue out by digging through the 83 pages of the chemfig manual. Here's the code I've changed and the following result:

\chemleft[\chemfig{\lewis{,H}\pol{+}-\lewis{2:,O}\pol{-}(-[6]\lewis{,H}\pol{+})-\lewis{,H}\pol{+}}\ind\ind\chemright]^{+}

newfigure

1
  • 2
    This throws errors when I try to compile. It does render the molecule with charge, but the code is still broken after that: Missing $ inserted. ...+})-\lewis{,H}\pol{+}}\ind\ind\chemright]^
    – aiag
    Jan 28, 2017 at 19:08
2

When I had to draw the ionic charge, I rigged this quick hack:

\begin{center}
\chemleft[\chemfig{O=[:30]S(-[::60]O)-[::-60]O}\chemright]
\chemmove{\node[] at (0pt,55pt) {\footnotesize $2-$};}
\end{center}

enter image description here

0

\lewis macro doesn't exist any more. See code below:

\chemleft[\chemfig{
\charge{[overlay=true]35:3pt=\color{red}{$\scriptstyle\delta^+$}}{H}
-\charge{[overlay=true]35:3pt=\color{red}{$\scriptstyle\delta^-$},90=\:}{O}
(-[6]\charge{[overlay=true]35:3pt=\color{red}{$\scriptstyle\delta^+$}}{H})
-\charge{[overlay=true]35:3pt=\color{red}{$\scriptstyle\delta^+$}}{H}}
\quad\chemright]
\chemmove{\node[] at (0pt,10pt) {\footnotesize $+$};}

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .