Problem with longtable and \
The code is the following:
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{tabularx}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\[10pt]
12 & asdf asdf asdf asdf asdf.\[10pt]
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\[10pt]
end{longtable}
end{document}
and the output is
that is, in each row, the vertical space 10pt is considered from the first line and not from the last line. If, for instance, in the first row you put 30pt instead of 10pt, then a vertical space appears between the first and the second row. I think this problem appeared in an updating of some packages of MikTeX.
Does anyone know of any solution to this problem?
Thanks
longtable
New contributor
add a comment |
The code is the following:
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{tabularx}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\[10pt]
12 & asdf asdf asdf asdf asdf.\[10pt]
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\[10pt]
end{longtable}
end{document}
and the output is
that is, in each row, the vertical space 10pt is considered from the first line and not from the last line. If, for instance, in the first row you put 30pt instead of 10pt, then a vertical space appears between the first and the second row. I think this problem appeared in an updating of some packages of MikTeX.
Does anyone know of any solution to this problem?
Thanks
longtable
New contributor
add a comment |
The code is the following:
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{tabularx}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\[10pt]
12 & asdf asdf asdf asdf asdf.\[10pt]
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\[10pt]
end{longtable}
end{document}
and the output is
that is, in each row, the vertical space 10pt is considered from the first line and not from the last line. If, for instance, in the first row you put 30pt instead of 10pt, then a vertical space appears between the first and the second row. I think this problem appeared in an updating of some packages of MikTeX.
Does anyone know of any solution to this problem?
Thanks
longtable
New contributor
The code is the following:
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{tabularx}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\[10pt]
12 & asdf asdf asdf asdf asdf.\[10pt]
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\[10pt]
end{longtable}
end{document}
and the output is
that is, in each row, the vertical space 10pt is considered from the first line and not from the last line. If, for instance, in the first row you put 30pt instead of 10pt, then a vertical space appears between the first and the second row. I think this problem appeared in an updating of some packages of MikTeX.
Does anyone know of any solution to this problem?
Thanks
longtable
longtable
New contributor
New contributor
New contributor
asked 7 hours ago
SaulSaul
261
261
New contributor
New contributor
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
2 ways:
Employ extrarowheight
from array package
documentclass[a4paper,10pt]{article}
usepackage{longtable,array}
usepackage{tabularx}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
setlengthextrarowheight{10pt}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
12 & asdf asdf asdf asdf asdf.\
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
end{longtable}
end{document}
Build a strut
Here, I create mystrut
, which you can just add to the end of each 3rd-column entry, in lieu of \[10pt]
. One could have just chosen a simple fixed dimension as in newcommandmystrut{rule[-10pt]{0pt}{0pt}}
, but I instead did a dimensional expression to be the equivalent of \[10pt]
.
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{tabularx}
newcommandmystrut{rule[dimexpr-dpstrutbox-10ptrelax]{0pt}{0pt}}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf.mystrut\
12 & asdf asdf asdf asdf asdf.mystrut\
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.mystrut\
end{longtable}
end{document}
Either approach gives the following output (plus/minus some leading space at the beginning of the table)
add a comment |
You can use addlinespace
from booktabs
:
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{tabularx}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
usepackage{booktabs}
setlength{defaultaddspace}{10pt}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
addlinespace
12 & asdf asdf asdf asdf asdf.\
addlinespace
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.
end{longtable}
end{document}
add a comment |
The \[<dimen>
command in a table tells LaTeX that the current row extends at least <dimen>
below the baseline, in addition to the depth of a strut. Since your row extends much deeper than 10pt, the [10pt]
argument adds nothing.
The addlinespace
command provided by booktabs
, which could simply called
addlinespace[10pt]
instead of globally changing defaultaddspace
is good. Without packages, you can do
noalign{vspace{10pt}}
between rows.
I suggest using the relatively new w
column specifier instead of >{raggedleft}p{0.1textwidth}
, for a column where line breaks are not needed.
It requires usepackage{array}
, which is automatically called by tabularx
. In the code below I load it explicitly. It's needed anyway for newcolumntype
.
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{array}
newcolumntype{L}{w{r}{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf asdf asdf.\
noalign{vspace{10pt}}
12 & asdf asdf asdf asdf asdf.\
noalign{vspace{10pt}}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
end{longtable}
end{document}
add a comment |
Your Answer
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
});
}
});
Saul is a new contributor. Be nice, and check out our Code of Conduct.
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%2f473538%2fproblem-with-longtable-and%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
2 ways:
Employ extrarowheight
from array package
documentclass[a4paper,10pt]{article}
usepackage{longtable,array}
usepackage{tabularx}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
setlengthextrarowheight{10pt}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
12 & asdf asdf asdf asdf asdf.\
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
end{longtable}
end{document}
Build a strut
Here, I create mystrut
, which you can just add to the end of each 3rd-column entry, in lieu of \[10pt]
. One could have just chosen a simple fixed dimension as in newcommandmystrut{rule[-10pt]{0pt}{0pt}}
, but I instead did a dimensional expression to be the equivalent of \[10pt]
.
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{tabularx}
newcommandmystrut{rule[dimexpr-dpstrutbox-10ptrelax]{0pt}{0pt}}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf.mystrut\
12 & asdf asdf asdf asdf asdf.mystrut\
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.mystrut\
end{longtable}
end{document}
Either approach gives the following output (plus/minus some leading space at the beginning of the table)
add a comment |
2 ways:
Employ extrarowheight
from array package
documentclass[a4paper,10pt]{article}
usepackage{longtable,array}
usepackage{tabularx}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
setlengthextrarowheight{10pt}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
12 & asdf asdf asdf asdf asdf.\
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
end{longtable}
end{document}
Build a strut
Here, I create mystrut
, which you can just add to the end of each 3rd-column entry, in lieu of \[10pt]
. One could have just chosen a simple fixed dimension as in newcommandmystrut{rule[-10pt]{0pt}{0pt}}
, but I instead did a dimensional expression to be the equivalent of \[10pt]
.
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{tabularx}
newcommandmystrut{rule[dimexpr-dpstrutbox-10ptrelax]{0pt}{0pt}}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf.mystrut\
12 & asdf asdf asdf asdf asdf.mystrut\
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.mystrut\
end{longtable}
end{document}
Either approach gives the following output (plus/minus some leading space at the beginning of the table)
add a comment |
2 ways:
Employ extrarowheight
from array package
documentclass[a4paper,10pt]{article}
usepackage{longtable,array}
usepackage{tabularx}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
setlengthextrarowheight{10pt}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
12 & asdf asdf asdf asdf asdf.\
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
end{longtable}
end{document}
Build a strut
Here, I create mystrut
, which you can just add to the end of each 3rd-column entry, in lieu of \[10pt]
. One could have just chosen a simple fixed dimension as in newcommandmystrut{rule[-10pt]{0pt}{0pt}}
, but I instead did a dimensional expression to be the equivalent of \[10pt]
.
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{tabularx}
newcommandmystrut{rule[dimexpr-dpstrutbox-10ptrelax]{0pt}{0pt}}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf.mystrut\
12 & asdf asdf asdf asdf asdf.mystrut\
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.mystrut\
end{longtable}
end{document}
Either approach gives the following output (plus/minus some leading space at the beginning of the table)
2 ways:
Employ extrarowheight
from array package
documentclass[a4paper,10pt]{article}
usepackage{longtable,array}
usepackage{tabularx}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
setlengthextrarowheight{10pt}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
12 & asdf asdf asdf asdf asdf.\
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
end{longtable}
end{document}
Build a strut
Here, I create mystrut
, which you can just add to the end of each 3rd-column entry, in lieu of \[10pt]
. One could have just chosen a simple fixed dimension as in newcommandmystrut{rule[-10pt]{0pt}{0pt}}
, but I instead did a dimensional expression to be the equivalent of \[10pt]
.
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{tabularx}
newcommandmystrut{rule[dimexpr-dpstrutbox-10ptrelax]{0pt}{0pt}}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf.mystrut\
12 & asdf asdf asdf asdf asdf.mystrut\
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.mystrut\
end{longtable}
end{document}
Either approach gives the following output (plus/minus some leading space at the beginning of the table)
edited 7 hours ago
answered 7 hours ago
Steven B. SegletesSteven B. Segletes
154k9195403
154k9195403
add a comment |
add a comment |
You can use addlinespace
from booktabs
:
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{tabularx}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
usepackage{booktabs}
setlength{defaultaddspace}{10pt}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
addlinespace
12 & asdf asdf asdf asdf asdf.\
addlinespace
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.
end{longtable}
end{document}
add a comment |
You can use addlinespace
from booktabs
:
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{tabularx}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
usepackage{booktabs}
setlength{defaultaddspace}{10pt}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
addlinespace
12 & asdf asdf asdf asdf asdf.\
addlinespace
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.
end{longtable}
end{document}
add a comment |
You can use addlinespace
from booktabs
:
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{tabularx}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
usepackage{booktabs}
setlength{defaultaddspace}{10pt}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
addlinespace
12 & asdf asdf asdf asdf asdf.\
addlinespace
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.
end{longtable}
end{document}
You can use addlinespace
from booktabs
:
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{tabularx}
newcolumntype{L}{>{raggedleft}p{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
usepackage{booktabs}
setlength{defaultaddspace}{10pt}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
addlinespace
12 & asdf asdf asdf asdf asdf.\
addlinespace
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.
end{longtable}
end{document}
answered 7 hours ago
BernardBernard
169k773198
169k773198
add a comment |
add a comment |
The \[<dimen>
command in a table tells LaTeX that the current row extends at least <dimen>
below the baseline, in addition to the depth of a strut. Since your row extends much deeper than 10pt, the [10pt]
argument adds nothing.
The addlinespace
command provided by booktabs
, which could simply called
addlinespace[10pt]
instead of globally changing defaultaddspace
is good. Without packages, you can do
noalign{vspace{10pt}}
between rows.
I suggest using the relatively new w
column specifier instead of >{raggedleft}p{0.1textwidth}
, for a column where line breaks are not needed.
It requires usepackage{array}
, which is automatically called by tabularx
. In the code below I load it explicitly. It's needed anyway for newcolumntype
.
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{array}
newcolumntype{L}{w{r}{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf asdf asdf.\
noalign{vspace{10pt}}
12 & asdf asdf asdf asdf asdf.\
noalign{vspace{10pt}}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
end{longtable}
end{document}
add a comment |
The \[<dimen>
command in a table tells LaTeX that the current row extends at least <dimen>
below the baseline, in addition to the depth of a strut. Since your row extends much deeper than 10pt, the [10pt]
argument adds nothing.
The addlinespace
command provided by booktabs
, which could simply called
addlinespace[10pt]
instead of globally changing defaultaddspace
is good. Without packages, you can do
noalign{vspace{10pt}}
between rows.
I suggest using the relatively new w
column specifier instead of >{raggedleft}p{0.1textwidth}
, for a column where line breaks are not needed.
It requires usepackage{array}
, which is automatically called by tabularx
. In the code below I load it explicitly. It's needed anyway for newcolumntype
.
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{array}
newcolumntype{L}{w{r}{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf asdf asdf.\
noalign{vspace{10pt}}
12 & asdf asdf asdf asdf asdf.\
noalign{vspace{10pt}}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
end{longtable}
end{document}
add a comment |
The \[<dimen>
command in a table tells LaTeX that the current row extends at least <dimen>
below the baseline, in addition to the depth of a strut. Since your row extends much deeper than 10pt, the [10pt]
argument adds nothing.
The addlinespace
command provided by booktabs
, which could simply called
addlinespace[10pt]
instead of globally changing defaultaddspace
is good. Without packages, you can do
noalign{vspace{10pt}}
between rows.
I suggest using the relatively new w
column specifier instead of >{raggedleft}p{0.1textwidth}
, for a column where line breaks are not needed.
It requires usepackage{array}
, which is automatically called by tabularx
. In the code below I load it explicitly. It's needed anyway for newcolumntype
.
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{array}
newcolumntype{L}{w{r}{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf asdf asdf.\
noalign{vspace{10pt}}
12 & asdf asdf asdf asdf asdf.\
noalign{vspace{10pt}}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
end{longtable}
end{document}
The \[<dimen>
command in a table tells LaTeX that the current row extends at least <dimen>
below the baseline, in addition to the depth of a strut. Since your row extends much deeper than 10pt, the [10pt]
argument adds nothing.
The addlinespace
command provided by booktabs
, which could simply called
addlinespace[10pt]
instead of globally changing defaultaddspace
is good. Without packages, you can do
noalign{vspace{10pt}}
between rows.
I suggest using the relatively new w
column specifier instead of >{raggedleft}p{0.1textwidth}
, for a column where line breaks are not needed.
It requires usepackage{array}
, which is automatically called by tabularx
. In the code below I load it explicitly. It's needed anyway for newcolumntype
.
documentclass[a4paper,10pt]{article}
usepackage{longtable}
usepackage{array}
newcolumntype{L}{w{r}{0.1textwidth}}
newcolumntype{R}{p{0.80textwidth}}
begin{document}
begin{longtable}{L!{---}R}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf asdf asdf.\
noalign{vspace{10pt}}
12 & asdf asdf asdf asdf asdf.\
noalign{vspace{10pt}}
12 & asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf.\
end{longtable}
end{document}
answered 6 hours ago
egregegreg
717k8719023197
717k8719023197
add a comment |
add a comment |
Saul is a new contributor. Be nice, and check out our Code of Conduct.
Saul is a new contributor. Be nice, and check out our Code of Conduct.
Saul is a new contributor. Be nice, and check out our Code of Conduct.
Saul is a new contributor. Be nice, and check out our Code of Conduct.
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%2f473538%2fproblem-with-longtable-and%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