pgfplotstable adding vertical space between fractions
MWE
% stand-alone file to test writing a table in pgfplotstable
documentclass{book}
usepackage{booktabs,multirow} % required
usepackage{pgfplotstable}
pgfplotsset{compat=1.16}
begin{document}
%renewcommand{arraystretch}{1.2}
pgfplotstabletypeset
[
after row = vspace{0.8mm},
every head row/.style =
{
before row = toprule,
after row = midrule,
},
every last row/.style =
{
after row = bottomrule,
},
columns/x/.style =
{
column type = r,
column name = $x$,
frac,
},
columns/y/.style =
{
column type = r,
column name = ${y=frac{2}{x}}$,
frac,
},
]
{
x y
-4 -0.5 % vertical space not added after this row
-3 -0.66666666 % vert space added below here
-2 -1
-1 -2
-0.5 -4
0.5 4
1 2
2 1
3 0.66666666
4 0.5
} % pgfplotstabletypeset{} END
end{document}
To display columns of fractions (with pgfplotstable, booktabs and multirows), I need to add vertical space between the rows so the fraction of the current row does not step on the fraction of the previous row. As shown in the MWE, I added
after row = {vspace{0.8mm}},
to the options for pgfplotstabletypeset, but it compiled by adding space to every row after row 1, not between rows 0 and 1. See image.
I added the usual arraystretch command (commented out in MWE) prior to pgfplotstabletypeset, but it is outside my block, and since I have dozens of tables in this document, not all need to have the array stretch applied. Yes, I could put braces around the source text, but I hope there is something cleaner to add to the options that I missed.
Why is the space not added between rows 0 and 1?
vertical-alignment pgfplotstable fractions
add a comment |
MWE
% stand-alone file to test writing a table in pgfplotstable
documentclass{book}
usepackage{booktabs,multirow} % required
usepackage{pgfplotstable}
pgfplotsset{compat=1.16}
begin{document}
%renewcommand{arraystretch}{1.2}
pgfplotstabletypeset
[
after row = vspace{0.8mm},
every head row/.style =
{
before row = toprule,
after row = midrule,
},
every last row/.style =
{
after row = bottomrule,
},
columns/x/.style =
{
column type = r,
column name = $x$,
frac,
},
columns/y/.style =
{
column type = r,
column name = ${y=frac{2}{x}}$,
frac,
},
]
{
x y
-4 -0.5 % vertical space not added after this row
-3 -0.66666666 % vert space added below here
-2 -1
-1 -2
-0.5 -4
0.5 4
1 2
2 1
3 0.66666666
4 0.5
} % pgfplotstabletypeset{} END
end{document}
To display columns of fractions (with pgfplotstable, booktabs and multirows), I need to add vertical space between the rows so the fraction of the current row does not step on the fraction of the previous row. As shown in the MWE, I added
after row = {vspace{0.8mm}},
to the options for pgfplotstabletypeset, but it compiled by adding space to every row after row 1, not between rows 0 and 1. See image.
I added the usual arraystretch command (commented out in MWE) prior to pgfplotstabletypeset, but it is outside my block, and since I have dozens of tables in this document, not all need to have the array stretch applied. Yes, I could put braces around the source text, but I hope there is something cleaner to add to the options that I missed.
Why is the space not added between rows 0 and 1?
vertical-alignment pgfplotstable fractions
add a comment |
MWE
% stand-alone file to test writing a table in pgfplotstable
documentclass{book}
usepackage{booktabs,multirow} % required
usepackage{pgfplotstable}
pgfplotsset{compat=1.16}
begin{document}
%renewcommand{arraystretch}{1.2}
pgfplotstabletypeset
[
after row = vspace{0.8mm},
every head row/.style =
{
before row = toprule,
after row = midrule,
},
every last row/.style =
{
after row = bottomrule,
},
columns/x/.style =
{
column type = r,
column name = $x$,
frac,
},
columns/y/.style =
{
column type = r,
column name = ${y=frac{2}{x}}$,
frac,
},
]
{
x y
-4 -0.5 % vertical space not added after this row
-3 -0.66666666 % vert space added below here
-2 -1
-1 -2
-0.5 -4
0.5 4
1 2
2 1
3 0.66666666
4 0.5
} % pgfplotstabletypeset{} END
end{document}
To display columns of fractions (with pgfplotstable, booktabs and multirows), I need to add vertical space between the rows so the fraction of the current row does not step on the fraction of the previous row. As shown in the MWE, I added
after row = {vspace{0.8mm}},
to the options for pgfplotstabletypeset, but it compiled by adding space to every row after row 1, not between rows 0 and 1. See image.
I added the usual arraystretch command (commented out in MWE) prior to pgfplotstabletypeset, but it is outside my block, and since I have dozens of tables in this document, not all need to have the array stretch applied. Yes, I could put braces around the source text, but I hope there is something cleaner to add to the options that I missed.
Why is the space not added between rows 0 and 1?
vertical-alignment pgfplotstable fractions
MWE
% stand-alone file to test writing a table in pgfplotstable
documentclass{book}
usepackage{booktabs,multirow} % required
usepackage{pgfplotstable}
pgfplotsset{compat=1.16}
begin{document}
%renewcommand{arraystretch}{1.2}
pgfplotstabletypeset
[
after row = vspace{0.8mm},
every head row/.style =
{
before row = toprule,
after row = midrule,
},
every last row/.style =
{
after row = bottomrule,
},
columns/x/.style =
{
column type = r,
column name = $x$,
frac,
},
columns/y/.style =
{
column type = r,
column name = ${y=frac{2}{x}}$,
frac,
},
]
{
x y
-4 -0.5 % vertical space not added after this row
-3 -0.66666666 % vert space added below here
-2 -1
-1 -2
-0.5 -4
0.5 4
1 2
2 1
3 0.66666666
4 0.5
} % pgfplotstabletypeset{} END
end{document}
To display columns of fractions (with pgfplotstable, booktabs and multirows), I need to add vertical space between the rows so the fraction of the current row does not step on the fraction of the previous row. As shown in the MWE, I added
after row = {vspace{0.8mm}},
to the options for pgfplotstabletypeset, but it compiled by adding space to every row after row 1, not between rows 0 and 1. See image.
I added the usual arraystretch command (commented out in MWE) prior to pgfplotstabletypeset, but it is outside my block, and since I have dozens of tables in this document, not all need to have the array stretch applied. Yes, I could put braces around the source text, but I hope there is something cleaner to add to the options that I missed.
Why is the space not added between rows 0 and 1?
vertical-alignment pgfplotstable fractions
vertical-alignment pgfplotstable fractions
asked Apr 2 at 14:45
kpo7057kpo7057
697
697
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
pgfplotstable
allows you to specify the code for fractions via frac TeX
. This can be used to add more vertical space where fractions appear e.g. by adding a vertical phantom.
documentclass{book}
usepackage{booktabs,multirow} % required
usepackage{pgfplotstable}
pgfplotsset{compat=1.16}
begin{document}
%renewcommand{arraystretch}{1.2}
pgfplotstabletypeset
[
after row ={[0.3ex]}, %<use this instead of vspace
frac TeX=vphantom{displaystylefrac{1}{2}}frac,
every head row/.style =
{
before row = toprule,
after row = midrule,
},
every last row/.style =
{
after row = bottomrule,
},
columns/x/.style =
{
column type = r,
column name = $x$,
frac,
},
columns/y/.style =
{
column type = r,
column name = ${y=frac{2}{x}}$,
frac,
},
]
{
x y
-4 -0.5
-3 -0.66666666
-2 -1
-1 -2
-0.5 -4
0.5 4
1 2
2 1
3 0.66666666
4 0.5
} % pgfplotstabletypeset{} END
end{document}
Is it possible to addhline
to each line?
– manooooh
Apr 3 at 5:18
1
@manooooh Yes, e.g. withafter row ={[0.3ex] midrule},
.
– marmot
Apr 3 at 5:21
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
});
}
});
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%2f482785%2fpgfplotstable-adding-vertical-space-between-fractions%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
pgfplotstable
allows you to specify the code for fractions via frac TeX
. This can be used to add more vertical space where fractions appear e.g. by adding a vertical phantom.
documentclass{book}
usepackage{booktabs,multirow} % required
usepackage{pgfplotstable}
pgfplotsset{compat=1.16}
begin{document}
%renewcommand{arraystretch}{1.2}
pgfplotstabletypeset
[
after row ={[0.3ex]}, %<use this instead of vspace
frac TeX=vphantom{displaystylefrac{1}{2}}frac,
every head row/.style =
{
before row = toprule,
after row = midrule,
},
every last row/.style =
{
after row = bottomrule,
},
columns/x/.style =
{
column type = r,
column name = $x$,
frac,
},
columns/y/.style =
{
column type = r,
column name = ${y=frac{2}{x}}$,
frac,
},
]
{
x y
-4 -0.5
-3 -0.66666666
-2 -1
-1 -2
-0.5 -4
0.5 4
1 2
2 1
3 0.66666666
4 0.5
} % pgfplotstabletypeset{} END
end{document}
Is it possible to addhline
to each line?
– manooooh
Apr 3 at 5:18
1
@manooooh Yes, e.g. withafter row ={[0.3ex] midrule},
.
– marmot
Apr 3 at 5:21
add a comment |
pgfplotstable
allows you to specify the code for fractions via frac TeX
. This can be used to add more vertical space where fractions appear e.g. by adding a vertical phantom.
documentclass{book}
usepackage{booktabs,multirow} % required
usepackage{pgfplotstable}
pgfplotsset{compat=1.16}
begin{document}
%renewcommand{arraystretch}{1.2}
pgfplotstabletypeset
[
after row ={[0.3ex]}, %<use this instead of vspace
frac TeX=vphantom{displaystylefrac{1}{2}}frac,
every head row/.style =
{
before row = toprule,
after row = midrule,
},
every last row/.style =
{
after row = bottomrule,
},
columns/x/.style =
{
column type = r,
column name = $x$,
frac,
},
columns/y/.style =
{
column type = r,
column name = ${y=frac{2}{x}}$,
frac,
},
]
{
x y
-4 -0.5
-3 -0.66666666
-2 -1
-1 -2
-0.5 -4
0.5 4
1 2
2 1
3 0.66666666
4 0.5
} % pgfplotstabletypeset{} END
end{document}
Is it possible to addhline
to each line?
– manooooh
Apr 3 at 5:18
1
@manooooh Yes, e.g. withafter row ={[0.3ex] midrule},
.
– marmot
Apr 3 at 5:21
add a comment |
pgfplotstable
allows you to specify the code for fractions via frac TeX
. This can be used to add more vertical space where fractions appear e.g. by adding a vertical phantom.
documentclass{book}
usepackage{booktabs,multirow} % required
usepackage{pgfplotstable}
pgfplotsset{compat=1.16}
begin{document}
%renewcommand{arraystretch}{1.2}
pgfplotstabletypeset
[
after row ={[0.3ex]}, %<use this instead of vspace
frac TeX=vphantom{displaystylefrac{1}{2}}frac,
every head row/.style =
{
before row = toprule,
after row = midrule,
},
every last row/.style =
{
after row = bottomrule,
},
columns/x/.style =
{
column type = r,
column name = $x$,
frac,
},
columns/y/.style =
{
column type = r,
column name = ${y=frac{2}{x}}$,
frac,
},
]
{
x y
-4 -0.5
-3 -0.66666666
-2 -1
-1 -2
-0.5 -4
0.5 4
1 2
2 1
3 0.66666666
4 0.5
} % pgfplotstabletypeset{} END
end{document}
pgfplotstable
allows you to specify the code for fractions via frac TeX
. This can be used to add more vertical space where fractions appear e.g. by adding a vertical phantom.
documentclass{book}
usepackage{booktabs,multirow} % required
usepackage{pgfplotstable}
pgfplotsset{compat=1.16}
begin{document}
%renewcommand{arraystretch}{1.2}
pgfplotstabletypeset
[
after row ={[0.3ex]}, %<use this instead of vspace
frac TeX=vphantom{displaystylefrac{1}{2}}frac,
every head row/.style =
{
before row = toprule,
after row = midrule,
},
every last row/.style =
{
after row = bottomrule,
},
columns/x/.style =
{
column type = r,
column name = $x$,
frac,
},
columns/y/.style =
{
column type = r,
column name = ${y=frac{2}{x}}$,
frac,
},
]
{
x y
-4 -0.5
-3 -0.66666666
-2 -1
-1 -2
-0.5 -4
0.5 4
1 2
2 1
3 0.66666666
4 0.5
} % pgfplotstabletypeset{} END
end{document}
answered Apr 3 at 5:05
marmotmarmot
117k5150283
117k5150283
Is it possible to addhline
to each line?
– manooooh
Apr 3 at 5:18
1
@manooooh Yes, e.g. withafter row ={[0.3ex] midrule},
.
– marmot
Apr 3 at 5:21
add a comment |
Is it possible to addhline
to each line?
– manooooh
Apr 3 at 5:18
1
@manooooh Yes, e.g. withafter row ={[0.3ex] midrule},
.
– marmot
Apr 3 at 5:21
Is it possible to add
hline
to each line?– manooooh
Apr 3 at 5:18
Is it possible to add
hline
to each line?– manooooh
Apr 3 at 5:18
1
1
@manooooh Yes, e.g. with
after row ={[0.3ex] midrule},
.– marmot
Apr 3 at 5:21
@manooooh Yes, e.g. with
after row ={[0.3ex] midrule},
.– marmot
Apr 3 at 5:21
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%2f482785%2fpgfplotstable-adding-vertical-space-between-fractions%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