2

I need to type an inline chemical formula such as HO-(C=O)-(Benzene)-(C=O)-OH. Is there a way I could insert a small benzene symbol (something compact, without using tikzpicture environment, \schemestart...\schemestop etc.)?

I know there's a unicode symbol but I couldn't make it work, nor do I think it's optimal.

Right now I have:

HO-\stackrel{\stackrel{O}{||}}{C}-Bz-\stackrel{\stackrel{O}{||}}{C}-OH

Where "Bz" is where the benzene symbol should go.

4
  • 1
    Not everyone is acquainted with chemistry. The expected output and a minimal working example (MWE) are appreciated.
    – CroCo
    Commented Sep 29, 2015 at 3:22
  • The wasysym package has a hexagon symbol. You may need to adjust it to look good. Commented Sep 29, 2015 at 4:05
  • AFAIK there is no chemfig environment?! But the \chemfig macro has optional arguments which allow scaling. Other than that simply C6H4 would of course work...
    – cgnieder
    Commented Sep 29, 2015 at 6:14
  • @clemens, question updated
    – Sparkler
    Commented Sep 29, 2015 at 12:29

1 Answer 1

6

To get the \smallbenz, I stack a \circ inside of a \hexagon. I then use \scalerel* to make it an appropriate size, which I arbitrarily chose as .8\baselineskip tall, shifted down by .2\baselineskip for centering. Those values can be changed.

EDITED to lessen the vertical stacking gap to 2pt. RE-EDITED to provide a 2nd possibility, with dashes inserted around the inside of a hexagon.

\documentclass{article}
\usepackage{stackengine,wasysym,scalerel}
\newcommand\wrule[3][0pt]{\textcolor{white}{\rule[#1]{#2}{#3}}}
\def\smallbenz{\scalerel*{\stackinset{c}{}{c}{-.25pt}{$\circ$}{\hexagon}}{%
  \rule[-.2\baselineskip]{1pt}{.8\baselineskip}}}
\setstackgap{S}{2pt}
\begin{document}
HO$-$\stackon{C}{\stackon{$||$}{O}}$-$%
  \smallbenz%
  $-$\stackon{C}{\stackon{$||$}{O}}$-$OH

\vspace{2em}
\def\smallbenz{\scalerel*{\kern-3pt%
\stackinset{c}{0.95pt}{b}{2.2pt}{-}{%
\rotatebox[origin=center]{120}{\stackinset{c}{-0.4pt}{b}{.3pt}{-}{%
\rotatebox[origin=center]{120}{\stackinset{c}{.24pt}{b}{-1.5pt}{-}{%
  \hexagon}}}}}}{\rule[-.75\baselineskip]{1pt}{2\baselineskip}}\kern-3pt}
%
HO$-$\stackon{C}{\stackon{$||$}{O}}$-$%
  \smallbenz%
  $-$\stackon{C}{\stackon{$||$}{O}}$-$OH
\end{document}

enter image description here

Alternatively, you could use \chemfig:

\usepackage{chemfig}
\def\smallbenz{\raisebox{0.2em}%
   {\chemfig[scale=0.18][scale=0.18]{[:-30]**6(------)}}}

\textnormal{HO}-\smallbenz-\textnormal{OH}

enter image description here

2
  • this is pretty neat, and you gave me an idea: \def\smallbenz{\chemfig[scale=0.15][scale=0.15]{[:-30]**6(------)}}. The problem is that when I use it it's not aligned to the middle of the line, i.e. if I type -\smallbenz-, the dashes are at the level of the top of the benzene... ideas?
    – Sparkler
    Commented Sep 29, 2015 at 15:50
  • 1
    @Sparkler Could you apply a \raisebox{length}{\chemfig{...}}? Commented Sep 29, 2015 at 16:04

You must log in to answer this question.

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