I have this table
\documentclass{article}
\usepackage{tabulary}
\begin{document}
\begin{table}[htbp]
\begin{tabulary}{\textwidth}{lLLLrr}
\hline
\textbf{type} & \textbf{author} & \textbf{title} & \textbf{about} & \textbf{year} & \textbf{ref} \\ \hline
book & David Salomon and Giovanni Motta & Handbook of Data Compression & general & 2010 & [1] \\
article & Senthil Shanmugasundaram and Robert Lourdusamy & A Comparative Study Of Text Compression Algorithms & text compr. & 2011 & [2] \\
article & Kitty Arora and Manshi Shukla & A Comprehensive Review of Image Compression Techniques & image compr. & 2014 & [3] \\ \hline
\end{tabulary}
\end{table}
\end{document}
I don't want to have hyphenation in the column "about". But I still want to have line breaks where necessary. So, the words "general" and "image" shall not by hyphenated (nor any other word in this column), but there shall be a linebreak between "text" and "compr." as well as between "image" and "compr.".
Hyphenation shall be possible in other columns. I want the name "Shanmugasundaram" to be hyphenated, also long words in the title shall be hyphenated (not shown in my example).
I tried other symbols for columns definition (other than l, L, r), but then the table looks ugly and hyphenation still happens. I also tried {\raggedright general}
instead of general
, but this has no effect.
What can I do to avoid hyphenation in the column "about"?
Best Answer
You can set the hyphenation penalties
\hyphenpenalty
and\exhyphenpenalty
to an “infinite” value for that particular column as mentioned in the TeX FAQ. However, this causes overlapping in the case of long words (notice the 4th row) which may be prevented by setting a specific width of that column.Addendum:
You may also use the
tabularray
package which allows manual linebreak in a cell.This package makes handling tables very easy and convenient. Note that there is better spacing between the rows by default.