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{+}}

migrated from stackoverflow.com Feb 24 '14 at 21:28

This question came from our site for professional and enthusiast programmers.

  • 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 '14 at 21:29
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

  • 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 '17 at 19:08
1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.