TeX - LaTeX Asked by AK16 on December 9, 2020
I am trying to make a longtable, that has repeating headers. Also, each row has rules. In the second page, however, the rule repeats twice.It looks unpolished. How do I fix this?
MWE
documentclass[11pt, a4paper, oneside]{memoir}
usepackage{longtable}
usepackage{booktabs}
usepackage{array}
usepackage{arydshln}
setlengthdashlinedash{0.2pt}
setlengthdashlinegap{1.5pt}
setlengtharrayrulewidth{0.3pt}
begin{document}
begin{longtable}{l}
toprule
Title
midrule
endfirsthead
toprule
Title
midrule
endhead
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C bottomrule
end{longtable}
end{document}
The Economist too uses rules
I kinda stumbled on a solution. It may have drawbacks but it works for me.
Adding these 2 lines removed the problem
setlength{aboverulesep}{0pt}
setlength{belowrulesep}{0pt}
The MWE now becomes
documentclass[11pt, a4paper, oneside]{memoir}
usepackage{longtable}
usepackage{booktabs}
usepackage{array}
usepackage{arydshln}
setlengthdashlinedash{0.2pt}
setlengthdashlinegap{1.5pt}
setlengtharrayrulewidth{0.3pt}
setlength{aboverulesep}{0pt}
setlength{belowrulesep}{0pt}
begin{document}
begin{longtable}{l}
toprule
Title
midrule
endfirsthead
toprule
Title
midrule
endhead
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C hdashline
D hdashline
A hdashline
B hdashline
C bottomrule
end{longtable}
end{document}
Page 2 output is shown:
Answered by AK16 on December 9, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP