# mis-aligned chemical names

I am using \chemfig for writing chemical symbols, but those symbols they are misaligned with the rest of the text. Is there a package that I should add?

\documentclass[11pt]{report}
\usepackage[english,greek]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{chemfig}
\begin{document}
\par{Το πυρίτιο \chemfig{(Si)} που ανιχνεύθηκε καθώς και το βάριο \chemfig{(Ba)} αποτελούν τμήμα των ανόργανων ενισχυτικών ουσιών που εμφανίστηκαν στην επιφάνεια των δειγμάτων κατά την διαδικασία της λείανσης και στίλβωσης.}
\end{document}

• please provide a small example that can be compiled, so that helpers don't have to guess what you are doing. – barbara beeton Mar 28 '16 at 19:33
• \documentclass[11pt]{report} \usepackage[english,greek]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{chemfig} \begin{document} \par{Το πυρίτιο \chemfig{(Si)} που ανιχνεύθηκε καθώς και το βάριο \chemfig{(Ba)} αποτελούν τμήμα των ανόργανων ενισχυτικών ουσιών που εμφανίστηκαν στην επιφάνεια των δειγμάτων κατά την διαδικασία της λείανσης και στίλβωσης.} \end{document} – Petros Mourouzis Apr 2 '16 at 8:01
• it's always possible to edit your own question. that's where examples should be entered, not in comments. i've moved your example code into the question so it's easier for others to look at and experiment with. – barbara beeton Apr 2 '16 at 12:10
• I didn't notice the parentheses in the first place..thank you again – Petros Mourouzis Apr 2 '16 at 12:49

## 1 Answer

The parentheses ( and ) are special characters inside \chemfig. They denote branching (and also are part or the ring syntax). \chemfig{(Si)} starts a branch after an empty atom which in effect seems to shift the baseline.

\documentclass{article}

\usepackage{chemfig}

\begin{document}

X\chemfig{H-C-H}X\chemfig{C}X \par
X\chemfig{-C-}X\chemfig{(C)}X

\end{document}


In your case the simple solution is to not put the parentheses inside the formula as they are not a part of it:

Write (\chemfig{Si}) instead of \chemfig{(Si)}.

\documentclass{article}

\usepackage{chemfig}

\begin{document}

X\chemfig{(C)}X(\chemfig{C})X

\end{document}


In theory you could also write \chemfig{{(}Si{)}}, i.e., put the parentheses in braces in order to have them interpreted as atoms. The output is ok but semantically this is wrong: this treats the parentheses as part of the chemical formula.

As my first example shows the same is true for compounds starting with a bond:

\documentclass{article}

\usepackage{chemfig}

\begin{document}

X\chemfig{-OH}X\chemfig{OH-[4]}X

\end{document}


• Thank you very much, it work for single atoms but when I tried to write (\chemfig{-OH}) again I had the same problem.. – Petros Mourouzis Jun 23 '16 at 9:31
• @PetrosMourouzis of course! My first example actually demonstrates this with \chemfig{-C-}. \chemfig{-OH} also starts with an empty atom. You need to start with a non-empty atom, e.g., write \chemfig{OH-[4]} instead. – clemens Jun 23 '16 at 9:49
• @PetrosMourouzis if my answer helped you you may consider upvoting it. And if it solved your problem you may also consider accepting it (which marks it as solved). – clemens Jun 23 '16 at 10:10