LaTeX forum ⇒ Math & ScienceTypesetting a Line over Text Topic is solved

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
hoytesara
Posts: 13
Joined: Sat Feb 18, 2012 10:46 am

Typesetting a Line over Text

Postby hoytesara » Sat Feb 18, 2012 10:51 am

In my thesis I need to have a line over the formulas for some of my complexes to denote which atoms are coordinated to the metal, as shown in the above image. How do I go about typesetting this?
Attachments
overbracket.png
overbracket.png (20.81 KiB) Viewed 3377 times

Tags:

User avatar
Stefan Kottwitz
Site Admin
Posts: 9572
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sat Feb 18, 2012 1:38 pm

Hi,

welcome to the board!

You could use the mathtools package and the command \overbracket. For example:

  1. \documentclass{article}
  2. \usepackage{mathtools}
  3. \begin{document}
  4. \[
  5. \overbracket{\text{Formula}}
  6. \]
  7. \end{document}


You can adjust it by giving values to the optional arguments, the syntax is

\overbracket[line thickness][bracket height]{formula}

Stefan
LaTeX.org admin

User avatar
cgnieder
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Sat Feb 18, 2012 3:41 pm

You could also misuse chemmacros' \redox command:

  1. \documentclass{article}
  2. \usepackage{chemmacros}
  3. \begin{document}
  4.  
  5. \ch{[\OX{a,Pt}(CH2)CH=CH\OX{b,C}(CH2)2(dppp)]}\redox(a,b){}
  6.  
  7. \end{document}

lineover.png
lineover.png (5.09 KiB) Viewed 3367 times


Regards
site moderator & package author

hoytesara
Posts: 13
Joined: Sat Feb 18, 2012 10:46 am

Postby hoytesara » Sun Feb 19, 2012 3:57 am

The \redox command suits perfectly. However, in order to make everything work properly, I had to modify things slightly. What I ended up going with was:

  1. \documentclass{article}
  2. \usepackage{chemmacros}
  3. \usepackage[version=3]{mhchem}
  4. \usetikzlibrary{calc}
  5. \begin{document}
  6.  
  7. \ce{[\OX{a,Pt}(CH2)CH=CH\OX{b,C}(CH2)2(dppp)]}\redox(a,b){}
  8.  
  9. \end{document}


Thanks!

User avatar
cgnieder
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Sun Feb 19, 2012 12:34 pm

Didn't it work without \usetikzlibrary{calc}? That would mean you must have an old (and obviously buggy) version of chemmacros.
site moderator & package author


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 5 guests