# hyphenation of chemical names

i use the datatool package to read a csv table which contains names of chemical compounds in one column. Those names are very long and have to be hyphenated. The problem is that these names contain -.

have a look at this example:

\documentclass{article}
\usepackage{siunitx}
\def\hyph{-\penalty0\hskip0pt\relax}
\begin{table}
\begin{tabular}{|>{\raggedright\hspace{0pt}}p{14mm}|l|}
name & value \\\hline
docosahexaenoylglycerophosphocholine & 1.0 \\
1-docosahexaenoylglycerophosphocholine & 1.0\\
1\hyph docosahexaenoylglycerophosphocholine & 1.0
\end{tabular}
\end{table}
\end{document}


in the first row the name hyphenated but not in the second one. I found a workaround for the third line (from https://stackoverflow.com/questions/2193307/how-to-get-latex-to-hyphenate-a-word-that-contains-a-dash) but as I read the names from a csv file (and this is really big) i can't replace all - by \hyph.

Is there any other solution to allow hyphenation of already hyphenated words inside (and only inside) the table environment?

bye

• As LaTeX does not understand chemicals in their correct hyphenation (and I don't know of a package that supports that) you might get jibber jabber if you automatize hyphenation. I don't know which purpose your document should serve, but it is probably best you care for each formula. Jul 12, 2013 at 8:37

one can use \DTLsubstituteall{\colname}{-}{\Hyphdash}% (\Hyphdash is from the extdash package) to allow hyphenation of words which contain - with the datatool package