I am using tabu
package to easily typeset my tables. So, there are few problems that i have solved:
- vertical spacing (from cell content to borders) is less than line height and line depth, so i use
\strut
s before and after content; - LaTeX does not break line at the beginning, so i use
\hspace{0pt}
at the very beginning of cell content to make LaTeX break line and add hyphenation; - LaTeX does not hyphenate words with macro, so i have to add
\hspace{0pt}
between end of cell content and\strut
.
Column spec looks like:
\begin{tabu} to \linewidth {|>{\strut\hspace{0pt}}X[0.4,L]<{\hspace{0pt}\strut}|%
>{\strut\hspace{0pt}}X[0.115,C]<{\hspace{0pt}\strut}|%
>{\strut\hspace{0pt}}X[0.115,C]<{\hspace{0pt}\strut}|%
>{\strut\hspace{0pt}}X[0.2,C]<{\hspace{0pt}\strut}|%
>{\strut\hspace{0pt}}X[0.17,C]<{\hspace{0pt}\strut}|}\hline
How can i declare a new column type (for example, Y) with these features using X type? Like this (but this does not work):
\newcolumntype{Y}{>{\strut\hspace{0pt}}X<{\hspace{0pt}\strut}}
\tabucolumn Y
\nolinebreak
before\hspace{0pt}\strut
in the "end part" or you'll get an empty line in many occasions.