Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to hyphenate a chemical name and have come into difficulty. The word I'm trying to hyphenate is poly(ethyeneglycol).

I'm using babel and inputenc. I've tried specifying a custom hyphenation pattern using \hyphenation{poly(ethylene-glycol)} but it fails to complete.

Being chemistry terminology I wondered if this was dealt with by a chemistry package such as mhchem but have not found a package that does it.

share|improve this question
    
I have noticed all your words "hyphenate" were missing the h, including the command \hyphenation{poly(ethylene-glycol)}. I corrected them all in your question, but perhaps your code needs to be corrected as well? Maybe is just a misspelling problem? –  Vivi Jun 13 '12 at 16:19
2  
Have you looked at bpchem and the \IUPAC macro? –  Joseph Wright Jun 13 '12 at 16:23
    
Hi Joseph, the IUPAC macro didn't seem to do anything to it. Thanks everyone. –  Darling Jun 14 '12 at 10:14
add comment

1 Answer

up vote 8 down vote accepted

Techically, ( and ) are not letters, so they won't participate to hyphenation. You can make them acceptable with the following trick, which should have no adverse effect with normal input:

\lccode`\(=`\(
\lccode`\)=`\) 
\hyphenation{poly(ethylene-glycol)}

A different strategy could be to define a macro:

\newcommand{\Q}[1]{(\nobreak\hspace{0pt}#1)}
\hyphenation{ethylene-glycol} % TeX incorrectly hyphenates this word

and use

poly\Q{ethyleneglycol}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.