Discontinuous line using multirow
I've been struggling with table editing, so I started using a website to generate tables in LaTeX. However, whenever I'm using multirow and borders, things get a little tricky. I get a discontinuous line along my column.
As a test, I'm using this:
begin{table}
centering
caption{My caption}
label{my-label}
begin{tabular}{@{}c|cc@{}}
Test & a & b \ midrule
multirow{2}{*}{x} & 1 & 2 \ cmidrule(l){2-3}
& 3 & 4
end{tabular}
end{table}
This is the result:
I'm using TexPortable with MiKTeX 2.9.6210 and Texmaker 4.5.
tables border
add a comment |
I've been struggling with table editing, so I started using a website to generate tables in LaTeX. However, whenever I'm using multirow and borders, things get a little tricky. I get a discontinuous line along my column.
As a test, I'm using this:
begin{table}
centering
caption{My caption}
label{my-label}
begin{tabular}{@{}c|cc@{}}
Test & a & b \ midrule
multirow{2}{*}{x} & 1 & 2 \ cmidrule(l){2-3}
& 3 & 4
end{tabular}
end{table}
This is the result:
I'm using TexPortable with MiKTeX 2.9.6210 and Texmaker 4.5.
tables border
add a comment |
I've been struggling with table editing, so I started using a website to generate tables in LaTeX. However, whenever I'm using multirow and borders, things get a little tricky. I get a discontinuous line along my column.
As a test, I'm using this:
begin{table}
centering
caption{My caption}
label{my-label}
begin{tabular}{@{}c|cc@{}}
Test & a & b \ midrule
multirow{2}{*}{x} & 1 & 2 \ cmidrule(l){2-3}
& 3 & 4
end{tabular}
end{table}
This is the result:
I'm using TexPortable with MiKTeX 2.9.6210 and Texmaker 4.5.
tables border
I've been struggling with table editing, so I started using a website to generate tables in LaTeX. However, whenever I'm using multirow and borders, things get a little tricky. I get a discontinuous line along my column.
As a test, I'm using this:
begin{table}
centering
caption{My caption}
label{my-label}
begin{tabular}{@{}c|cc@{}}
Test & a & b \ midrule
multirow{2}{*}{x} & 1 & 2 \ cmidrule(l){2-3}
& 3 & 4
end{tabular}
end{table}
This is the result:
I'm using TexPortable with MiKTeX 2.9.6210 and Texmaker 4.5.
tables border
tables border
edited Apr 26 '17 at 8:56
Moriambar
7,94531846
7,94531846
asked Apr 26 '17 at 8:28
Tiago CorreiaTiago Correia
1019
1019
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
This is related to the padding around horizontal lines in booktabs
(the lengths aboverulesep
and belowrulesep
). Vertical rules should not be used with booktabs
in general (this principle suffers exceptions). A workaround consists in setting them to 0 and replacing them with more or less equivalent lengths added at the top and bottom of cells with the tools from makecell
.
documentclass{article}
usepackage{booktabs, multirow, array, makecell, caption}
begin{document}
begin{table}[!htb]
centering
setlengthaboverulesep{0pt}setlengthbelowrulesep{0pt}
setcellgapes{3pt}makegapedcells
caption{My caption}
label{my-label}
begin{tabular}{@{}c|cc@{}}
Test & a & b \ midrule
multirow{2}{*}{x} & 1 & 2 \ addlinespace[-0.03em]cmidrule(l){2-3}
& 3 & 4
end{tabular}
end{table}
end{document}
I've tried that and it worked on the vertical line, but the horizontal line is still discontinuous, here. Thank you!
– Tiago Correia
Apr 26 '17 at 9:18
1
Do you mean the short line between 2nd and 3rd row? I thought it was there purposely. The responsible is the(l)
optional argument ofcmidrule
. Just remove it.
– Bernard
Apr 26 '17 at 9:25
add a comment |
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f366744%2fdiscontinuous-line-using-multirow%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This is related to the padding around horizontal lines in booktabs
(the lengths aboverulesep
and belowrulesep
). Vertical rules should not be used with booktabs
in general (this principle suffers exceptions). A workaround consists in setting them to 0 and replacing them with more or less equivalent lengths added at the top and bottom of cells with the tools from makecell
.
documentclass{article}
usepackage{booktabs, multirow, array, makecell, caption}
begin{document}
begin{table}[!htb]
centering
setlengthaboverulesep{0pt}setlengthbelowrulesep{0pt}
setcellgapes{3pt}makegapedcells
caption{My caption}
label{my-label}
begin{tabular}{@{}c|cc@{}}
Test & a & b \ midrule
multirow{2}{*}{x} & 1 & 2 \ addlinespace[-0.03em]cmidrule(l){2-3}
& 3 & 4
end{tabular}
end{table}
end{document}
I've tried that and it worked on the vertical line, but the horizontal line is still discontinuous, here. Thank you!
– Tiago Correia
Apr 26 '17 at 9:18
1
Do you mean the short line between 2nd and 3rd row? I thought it was there purposely. The responsible is the(l)
optional argument ofcmidrule
. Just remove it.
– Bernard
Apr 26 '17 at 9:25
add a comment |
This is related to the padding around horizontal lines in booktabs
(the lengths aboverulesep
and belowrulesep
). Vertical rules should not be used with booktabs
in general (this principle suffers exceptions). A workaround consists in setting them to 0 and replacing them with more or less equivalent lengths added at the top and bottom of cells with the tools from makecell
.
documentclass{article}
usepackage{booktabs, multirow, array, makecell, caption}
begin{document}
begin{table}[!htb]
centering
setlengthaboverulesep{0pt}setlengthbelowrulesep{0pt}
setcellgapes{3pt}makegapedcells
caption{My caption}
label{my-label}
begin{tabular}{@{}c|cc@{}}
Test & a & b \ midrule
multirow{2}{*}{x} & 1 & 2 \ addlinespace[-0.03em]cmidrule(l){2-3}
& 3 & 4
end{tabular}
end{table}
end{document}
I've tried that and it worked on the vertical line, but the horizontal line is still discontinuous, here. Thank you!
– Tiago Correia
Apr 26 '17 at 9:18
1
Do you mean the short line between 2nd and 3rd row? I thought it was there purposely. The responsible is the(l)
optional argument ofcmidrule
. Just remove it.
– Bernard
Apr 26 '17 at 9:25
add a comment |
This is related to the padding around horizontal lines in booktabs
(the lengths aboverulesep
and belowrulesep
). Vertical rules should not be used with booktabs
in general (this principle suffers exceptions). A workaround consists in setting them to 0 and replacing them with more or less equivalent lengths added at the top and bottom of cells with the tools from makecell
.
documentclass{article}
usepackage{booktabs, multirow, array, makecell, caption}
begin{document}
begin{table}[!htb]
centering
setlengthaboverulesep{0pt}setlengthbelowrulesep{0pt}
setcellgapes{3pt}makegapedcells
caption{My caption}
label{my-label}
begin{tabular}{@{}c|cc@{}}
Test & a & b \ midrule
multirow{2}{*}{x} & 1 & 2 \ addlinespace[-0.03em]cmidrule(l){2-3}
& 3 & 4
end{tabular}
end{table}
end{document}
This is related to the padding around horizontal lines in booktabs
(the lengths aboverulesep
and belowrulesep
). Vertical rules should not be used with booktabs
in general (this principle suffers exceptions). A workaround consists in setting them to 0 and replacing them with more or less equivalent lengths added at the top and bottom of cells with the tools from makecell
.
documentclass{article}
usepackage{booktabs, multirow, array, makecell, caption}
begin{document}
begin{table}[!htb]
centering
setlengthaboverulesep{0pt}setlengthbelowrulesep{0pt}
setcellgapes{3pt}makegapedcells
caption{My caption}
label{my-label}
begin{tabular}{@{}c|cc@{}}
Test & a & b \ midrule
multirow{2}{*}{x} & 1 & 2 \ addlinespace[-0.03em]cmidrule(l){2-3}
& 3 & 4
end{tabular}
end{table}
end{document}
edited 4 hours ago
answered Apr 26 '17 at 8:56
BernardBernard
175k776207
175k776207
I've tried that and it worked on the vertical line, but the horizontal line is still discontinuous, here. Thank you!
– Tiago Correia
Apr 26 '17 at 9:18
1
Do you mean the short line between 2nd and 3rd row? I thought it was there purposely. The responsible is the(l)
optional argument ofcmidrule
. Just remove it.
– Bernard
Apr 26 '17 at 9:25
add a comment |
I've tried that and it worked on the vertical line, but the horizontal line is still discontinuous, here. Thank you!
– Tiago Correia
Apr 26 '17 at 9:18
1
Do you mean the short line between 2nd and 3rd row? I thought it was there purposely. The responsible is the(l)
optional argument ofcmidrule
. Just remove it.
– Bernard
Apr 26 '17 at 9:25
I've tried that and it worked on the vertical line, but the horizontal line is still discontinuous, here. Thank you!
– Tiago Correia
Apr 26 '17 at 9:18
I've tried that and it worked on the vertical line, but the horizontal line is still discontinuous, here. Thank you!
– Tiago Correia
Apr 26 '17 at 9:18
1
1
Do you mean the short line between 2nd and 3rd row? I thought it was there purposely. The responsible is the
(l)
optional argument of cmidrule
. Just remove it.– Bernard
Apr 26 '17 at 9:25
Do you mean the short line between 2nd and 3rd row? I thought it was there purposely. The responsible is the
(l)
optional argument of cmidrule
. Just remove it.– Bernard
Apr 26 '17 at 9:25
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f366744%2fdiscontinuous-line-using-multirow%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown