I am generating a long table that has 3 columns. The content of the table contains words that contain underscore such as "ABCD_243_SSD_FCA_SDD" and using the hyphenate package I managed to break the content to the next line when the word does not fit the column width.

The problem is that I get an arrow as the hyphenation character:

enter image description here

How can I replace this arrow with "-" or with whitespace ?

  • 4
    Welcome to TeX.SX! Please prepare a small minimal working example (MWE) that allows others to reproduce the output you get and to test possible suggestions.
    – leandriis
    Mar 9 '21 at 19:06
  • 1
    Please tell us how the columns are defined. If the column that contains ABCD_243_SSD_FCA_SDD has a fixed width -- e.g., p{2cm} -- you could load the seqsplit package and write \seqsplit{ABCD_243_SSD_FCA_SDD} to force an automaticline break.
    – Mico
    Mar 9 '21 at 19:14

As you want _ to act like an explict hyphenation point you can tell TeX that is what it is:

enter image description here


\begin{tabular}{l>{\raggedright\arraybackslash\catcode`\_12 \hyphenchar\font`\_}p{2cm}}
  aaa & ABCD_243_SSD_FCA_SDD\\
  bbb & ZZZ_1234_THIS_THAT_THING\\

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.