Is there a table package which automatically calculates the needed number of columns?
up vote
2
down vote
favorite
Is there a table package which automatically calculates the needed number of columns? Take for example this:
documentclass{article}
usepackage{pgf}
usepackage{siunitx}
usepackage{xinttools}
begin{document}
deflist{0,0.5,1,2.5,3,4.5,8}
deff(#1){#1^2}
defpf(#1){pgfmathparse{f(#1)}num[round-precision=1,round-mode=places]{pgfmathresult}}
begin{tabular}{l|*{100}{c}} % Just choose 100, practically enough columns... but this ist not very elegant
$x$ & xintFor #1 in list do { & $#1$} \hline
$f(x)$ & xintFor #1 in list do { & $pf(#1)$}
end{tabular}
end{document}
I can just choose 101 row numbers (large enough for pracical purposes), but this doesn't seem to be the correct way to do this. So is there any package which doesn't require the number of columns for this example?
tables xint
add a comment |
up vote
2
down vote
favorite
Is there a table package which automatically calculates the needed number of columns? Take for example this:
documentclass{article}
usepackage{pgf}
usepackage{siunitx}
usepackage{xinttools}
begin{document}
deflist{0,0.5,1,2.5,3,4.5,8}
deff(#1){#1^2}
defpf(#1){pgfmathparse{f(#1)}num[round-precision=1,round-mode=places]{pgfmathresult}}
begin{tabular}{l|*{100}{c}} % Just choose 100, practically enough columns... but this ist not very elegant
$x$ & xintFor #1 in list do { & $#1$} \hline
$f(x)$ & xintFor #1 in list do { & $pf(#1)$}
end{tabular}
end{document}
I can just choose 101 row numbers (large enough for pracical purposes), but this doesn't seem to be the correct way to do this. So is there any package which doesn't require the number of columns for this example?
tables xint
1
that is exactly what amsmath does to avoid needing to specify the number of columns in matrix
– David Carlisle
Mar 12 '17 at 16:06
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Is there a table package which automatically calculates the needed number of columns? Take for example this:
documentclass{article}
usepackage{pgf}
usepackage{siunitx}
usepackage{xinttools}
begin{document}
deflist{0,0.5,1,2.5,3,4.5,8}
deff(#1){#1^2}
defpf(#1){pgfmathparse{f(#1)}num[round-precision=1,round-mode=places]{pgfmathresult}}
begin{tabular}{l|*{100}{c}} % Just choose 100, practically enough columns... but this ist not very elegant
$x$ & xintFor #1 in list do { & $#1$} \hline
$f(x)$ & xintFor #1 in list do { & $pf(#1)$}
end{tabular}
end{document}
I can just choose 101 row numbers (large enough for pracical purposes), but this doesn't seem to be the correct way to do this. So is there any package which doesn't require the number of columns for this example?
tables xint
Is there a table package which automatically calculates the needed number of columns? Take for example this:
documentclass{article}
usepackage{pgf}
usepackage{siunitx}
usepackage{xinttools}
begin{document}
deflist{0,0.5,1,2.5,3,4.5,8}
deff(#1){#1^2}
defpf(#1){pgfmathparse{f(#1)}num[round-precision=1,round-mode=places]{pgfmathresult}}
begin{tabular}{l|*{100}{c}} % Just choose 100, practically enough columns... but this ist not very elegant
$x$ & xintFor #1 in list do { & $#1$} \hline
$f(x)$ & xintFor #1 in list do { & $pf(#1)$}
end{tabular}
end{document}
I can just choose 101 row numbers (large enough for pracical purposes), but this doesn't seem to be the correct way to do this. So is there any package which doesn't require the number of columns for this example?
tables xint
tables xint
edited Nov 19 at 23:59
Andrew
29.4k34178
29.4k34178
asked Mar 12 '17 at 16:05
student
12.2k2396173
12.2k2396173
1
that is exactly what amsmath does to avoid needing to specify the number of columns in matrix
– David Carlisle
Mar 12 '17 at 16:06
add a comment |
1
that is exactly what amsmath does to avoid needing to specify the number of columns in matrix
– David Carlisle
Mar 12 '17 at 16:06
1
1
that is exactly what amsmath does to avoid needing to specify the number of columns in matrix
– David Carlisle
Mar 12 '17 at 16:06
that is exactly what amsmath does to avoid needing to specify the number of columns in matrix
– David Carlisle
Mar 12 '17 at 16:06
add a comment |
1 Answer
1
active
oldest
votes
up vote
4
down vote
accepted
using some large number in a *
column repeat isn't so bad, it's how amsmath
matrix
avoids the need to specify columns, however if you want to access TeX's primitive feature of a &&
meaning to repeat all following column specifications as often as needed then you can do something like
documentclass{article}
usepackage{pgf}
usepackage{siunitx}
usepackage{xinttools}
begin{document}
makeatletter
newcolumntype{?}{!{d@llarend&span@gobbletwo}}
makeatother
deflist{0,0.5,1,2.5,3,4.5,8}
deff(#1){#1^2}
defpf(#1){pgfmathparse{f(#1)}num[round-precision=1,round-mode=places]{pgfmathresult}}
begin{tabular}{l|?c}
$x$ & xintFor #1 in list do { & $#1$} \hline
$f(x)$ & xintFor #1 in list do { & $pf(#1)$}
end{tabular}
end{document}
Where do you use&&
?
– Werner
Mar 12 '17 at 17:12
1
@Werner the array package added one and I dropped in another, and thespan@gobbletwo
made them come next to each other.
– David Carlisle
Mar 12 '17 at 17:13
this deserves some LaTeX user interface!
– jfbu
Nov 20 at 9:11
@jfbu I'm upset that you don't consider my&span@gobbletwo
as a high level well designed and intuitive latex user interface :(
– David Carlisle
Nov 20 at 9:22
I would were it not for the@
:)
– jfbu
Nov 20 at 11:10
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
using some large number in a *
column repeat isn't so bad, it's how amsmath
matrix
avoids the need to specify columns, however if you want to access TeX's primitive feature of a &&
meaning to repeat all following column specifications as often as needed then you can do something like
documentclass{article}
usepackage{pgf}
usepackage{siunitx}
usepackage{xinttools}
begin{document}
makeatletter
newcolumntype{?}{!{d@llarend&span@gobbletwo}}
makeatother
deflist{0,0.5,1,2.5,3,4.5,8}
deff(#1){#1^2}
defpf(#1){pgfmathparse{f(#1)}num[round-precision=1,round-mode=places]{pgfmathresult}}
begin{tabular}{l|?c}
$x$ & xintFor #1 in list do { & $#1$} \hline
$f(x)$ & xintFor #1 in list do { & $pf(#1)$}
end{tabular}
end{document}
Where do you use&&
?
– Werner
Mar 12 '17 at 17:12
1
@Werner the array package added one and I dropped in another, and thespan@gobbletwo
made them come next to each other.
– David Carlisle
Mar 12 '17 at 17:13
this deserves some LaTeX user interface!
– jfbu
Nov 20 at 9:11
@jfbu I'm upset that you don't consider my&span@gobbletwo
as a high level well designed and intuitive latex user interface :(
– David Carlisle
Nov 20 at 9:22
I would were it not for the@
:)
– jfbu
Nov 20 at 11:10
add a comment |
up vote
4
down vote
accepted
using some large number in a *
column repeat isn't so bad, it's how amsmath
matrix
avoids the need to specify columns, however if you want to access TeX's primitive feature of a &&
meaning to repeat all following column specifications as often as needed then you can do something like
documentclass{article}
usepackage{pgf}
usepackage{siunitx}
usepackage{xinttools}
begin{document}
makeatletter
newcolumntype{?}{!{d@llarend&span@gobbletwo}}
makeatother
deflist{0,0.5,1,2.5,3,4.5,8}
deff(#1){#1^2}
defpf(#1){pgfmathparse{f(#1)}num[round-precision=1,round-mode=places]{pgfmathresult}}
begin{tabular}{l|?c}
$x$ & xintFor #1 in list do { & $#1$} \hline
$f(x)$ & xintFor #1 in list do { & $pf(#1)$}
end{tabular}
end{document}
Where do you use&&
?
– Werner
Mar 12 '17 at 17:12
1
@Werner the array package added one and I dropped in another, and thespan@gobbletwo
made them come next to each other.
– David Carlisle
Mar 12 '17 at 17:13
this deserves some LaTeX user interface!
– jfbu
Nov 20 at 9:11
@jfbu I'm upset that you don't consider my&span@gobbletwo
as a high level well designed and intuitive latex user interface :(
– David Carlisle
Nov 20 at 9:22
I would were it not for the@
:)
– jfbu
Nov 20 at 11:10
add a comment |
up vote
4
down vote
accepted
up vote
4
down vote
accepted
using some large number in a *
column repeat isn't so bad, it's how amsmath
matrix
avoids the need to specify columns, however if you want to access TeX's primitive feature of a &&
meaning to repeat all following column specifications as often as needed then you can do something like
documentclass{article}
usepackage{pgf}
usepackage{siunitx}
usepackage{xinttools}
begin{document}
makeatletter
newcolumntype{?}{!{d@llarend&span@gobbletwo}}
makeatother
deflist{0,0.5,1,2.5,3,4.5,8}
deff(#1){#1^2}
defpf(#1){pgfmathparse{f(#1)}num[round-precision=1,round-mode=places]{pgfmathresult}}
begin{tabular}{l|?c}
$x$ & xintFor #1 in list do { & $#1$} \hline
$f(x)$ & xintFor #1 in list do { & $pf(#1)$}
end{tabular}
end{document}
using some large number in a *
column repeat isn't so bad, it's how amsmath
matrix
avoids the need to specify columns, however if you want to access TeX's primitive feature of a &&
meaning to repeat all following column specifications as often as needed then you can do something like
documentclass{article}
usepackage{pgf}
usepackage{siunitx}
usepackage{xinttools}
begin{document}
makeatletter
newcolumntype{?}{!{d@llarend&span@gobbletwo}}
makeatother
deflist{0,0.5,1,2.5,3,4.5,8}
deff(#1){#1^2}
defpf(#1){pgfmathparse{f(#1)}num[round-precision=1,round-mode=places]{pgfmathresult}}
begin{tabular}{l|?c}
$x$ & xintFor #1 in list do { & $#1$} \hline
$f(x)$ & xintFor #1 in list do { & $pf(#1)$}
end{tabular}
end{document}
answered Mar 12 '17 at 17:08
David Carlisle
477k3811061841
477k3811061841
Where do you use&&
?
– Werner
Mar 12 '17 at 17:12
1
@Werner the array package added one and I dropped in another, and thespan@gobbletwo
made them come next to each other.
– David Carlisle
Mar 12 '17 at 17:13
this deserves some LaTeX user interface!
– jfbu
Nov 20 at 9:11
@jfbu I'm upset that you don't consider my&span@gobbletwo
as a high level well designed and intuitive latex user interface :(
– David Carlisle
Nov 20 at 9:22
I would were it not for the@
:)
– jfbu
Nov 20 at 11:10
add a comment |
Where do you use&&
?
– Werner
Mar 12 '17 at 17:12
1
@Werner the array package added one and I dropped in another, and thespan@gobbletwo
made them come next to each other.
– David Carlisle
Mar 12 '17 at 17:13
this deserves some LaTeX user interface!
– jfbu
Nov 20 at 9:11
@jfbu I'm upset that you don't consider my&span@gobbletwo
as a high level well designed and intuitive latex user interface :(
– David Carlisle
Nov 20 at 9:22
I would were it not for the@
:)
– jfbu
Nov 20 at 11:10
Where do you use
&&
?– Werner
Mar 12 '17 at 17:12
Where do you use
&&
?– Werner
Mar 12 '17 at 17:12
1
1
@Werner the array package added one and I dropped in another, and the
span@gobbletwo
made them come next to each other.– David Carlisle
Mar 12 '17 at 17:13
@Werner the array package added one and I dropped in another, and the
span@gobbletwo
made them come next to each other.– David Carlisle
Mar 12 '17 at 17:13
this deserves some LaTeX user interface!
– jfbu
Nov 20 at 9:11
this deserves some LaTeX user interface!
– jfbu
Nov 20 at 9:11
@jfbu I'm upset that you don't consider my
&span@gobbletwo
as a high level well designed and intuitive latex user interface :(– David Carlisle
Nov 20 at 9:22
@jfbu I'm upset that you don't consider my
&span@gobbletwo
as a high level well designed and intuitive latex user interface :(– David Carlisle
Nov 20 at 9:22
I would were it not for the
@
:)
– jfbu
Nov 20 at 11:10
I would were it not for the
@
:)
– jfbu
Nov 20 at 11:10
add a comment |
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%2f358105%2fis-there-a-table-package-which-automatically-calculates-the-needed-number-of-col%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
1
that is exactly what amsmath does to avoid needing to specify the number of columns in matrix
– David Carlisle
Mar 12 '17 at 16:06