TeX - LaTeX Asked on June 5, 2021
I’m trying to make a macro which typeset a text "accross a vertical line", and I’m using a tabular for that :
documentclass{article}
begin{document}
makeatletter
newlengthtdv@temp
newcommandcenter@box[3]{parbox[c][#1][c]{#2}{makebox[#2][c]{#3}}}
newcommandtxt@value@on@bar[1]{%
settowidth{tdv@temp}{$#1$}%
begin{tabular}{@{hspace{0pt}}c@{hspace{0pt}}}%
rule{5pt}{8mm}%
center@box{8mm}{tdv@temp}{#1}%
rule{5pt}{8mm}%[-4pt]%
end{tabular}%
}
begin{tabular}{|c|c|}
hline
$1$ & $2$
hline
txt@value@on@bar{0} & 2
hline
end{tabular}
end{document}
There’s a tiny space at the bottom, which I think is related to arraystretch
.
But if I set defarraystretch{0}
, the first line is stretched (at the very worst, I could put a strut there), and if I try to uncomment the [-4pt]
, the cells are not aligned vertically anymore.
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP