breaking lines without hyphenation

I have a huge table (tabularx) which has a few columns which contain a lot of text. One of these columns contains long text but should not include a hyphen although it should break.

for example:

\documentclass[oneside,a4paper]{memoir}
\usepackage[english]{babel}
\RequirePackage{underscore}

\usepackage{blindtext}

%% Table Style
\RequirePackage{ltablex}
\RequirePackage{tabu}

\begin{document}

\begin{center}
\begin{tabularx}{\textwidth}{ |X|X|}
\hline
Function signature & Description \\
\hline
\hline
\hline
\hline
\hline
\hline
\end{tabularx}
\end{center}

\end{document}


In this case the first column should not contain hyphen although being split, as this will cause confusion.

Is there anyway to do that?

I tried all the tricks in this post but nothing worked.

• Thank you for posting a working example! At the same time, much of your code does not seem to be relevant to the question you're asking here. Please limit the example to only the code required for your issue to appear. You can have a look at this guide for how to prune your code for this purpose. – Martin Schröder Jul 6 '18 at 12:46

The underscore package has a nohyphen option to suppress hyphens when text is broken at a underscore:

\usepackage[nohyphen]{underscore}


This fixes your example. To stop TeX from hyphenating the remaining text, you can add \hyphenchar\font=-1 at the beginning of the affected cells. The alternative would be to allow breaking words in other places too, but this is not necessary in your example and I would not recommend it because it looks confusing.

\documentclass[oneside,a4paper]{memoir}
\usepackage[english]{babel}
\RequirePackage[nohyphen]{underscore}

\usepackage{blindtext}

%% Table Style
\RequirePackage{ltablex}
\RequirePackage{tabu}
\begin{document}

\begin{center}
\begin{tabularx}{\textwidth}{ |X|X|}
\hline
Function signature & Description \\
\hline
\hline
\hline