TeX - LaTeX Asked on April 28, 2021
I need to create a table with notes having the borders like this:
I use the package threeparttablex and it works perfectly for me. The only issue is that I do not know how to keep borders around the notes. The best I was able to do is this (see MWE below):
Can you please help me find ways to add all borders?
(I know there is an alternative solution to add a frame, but I want to make use of the original table borders.)
The minimal working example (MWE):
documentclass{report}
usepackage{longtable}
usepackage{threeparttablex}
begin{document}
begin{ThreePartTable}
begin{TableNotes}
item[a] Note A
end{TableNotes}
begin{longtable}[c]{ | c | c | }
caption{Example}hline
Left & Right hlinehline
endhead
% Below command gives only bottom border
insertTableNoteshline
% I want borders on all sides like this
%multicolumn{2}{|l|}{textsuperscript{a} Note A}hline
endlastfoot
sample text & texttnote{a}
more text & text hline
end{longtable}
end{ThreePartTable}
end{document}
insertTableNotes
does multicolumn{<number of cols>}{c}{...}
; you can patch it to use {|c|}
instead.
documentclass{report}
usepackage{longtable}
usepackage{threeparttablex}
usepackage{etoolbox}
patchcmdinsertTableNotes{{c}}{{|c|}}{}{}
begin{document}
begin{ThreePartTable}
begin{TableNotes}
item[a] Note Astrut
end{TableNotes}
begin{longtable}[c]{ | c | c | }
caption{Example}hline
Left & Right hlinehline
endhead
% Below command gives only bottom border
insertTableNoteshline
endlastfoot
sample text & texttnote{a}
more text & text hline
end{longtable}
end{ThreePartTable}
end{document}
Add a strut
at the end of the last table note.
Correct answer by egreg on April 28, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP