Multicolumn and xintfor
up vote
2
down vote
favorite
This is my first time asking a question on Stack Exchange, although I'm a frequent reader.
I tried to build a tabular that generates a sort of array, with indexes displayed above. This is the code:
$A = $
raisebox{10pt}{
setcounter{N}{5}
begin{tabular}{|*{5}{c|}}
xintFor* #1 in {xintSeq{1}{value{N}}}do{xintifForFirst{tiny #1}{& mc{tiny #1}}}\
hline
$1$ & $3$ & $5$ & $7$ & $8$\
hline
end{tabular}
}
where newcommandmc[1]{multicolumn{1}{l}{#1}}.

I would like it to be exactly the way it is now, but without the first two vertical lines in the indexes row. If I use mc in the first block of xintifForFirst (as I did successfully for the second block) it doesn't compile and I can't understand why. The error I get is ! Misplaced omit.
multispan ->omit @multispan
Thanks in advance :-)
Edit: As suggested by Andrew I'm writing an example of the error I get:
documentclass{article}
usepackage{tabularx}
usepackage{xinttools}
newcounter{N}
newcommandmc[1]{multicolumn{1}{l}{#1}}
newcommand{myarray}[2]{
raisebox{8pt}{
begin{tabular}{|*{#1}{c|}}
setcounter{N}{#1}
xintFor* ##1 in {xintSeq{1}{value{N}}}do{xintifForFirst{mc{ tiny ##1}}{& mc{tiny ##1}}}\
hline
#2\
hline
end{tabular}
}
}
begin{document}
$B = $myarray{11}{$0$ & $0$ & $1$ & $0$ & $1$ & $0$ & $0$ & $1$ & $0$ & $1$ & $0$}
end{document}
tables multicolumn xint
New contributor
Gemma Martini is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
2
down vote
favorite
This is my first time asking a question on Stack Exchange, although I'm a frequent reader.
I tried to build a tabular that generates a sort of array, with indexes displayed above. This is the code:
$A = $
raisebox{10pt}{
setcounter{N}{5}
begin{tabular}{|*{5}{c|}}
xintFor* #1 in {xintSeq{1}{value{N}}}do{xintifForFirst{tiny #1}{& mc{tiny #1}}}\
hline
$1$ & $3$ & $5$ & $7$ & $8$\
hline
end{tabular}
}
where newcommandmc[1]{multicolumn{1}{l}{#1}}.

I would like it to be exactly the way it is now, but without the first two vertical lines in the indexes row. If I use mc in the first block of xintifForFirst (as I did successfully for the second block) it doesn't compile and I can't understand why. The error I get is ! Misplaced omit.
multispan ->omit @multispan
Thanks in advance :-)
Edit: As suggested by Andrew I'm writing an example of the error I get:
documentclass{article}
usepackage{tabularx}
usepackage{xinttools}
newcounter{N}
newcommandmc[1]{multicolumn{1}{l}{#1}}
newcommand{myarray}[2]{
raisebox{8pt}{
begin{tabular}{|*{#1}{c|}}
setcounter{N}{#1}
xintFor* ##1 in {xintSeq{1}{value{N}}}do{xintifForFirst{mc{ tiny ##1}}{& mc{tiny ##1}}}\
hline
#2\
hline
end{tabular}
}
}
begin{document}
$B = $myarray{11}{$0$ & $0$ & $1$ & $0$ & $1$ & $0$ & $0$ & $1$ & $0$ & $1$ & $0$}
end{document}
tables multicolumn xint
New contributor
Gemma Martini is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Welcome to TeX.SX! Can you please expand the code snippet that you have posted to a full minimal working example. It is much easier to help you if we can start with some compilable code that illustrates your problem. A MWE should start with adocumentclasscommand, include any necessary packages and be as small as possible to demonstrate your problem. To highlight code-blocks, either indent them by four spaces or use the{}on the gui.
– Andrew
2 days ago
Thank you for your suggestions, I edited the question
– Gemma Martini
yesterday
I suspect that the error has something to do with the "implementation features" box in section 15.17 (page 188) of the xint manual, but I didn't manage to solve the problem. I'm sure that @jfbu will be able to to fix this instantly.
– Andrew
yesterday
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
This is my first time asking a question on Stack Exchange, although I'm a frequent reader.
I tried to build a tabular that generates a sort of array, with indexes displayed above. This is the code:
$A = $
raisebox{10pt}{
setcounter{N}{5}
begin{tabular}{|*{5}{c|}}
xintFor* #1 in {xintSeq{1}{value{N}}}do{xintifForFirst{tiny #1}{& mc{tiny #1}}}\
hline
$1$ & $3$ & $5$ & $7$ & $8$\
hline
end{tabular}
}
where newcommandmc[1]{multicolumn{1}{l}{#1}}.

I would like it to be exactly the way it is now, but without the first two vertical lines in the indexes row. If I use mc in the first block of xintifForFirst (as I did successfully for the second block) it doesn't compile and I can't understand why. The error I get is ! Misplaced omit.
multispan ->omit @multispan
Thanks in advance :-)
Edit: As suggested by Andrew I'm writing an example of the error I get:
documentclass{article}
usepackage{tabularx}
usepackage{xinttools}
newcounter{N}
newcommandmc[1]{multicolumn{1}{l}{#1}}
newcommand{myarray}[2]{
raisebox{8pt}{
begin{tabular}{|*{#1}{c|}}
setcounter{N}{#1}
xintFor* ##1 in {xintSeq{1}{value{N}}}do{xintifForFirst{mc{ tiny ##1}}{& mc{tiny ##1}}}\
hline
#2\
hline
end{tabular}
}
}
begin{document}
$B = $myarray{11}{$0$ & $0$ & $1$ & $0$ & $1$ & $0$ & $0$ & $1$ & $0$ & $1$ & $0$}
end{document}
tables multicolumn xint
New contributor
Gemma Martini is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
This is my first time asking a question on Stack Exchange, although I'm a frequent reader.
I tried to build a tabular that generates a sort of array, with indexes displayed above. This is the code:
$A = $
raisebox{10pt}{
setcounter{N}{5}
begin{tabular}{|*{5}{c|}}
xintFor* #1 in {xintSeq{1}{value{N}}}do{xintifForFirst{tiny #1}{& mc{tiny #1}}}\
hline
$1$ & $3$ & $5$ & $7$ & $8$\
hline
end{tabular}
}
where newcommandmc[1]{multicolumn{1}{l}{#1}}.

I would like it to be exactly the way it is now, but without the first two vertical lines in the indexes row. If I use mc in the first block of xintifForFirst (as I did successfully for the second block) it doesn't compile and I can't understand why. The error I get is ! Misplaced omit.
multispan ->omit @multispan
Thanks in advance :-)
Edit: As suggested by Andrew I'm writing an example of the error I get:
documentclass{article}
usepackage{tabularx}
usepackage{xinttools}
newcounter{N}
newcommandmc[1]{multicolumn{1}{l}{#1}}
newcommand{myarray}[2]{
raisebox{8pt}{
begin{tabular}{|*{#1}{c|}}
setcounter{N}{#1}
xintFor* ##1 in {xintSeq{1}{value{N}}}do{xintifForFirst{mc{ tiny ##1}}{& mc{tiny ##1}}}\
hline
#2\
hline
end{tabular}
}
}
begin{document}
$B = $myarray{11}{$0$ & $0$ & $1$ & $0$ & $1$ & $0$ & $0$ & $1$ & $0$ & $1$ & $0$}
end{document}
tables multicolumn xint
tables multicolumn xint
New contributor
Gemma Martini is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Gemma Martini is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited yesterday
New contributor
Gemma Martini is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 days ago
Gemma Martini
113
113
New contributor
Gemma Martini is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Gemma Martini is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Gemma Martini is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Welcome to TeX.SX! Can you please expand the code snippet that you have posted to a full minimal working example. It is much easier to help you if we can start with some compilable code that illustrates your problem. A MWE should start with adocumentclasscommand, include any necessary packages and be as small as possible to demonstrate your problem. To highlight code-blocks, either indent them by four spaces or use the{}on the gui.
– Andrew
2 days ago
Thank you for your suggestions, I edited the question
– Gemma Martini
yesterday
I suspect that the error has something to do with the "implementation features" box in section 15.17 (page 188) of the xint manual, but I didn't manage to solve the problem. I'm sure that @jfbu will be able to to fix this instantly.
– Andrew
yesterday
add a comment |
Welcome to TeX.SX! Can you please expand the code snippet that you have posted to a full minimal working example. It is much easier to help you if we can start with some compilable code that illustrates your problem. A MWE should start with adocumentclasscommand, include any necessary packages and be as small as possible to demonstrate your problem. To highlight code-blocks, either indent them by four spaces or use the{}on the gui.
– Andrew
2 days ago
Thank you for your suggestions, I edited the question
– Gemma Martini
yesterday
I suspect that the error has something to do with the "implementation features" box in section 15.17 (page 188) of the xint manual, but I didn't manage to solve the problem. I'm sure that @jfbu will be able to to fix this instantly.
– Andrew
yesterday
Welcome to TeX.SX! Can you please expand the code snippet that you have posted to a full minimal working example. It is much easier to help you if we can start with some compilable code that illustrates your problem. A MWE should start with a
documentclass command, include any necessary packages and be as small as possible to demonstrate your problem. To highlight code-blocks, either indent them by four spaces or use the {} on the gui.– Andrew
2 days ago
Welcome to TeX.SX! Can you please expand the code snippet that you have posted to a full minimal working example. It is much easier to help you if we can start with some compilable code that illustrates your problem. A MWE should start with a
documentclass command, include any necessary packages and be as small as possible to demonstrate your problem. To highlight code-blocks, either indent them by four spaces or use the {} on the gui.– Andrew
2 days ago
Thank you for your suggestions, I edited the question
– Gemma Martini
yesterday
Thank you for your suggestions, I edited the question
– Gemma Martini
yesterday
I suspect that the error has something to do with the "implementation features" box in section 15.17 (page 188) of the xint manual, but I didn't manage to solve the problem. I'm sure that @jfbu will be able to to fix this instantly.
– Andrew
yesterday
I suspect that the error has something to do with the "implementation features" box in section 15.17 (page 188) of the xint manual, but I didn't manage to solve the problem. I'm sure that @jfbu will be able to to fix this instantly.
– Andrew
yesterday
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
I don't know what packages you need to load to get your code to compile with xint - I tried usepackage{xint} but this was not sufficient.
Would you consider a tikz solution that produces

using the code
documentclass{article}
usepackage{tikz}
tikzset{array/.style={rectangle, draw, minimum width=5mm}}
newcommandArray[1]{%
tikz[baseline]{foreach x [count=c] in {#1} {
node[array, label=above:{tiny c}]at (c/2,0){$x$};
}
}
}
begin{document}
$A = Array{1,3,5,7,8}$
end{document}
EDIT - adding colour
Adding colour is fairly straightforward. If you want to have different colours in each cell then you can produce:

using the code:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
tikzset{array/.style={rectangle, draw, minimum width=5mm}}
newcommandArray[1]{%
tikz[baseline=(current bounding box.south)]{
foreach x/col [count=c] in {#1} {
node[array, fill=col!20, label=above:{tiny c}]at (c/2,0){$x$};
}
}
}
begin{document}
$A = Array{1/red,3/blue,5/white,7/green,8/white}$
end{document}
If you want the same colour in each cell then, assuming that the cell entries are always non-negative you can use an easier input syntax by using negative numbers for colour to produce

using the marginally more complicated code:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
tikzset{array/.style={rectangle, draw, minimum width=5mm}}
newcommandArray[1]{%
tikz[baseline=(current bounding box.south)]{
foreach x [count=c] in {#1} {
ifnumx<0relax
node[array, fill=blue!20, label=above:{tiny c}]at (c/2,0){$thenumexpr-xrelax$};
else
node[array, label=above:{tiny c}]at (c/2,0){$x$};
fi
}
}
}
begin{document}
$A = Array{1,-3,5,-7,8}$
end{document}
It'susepackage{xinttools}...
– Werner
2 days ago
Thank you for your suggestion, but this implementation doesn't allow change of cell color by the user of the macro... Your solution is very elegant and I like it, but my version is more appropriate for my needs, except for the fact that it doesn't compile :-(
– Gemma Martini
yesterday
@GemmaMartini Colour is not mentioned in the OP but it is easy enough to incorporate. How do you want the cell colours to change?
– Andrew
yesterday
I would like to change the colour of some cells, when I pass them to the macro... Using my code I could have used$B = $myarray{11}{cellcolor{mycolor}$0$ & cellcolor{mycolor}$0$ & cellcolor{mycolor}$mathbf{1}$ & cellcolor{mycolor}$0$ & cellcolor{mycolor}$mathbf{1}$ & cellcolor{mycolor}$0$ & $0$ & $1$ & $0$ & $1$ & $0$}
– Gemma Martini
yesterday
@GemmaMartini See my edit
– Andrew
yesterday
|
show 4 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
I don't know what packages you need to load to get your code to compile with xint - I tried usepackage{xint} but this was not sufficient.
Would you consider a tikz solution that produces

using the code
documentclass{article}
usepackage{tikz}
tikzset{array/.style={rectangle, draw, minimum width=5mm}}
newcommandArray[1]{%
tikz[baseline]{foreach x [count=c] in {#1} {
node[array, label=above:{tiny c}]at (c/2,0){$x$};
}
}
}
begin{document}
$A = Array{1,3,5,7,8}$
end{document}
EDIT - adding colour
Adding colour is fairly straightforward. If you want to have different colours in each cell then you can produce:

using the code:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
tikzset{array/.style={rectangle, draw, minimum width=5mm}}
newcommandArray[1]{%
tikz[baseline=(current bounding box.south)]{
foreach x/col [count=c] in {#1} {
node[array, fill=col!20, label=above:{tiny c}]at (c/2,0){$x$};
}
}
}
begin{document}
$A = Array{1/red,3/blue,5/white,7/green,8/white}$
end{document}
If you want the same colour in each cell then, assuming that the cell entries are always non-negative you can use an easier input syntax by using negative numbers for colour to produce

using the marginally more complicated code:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
tikzset{array/.style={rectangle, draw, minimum width=5mm}}
newcommandArray[1]{%
tikz[baseline=(current bounding box.south)]{
foreach x [count=c] in {#1} {
ifnumx<0relax
node[array, fill=blue!20, label=above:{tiny c}]at (c/2,0){$thenumexpr-xrelax$};
else
node[array, label=above:{tiny c}]at (c/2,0){$x$};
fi
}
}
}
begin{document}
$A = Array{1,-3,5,-7,8}$
end{document}
It'susepackage{xinttools}...
– Werner
2 days ago
Thank you for your suggestion, but this implementation doesn't allow change of cell color by the user of the macro... Your solution is very elegant and I like it, but my version is more appropriate for my needs, except for the fact that it doesn't compile :-(
– Gemma Martini
yesterday
@GemmaMartini Colour is not mentioned in the OP but it is easy enough to incorporate. How do you want the cell colours to change?
– Andrew
yesterday
I would like to change the colour of some cells, when I pass them to the macro... Using my code I could have used$B = $myarray{11}{cellcolor{mycolor}$0$ & cellcolor{mycolor}$0$ & cellcolor{mycolor}$mathbf{1}$ & cellcolor{mycolor}$0$ & cellcolor{mycolor}$mathbf{1}$ & cellcolor{mycolor}$0$ & $0$ & $1$ & $0$ & $1$ & $0$}
– Gemma Martini
yesterday
@GemmaMartini See my edit
– Andrew
yesterday
|
show 4 more comments
up vote
1
down vote
I don't know what packages you need to load to get your code to compile with xint - I tried usepackage{xint} but this was not sufficient.
Would you consider a tikz solution that produces

using the code
documentclass{article}
usepackage{tikz}
tikzset{array/.style={rectangle, draw, minimum width=5mm}}
newcommandArray[1]{%
tikz[baseline]{foreach x [count=c] in {#1} {
node[array, label=above:{tiny c}]at (c/2,0){$x$};
}
}
}
begin{document}
$A = Array{1,3,5,7,8}$
end{document}
EDIT - adding colour
Adding colour is fairly straightforward. If you want to have different colours in each cell then you can produce:

using the code:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
tikzset{array/.style={rectangle, draw, minimum width=5mm}}
newcommandArray[1]{%
tikz[baseline=(current bounding box.south)]{
foreach x/col [count=c] in {#1} {
node[array, fill=col!20, label=above:{tiny c}]at (c/2,0){$x$};
}
}
}
begin{document}
$A = Array{1/red,3/blue,5/white,7/green,8/white}$
end{document}
If you want the same colour in each cell then, assuming that the cell entries are always non-negative you can use an easier input syntax by using negative numbers for colour to produce

using the marginally more complicated code:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
tikzset{array/.style={rectangle, draw, minimum width=5mm}}
newcommandArray[1]{%
tikz[baseline=(current bounding box.south)]{
foreach x [count=c] in {#1} {
ifnumx<0relax
node[array, fill=blue!20, label=above:{tiny c}]at (c/2,0){$thenumexpr-xrelax$};
else
node[array, label=above:{tiny c}]at (c/2,0){$x$};
fi
}
}
}
begin{document}
$A = Array{1,-3,5,-7,8}$
end{document}
It'susepackage{xinttools}...
– Werner
2 days ago
Thank you for your suggestion, but this implementation doesn't allow change of cell color by the user of the macro... Your solution is very elegant and I like it, but my version is more appropriate for my needs, except for the fact that it doesn't compile :-(
– Gemma Martini
yesterday
@GemmaMartini Colour is not mentioned in the OP but it is easy enough to incorporate. How do you want the cell colours to change?
– Andrew
yesterday
I would like to change the colour of some cells, when I pass them to the macro... Using my code I could have used$B = $myarray{11}{cellcolor{mycolor}$0$ & cellcolor{mycolor}$0$ & cellcolor{mycolor}$mathbf{1}$ & cellcolor{mycolor}$0$ & cellcolor{mycolor}$mathbf{1}$ & cellcolor{mycolor}$0$ & $0$ & $1$ & $0$ & $1$ & $0$}
– Gemma Martini
yesterday
@GemmaMartini See my edit
– Andrew
yesterday
|
show 4 more comments
up vote
1
down vote
up vote
1
down vote
I don't know what packages you need to load to get your code to compile with xint - I tried usepackage{xint} but this was not sufficient.
Would you consider a tikz solution that produces

using the code
documentclass{article}
usepackage{tikz}
tikzset{array/.style={rectangle, draw, minimum width=5mm}}
newcommandArray[1]{%
tikz[baseline]{foreach x [count=c] in {#1} {
node[array, label=above:{tiny c}]at (c/2,0){$x$};
}
}
}
begin{document}
$A = Array{1,3,5,7,8}$
end{document}
EDIT - adding colour
Adding colour is fairly straightforward. If you want to have different colours in each cell then you can produce:

using the code:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
tikzset{array/.style={rectangle, draw, minimum width=5mm}}
newcommandArray[1]{%
tikz[baseline=(current bounding box.south)]{
foreach x/col [count=c] in {#1} {
node[array, fill=col!20, label=above:{tiny c}]at (c/2,0){$x$};
}
}
}
begin{document}
$A = Array{1/red,3/blue,5/white,7/green,8/white}$
end{document}
If you want the same colour in each cell then, assuming that the cell entries are always non-negative you can use an easier input syntax by using negative numbers for colour to produce

using the marginally more complicated code:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
tikzset{array/.style={rectangle, draw, minimum width=5mm}}
newcommandArray[1]{%
tikz[baseline=(current bounding box.south)]{
foreach x [count=c] in {#1} {
ifnumx<0relax
node[array, fill=blue!20, label=above:{tiny c}]at (c/2,0){$thenumexpr-xrelax$};
else
node[array, label=above:{tiny c}]at (c/2,0){$x$};
fi
}
}
}
begin{document}
$A = Array{1,-3,5,-7,8}$
end{document}
I don't know what packages you need to load to get your code to compile with xint - I tried usepackage{xint} but this was not sufficient.
Would you consider a tikz solution that produces

using the code
documentclass{article}
usepackage{tikz}
tikzset{array/.style={rectangle, draw, minimum width=5mm}}
newcommandArray[1]{%
tikz[baseline]{foreach x [count=c] in {#1} {
node[array, label=above:{tiny c}]at (c/2,0){$x$};
}
}
}
begin{document}
$A = Array{1,3,5,7,8}$
end{document}
EDIT - adding colour
Adding colour is fairly straightforward. If you want to have different colours in each cell then you can produce:

using the code:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
tikzset{array/.style={rectangle, draw, minimum width=5mm}}
newcommandArray[1]{%
tikz[baseline=(current bounding box.south)]{
foreach x/col [count=c] in {#1} {
node[array, fill=col!20, label=above:{tiny c}]at (c/2,0){$x$};
}
}
}
begin{document}
$A = Array{1/red,3/blue,5/white,7/green,8/white}$
end{document}
If you want the same colour in each cell then, assuming that the cell entries are always non-negative you can use an easier input syntax by using negative numbers for colour to produce

using the marginally more complicated code:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
tikzset{array/.style={rectangle, draw, minimum width=5mm}}
newcommandArray[1]{%
tikz[baseline=(current bounding box.south)]{
foreach x [count=c] in {#1} {
ifnumx<0relax
node[array, fill=blue!20, label=above:{tiny c}]at (c/2,0){$thenumexpr-xrelax$};
else
node[array, label=above:{tiny c}]at (c/2,0){$x$};
fi
}
}
}
begin{document}
$A = Array{1,-3,5,-7,8}$
end{document}
edited yesterday
answered 2 days ago
Andrew
29.3k34178
29.3k34178
It'susepackage{xinttools}...
– Werner
2 days ago
Thank you for your suggestion, but this implementation doesn't allow change of cell color by the user of the macro... Your solution is very elegant and I like it, but my version is more appropriate for my needs, except for the fact that it doesn't compile :-(
– Gemma Martini
yesterday
@GemmaMartini Colour is not mentioned in the OP but it is easy enough to incorporate. How do you want the cell colours to change?
– Andrew
yesterday
I would like to change the colour of some cells, when I pass them to the macro... Using my code I could have used$B = $myarray{11}{cellcolor{mycolor}$0$ & cellcolor{mycolor}$0$ & cellcolor{mycolor}$mathbf{1}$ & cellcolor{mycolor}$0$ & cellcolor{mycolor}$mathbf{1}$ & cellcolor{mycolor}$0$ & $0$ & $1$ & $0$ & $1$ & $0$}
– Gemma Martini
yesterday
@GemmaMartini See my edit
– Andrew
yesterday
|
show 4 more comments
It'susepackage{xinttools}...
– Werner
2 days ago
Thank you for your suggestion, but this implementation doesn't allow change of cell color by the user of the macro... Your solution is very elegant and I like it, but my version is more appropriate for my needs, except for the fact that it doesn't compile :-(
– Gemma Martini
yesterday
@GemmaMartini Colour is not mentioned in the OP but it is easy enough to incorporate. How do you want the cell colours to change?
– Andrew
yesterday
I would like to change the colour of some cells, when I pass them to the macro... Using my code I could have used$B = $myarray{11}{cellcolor{mycolor}$0$ & cellcolor{mycolor}$0$ & cellcolor{mycolor}$mathbf{1}$ & cellcolor{mycolor}$0$ & cellcolor{mycolor}$mathbf{1}$ & cellcolor{mycolor}$0$ & $0$ & $1$ & $0$ & $1$ & $0$}
– Gemma Martini
yesterday
@GemmaMartini See my edit
– Andrew
yesterday
It's
usepackage{xinttools}...– Werner
2 days ago
It's
usepackage{xinttools}...– Werner
2 days ago
Thank you for your suggestion, but this implementation doesn't allow change of cell color by the user of the macro... Your solution is very elegant and I like it, but my version is more appropriate for my needs, except for the fact that it doesn't compile :-(
– Gemma Martini
yesterday
Thank you for your suggestion, but this implementation doesn't allow change of cell color by the user of the macro... Your solution is very elegant and I like it, but my version is more appropriate for my needs, except for the fact that it doesn't compile :-(
– Gemma Martini
yesterday
@GemmaMartini Colour is not mentioned in the OP but it is easy enough to incorporate. How do you want the cell colours to change?
– Andrew
yesterday
@GemmaMartini Colour is not mentioned in the OP but it is easy enough to incorporate. How do you want the cell colours to change?
– Andrew
yesterday
I would like to change the colour of some cells, when I pass them to the macro... Using my code I could have used
$B = $myarray{11}{cellcolor{mycolor}$0$ & cellcolor{mycolor}$0$ & cellcolor{mycolor}$mathbf{1}$ & cellcolor{mycolor}$0$ & cellcolor{mycolor}$mathbf{1}$ & cellcolor{mycolor}$0$ & $0$ & $1$ & $0$ & $1$ & $0$}– Gemma Martini
yesterday
I would like to change the colour of some cells, when I pass them to the macro... Using my code I could have used
$B = $myarray{11}{cellcolor{mycolor}$0$ & cellcolor{mycolor}$0$ & cellcolor{mycolor}$mathbf{1}$ & cellcolor{mycolor}$0$ & cellcolor{mycolor}$mathbf{1}$ & cellcolor{mycolor}$0$ & $0$ & $1$ & $0$ & $1$ & $0$}– Gemma Martini
yesterday
@GemmaMartini See my edit
– Andrew
yesterday
@GemmaMartini See my edit
– Andrew
yesterday
|
show 4 more comments
Gemma Martini is a new contributor. Be nice, and check out our Code of Conduct.
Gemma Martini is a new contributor. Be nice, and check out our Code of Conduct.
Gemma Martini is a new contributor. Be nice, and check out our Code of Conduct.
Gemma Martini 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%2f460834%2fmulticolumn-and-xintfor%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
Welcome to TeX.SX! Can you please expand the code snippet that you have posted to a full minimal working example. It is much easier to help you if we can start with some compilable code that illustrates your problem. A MWE should start with a
documentclasscommand, include any necessary packages and be as small as possible to demonstrate your problem. To highlight code-blocks, either indent them by four spaces or use the{}on the gui.– Andrew
2 days ago
Thank you for your suggestions, I edited the question
– Gemma Martini
yesterday
I suspect that the error has something to do with the "implementation features" box in section 15.17 (page 188) of the xint manual, but I didn't manage to solve the problem. I'm sure that @jfbu will be able to to fix this instantly.
– Andrew
yesterday