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


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
\usepackage[usenames]{color} %used for font color
\usepackage{amssymb} %maths
\usepackage{amsmath} %maths
\usepackage[utf8]{inputenc} %useful to type directly diacritic characters
\newcommand{\pol}[1]{\rlap{${}^{^{\color{red} \delta #1}}$}}
\newcommand{\ind}[0]{\text{ }}}
% ========================= end preamble ============================

  • 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


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:



  • 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

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

\chemmove{\node[] at (0pt,55pt) {\footnotesize $2-$};}

enter image description here


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

\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 .