TeX - LaTeX Asked by quark67 on July 3, 2021
When using this code, all is OK:
documentclass[11pt]{article}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{cellspace}
begin{document}
begin{tabular}{|c|S{p{1cm}}|}
hline
foo & bar
hline
a & É
hline
end{tabular}
end{document}
But when a p
-column type with the cellspace
contain an empty cell, as in this code:
documentclass[11pt]{article}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{cellspace}
begin{document}
begin{tabular}{|c|S{p{1cm}}|}
hline
foo &
hline
a & É
hline
end{tabular}
end{document}
I obtain a white first page, and on the second page, an huge height for the first row:
The log contain this message:
Overfull vbox (482.37025pt too high) has occurred while output is active
Is this the expected behaviour?
To workaround this, instead of an empty cell, I can use an explicit white space (
). But perhaps there is a better solution?
Same bug with an m
-column-type (from the array
package). l
, c
and r
column-types aren’t affected by this strange behaviour.
Add an >{arraybackslash}
to the last column:
documentclass[11pt]{article}
usepackage[T1]{fontenc}
usepackage{cellspace}
setlength{cellspacetoplimit}{4pt}
setlength{cellspacebottomlimit}{4pt}
begin{document}
begin{tabular}{|c|S{>{arraybackslash}p{1cm}}|}
hline
foo &
hline
a & É
hline
end{tabular}
end{document}
Correct answer by Bernard on July 3, 2021
For information, if you use nicematrix
and its parameter cell-space-limits
, you don't have that problem.
documentclass[11pt]{article}
usepackage{nicematrix}
begin{document}
NiceMatrixOptions{cell-space-limits=1pt}
begin{NiceTabular}{|c|p{1cm}|}
hline
foo &
hline
a & É
hline
end{NiceTabular}
end{document}
Answered by F. Pantigny on July 3, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP