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:

name & value \\\hline
docosahexaenoylglycerophosphocholine & 1.0 \\
1-docosahexaenoylglycerophosphocholine & 1.0\\
1\hyph docosahexaenoylglycerophosphocholine & 1.0

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?


  • 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

1 Answer 1


sry i found the answer

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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