Square brackets in chemcompounds custom names

I would like to denote a molecular ion using the chemcompounds package. This would involve wrapping part of a chemcompounds descriptor in square brackets, like so:

$[1]^{2+}$

However, because the chemcompounds name argument is placed between square brackets, trying to do this causes an error.

How is it done?

MWE

\documentclass[a4paper]{minimal} \usepackage{chemcompounds} \declarecompound[J]{c1} \declarecompound[J$^{+}$]{c1c} %\declarecompound[[J]$^{+}$]{c1bc}  \begin{document}  This species is denoted \compound{c1}.  This molecular ion is denoted \compound{c1c}.  %This molecular ion breaks chemcompounds: \compound{c1bc}.  \end{document} 

(I have commented out the lines that break compilation)

Replay

Normally, an extra pair of braces solves this kind of problem:

\documentclass{article}
\usepackage{chemcompounds}

\declarecompound[${[1]^{2+}}$]{label}

\begin{document}

\compound{label}

\end{document}

Square brackets in chemcompounds custom names

If this was not the case, while you provide a proper MWE with chemcompounds, I would suggest you to use the mhchem package instead:

\documentclass{article}
\usepackage{mhchem}

\begin{document}

\ce{$[1]^{2+}$}

\end{document}

Square brackets in chemcompounds custom names

Category: brackets Time: 2011-11-08 Views: 1

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.355 (s). 13 q(s)