xcolor breaking [ and align environments inside tabu
I'm having trouble with a "Bad math environment delimiter" when using certain math environments inside tabu. Minimal example:
documentclass[a4paper,12pt]{scrreprt}
usepackage{xcolor}
usepackage{tabu}
begin{document}
begin{table}[h!]
begin{tabu}{ X }
[ b ]
end{tabu}
end{table}
end{document}
This error only shows when xcolor is loaded and also appears when [ is replaced with an equation, align, or gather environment, but not when using $$. The above example used to work a year ago and the error appeared recently after updating MikTex and all packages.
color align tabu
add a comment |
I'm having trouble with a "Bad math environment delimiter" when using certain math environments inside tabu. Minimal example:
documentclass[a4paper,12pt]{scrreprt}
usepackage{xcolor}
usepackage{tabu}
begin{document}
begin{table}[h!]
begin{tabu}{ X }
[ b ]
end{tabu}
end{table}
end{document}
This error only shows when xcolor is loaded and also appears when [ is replaced with an equation, align, or gather environment, but not when using $$. The above example used to work a year ago and the error appeared recently after updating MikTex and all packages.
color align tabu
2
you should consider thattabuis not maintained, so it not respond on recent changes in many of packages. for example inarrayand it seems that inxcolortoo.
– Zarko
Jan 9 at 2:37
@Zarko I don't think any change in xcolor is responsible for this, it all comes from change in array.
– jfbu
Jan 9 at 13:36
add a comment |
I'm having trouble with a "Bad math environment delimiter" when using certain math environments inside tabu. Minimal example:
documentclass[a4paper,12pt]{scrreprt}
usepackage{xcolor}
usepackage{tabu}
begin{document}
begin{table}[h!]
begin{tabu}{ X }
[ b ]
end{tabu}
end{table}
end{document}
This error only shows when xcolor is loaded and also appears when [ is replaced with an equation, align, or gather environment, but not when using $$. The above example used to work a year ago and the error appeared recently after updating MikTex and all packages.
color align tabu
I'm having trouble with a "Bad math environment delimiter" when using certain math environments inside tabu. Minimal example:
documentclass[a4paper,12pt]{scrreprt}
usepackage{xcolor}
usepackage{tabu}
begin{document}
begin{table}[h!]
begin{tabu}{ X }
[ b ]
end{tabu}
end{table}
end{document}
This error only shows when xcolor is loaded and also appears when [ is replaced with an equation, align, or gather environment, but not when using $$. The above example used to work a year ago and the error appeared recently after updating MikTex and all packages.
color align tabu
color align tabu
asked Jan 9 at 1:38
Vlad WeltfriedenVlad Weltfrieden
183
183
2
you should consider thattabuis not maintained, so it not respond on recent changes in many of packages. for example inarrayand it seems that inxcolortoo.
– Zarko
Jan 9 at 2:37
@Zarko I don't think any change in xcolor is responsible for this, it all comes from change in array.
– jfbu
Jan 9 at 13:36
add a comment |
2
you should consider thattabuis not maintained, so it not respond on recent changes in many of packages. for example inarrayand it seems that inxcolortoo.
– Zarko
Jan 9 at 2:37
@Zarko I don't think any change in xcolor is responsible for this, it all comes from change in array.
– jfbu
Jan 9 at 13:36
2
2
you should consider that
tabu is not maintained, so it not respond on recent changes in many of packages. for example in array and it seems that in xcolor too.– Zarko
Jan 9 at 2:37
you should consider that
tabu is not maintained, so it not respond on recent changes in many of packages. for example in array and it seems that in xcolor too.– Zarko
Jan 9 at 2:37
@Zarko I don't think any change in xcolor is responsible for this, it all comes from change in array.
– jfbu
Jan 9 at 13:36
@Zarko I don't think any change in xcolor is responsible for this, it all comes from change in array.
– jfbu
Jan 9 at 13:36
add a comment |
1 Answer
1
active
oldest
votes
UPDATE 2019-01-14
An equivalent patch has been applied in tabu 2.9 which has been submitted to ctan.
This is not a full solution, only a first try!!!
At some place in the code tabu checks the "current group type" (What combinations of mode and currentgrouptype exist?).
The problem is that array added an additional "color group" to p-columns to avoid that colors leaks out. This color group is active if a color package is used. When tabu tests the current group type it now gets a different answer then previously and so takes the wrong code path.
One possibility to get around the problem is to save the currentgrouptype before the color group and to use this value in the tabu code.
Attention I suspect that more places will need adjustments.
documentclass{article}
usepackage{color,array,longtable}
%Save the currentgrouptype before the color@begingroup:
makeatletter
newcountarray@currentgrouptype
def@startpbox#1{bgroup array@currentgrouptypecurrentgrouptype
color@begingroup
setlengthhsize{#1}@arrayparboxrestore
everypar{%
vrule @height ht@arstrutbox @width z@
everypar{}}%
}
makeatother
usepackage{tabu}
makeatletter
%Use the new array@currentgrouptype
deftabu@verticalmeasure{everypar{}%
%showthecurrentgrouptype %14 in tl18, 5 in tl17
ifnum array@currentgrouptype>12 %
setboxtabu@box =hboxbgroup
lettabu@verticalspacing tabu@verticalsp@lcr
d@llarbegin % after hbox ...
else
edeftabu@temp{ifnumarray@currentgrouptype=5vtop
elseifnumarray@currentgrouptype=12vcenter
elsevboxfifi}%
setboxtabu@box hboxbgroup$tabu@temp bgroup
lettabu@verticalspacing tabu@verticalsp@pmb
fi
}% tabu@verticalmeasure
usepackage{etoolbox}
patchcmdtabu@startpboxmeasure
{aftergrouptabu@endpboxmeasure}
{aftergrouptabu@endpboxmeasure
color@begingroup
}{typeout{tabu patched}}{typeout{tabu patch failed!}}
patchcmdtabu@LT@startpbox
{bgroup}{bgroupcolor@begingroup}
{typeout{tabu patched}}{typeout{tabu patch failed!}}
makeatletter
begin{document}
begin{tabu}{X}
[ b ]
end{tabu}
begin{longtabu}{X}
[ b ]
end{longtabu}
end{document}
just to link to another answer as you incorporate its patch which incorporates your longtable patch from yet another answer
– jfbu
Jan 9 at 13:35
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%2f469282%2fxcolor-breaking-and-align-environments-inside-tabu%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
UPDATE 2019-01-14
An equivalent patch has been applied in tabu 2.9 which has been submitted to ctan.
This is not a full solution, only a first try!!!
At some place in the code tabu checks the "current group type" (What combinations of mode and currentgrouptype exist?).
The problem is that array added an additional "color group" to p-columns to avoid that colors leaks out. This color group is active if a color package is used. When tabu tests the current group type it now gets a different answer then previously and so takes the wrong code path.
One possibility to get around the problem is to save the currentgrouptype before the color group and to use this value in the tabu code.
Attention I suspect that more places will need adjustments.
documentclass{article}
usepackage{color,array,longtable}
%Save the currentgrouptype before the color@begingroup:
makeatletter
newcountarray@currentgrouptype
def@startpbox#1{bgroup array@currentgrouptypecurrentgrouptype
color@begingroup
setlengthhsize{#1}@arrayparboxrestore
everypar{%
vrule @height ht@arstrutbox @width z@
everypar{}}%
}
makeatother
usepackage{tabu}
makeatletter
%Use the new array@currentgrouptype
deftabu@verticalmeasure{everypar{}%
%showthecurrentgrouptype %14 in tl18, 5 in tl17
ifnum array@currentgrouptype>12 %
setboxtabu@box =hboxbgroup
lettabu@verticalspacing tabu@verticalsp@lcr
d@llarbegin % after hbox ...
else
edeftabu@temp{ifnumarray@currentgrouptype=5vtop
elseifnumarray@currentgrouptype=12vcenter
elsevboxfifi}%
setboxtabu@box hboxbgroup$tabu@temp bgroup
lettabu@verticalspacing tabu@verticalsp@pmb
fi
}% tabu@verticalmeasure
usepackage{etoolbox}
patchcmdtabu@startpboxmeasure
{aftergrouptabu@endpboxmeasure}
{aftergrouptabu@endpboxmeasure
color@begingroup
}{typeout{tabu patched}}{typeout{tabu patch failed!}}
patchcmdtabu@LT@startpbox
{bgroup}{bgroupcolor@begingroup}
{typeout{tabu patched}}{typeout{tabu patch failed!}}
makeatletter
begin{document}
begin{tabu}{X}
[ b ]
end{tabu}
begin{longtabu}{X}
[ b ]
end{longtabu}
end{document}
just to link to another answer as you incorporate its patch which incorporates your longtable patch from yet another answer
– jfbu
Jan 9 at 13:35
add a comment |
UPDATE 2019-01-14
An equivalent patch has been applied in tabu 2.9 which has been submitted to ctan.
This is not a full solution, only a first try!!!
At some place in the code tabu checks the "current group type" (What combinations of mode and currentgrouptype exist?).
The problem is that array added an additional "color group" to p-columns to avoid that colors leaks out. This color group is active if a color package is used. When tabu tests the current group type it now gets a different answer then previously and so takes the wrong code path.
One possibility to get around the problem is to save the currentgrouptype before the color group and to use this value in the tabu code.
Attention I suspect that more places will need adjustments.
documentclass{article}
usepackage{color,array,longtable}
%Save the currentgrouptype before the color@begingroup:
makeatletter
newcountarray@currentgrouptype
def@startpbox#1{bgroup array@currentgrouptypecurrentgrouptype
color@begingroup
setlengthhsize{#1}@arrayparboxrestore
everypar{%
vrule @height ht@arstrutbox @width z@
everypar{}}%
}
makeatother
usepackage{tabu}
makeatletter
%Use the new array@currentgrouptype
deftabu@verticalmeasure{everypar{}%
%showthecurrentgrouptype %14 in tl18, 5 in tl17
ifnum array@currentgrouptype>12 %
setboxtabu@box =hboxbgroup
lettabu@verticalspacing tabu@verticalsp@lcr
d@llarbegin % after hbox ...
else
edeftabu@temp{ifnumarray@currentgrouptype=5vtop
elseifnumarray@currentgrouptype=12vcenter
elsevboxfifi}%
setboxtabu@box hboxbgroup$tabu@temp bgroup
lettabu@verticalspacing tabu@verticalsp@pmb
fi
}% tabu@verticalmeasure
usepackage{etoolbox}
patchcmdtabu@startpboxmeasure
{aftergrouptabu@endpboxmeasure}
{aftergrouptabu@endpboxmeasure
color@begingroup
}{typeout{tabu patched}}{typeout{tabu patch failed!}}
patchcmdtabu@LT@startpbox
{bgroup}{bgroupcolor@begingroup}
{typeout{tabu patched}}{typeout{tabu patch failed!}}
makeatletter
begin{document}
begin{tabu}{X}
[ b ]
end{tabu}
begin{longtabu}{X}
[ b ]
end{longtabu}
end{document}
just to link to another answer as you incorporate its patch which incorporates your longtable patch from yet another answer
– jfbu
Jan 9 at 13:35
add a comment |
UPDATE 2019-01-14
An equivalent patch has been applied in tabu 2.9 which has been submitted to ctan.
This is not a full solution, only a first try!!!
At some place in the code tabu checks the "current group type" (What combinations of mode and currentgrouptype exist?).
The problem is that array added an additional "color group" to p-columns to avoid that colors leaks out. This color group is active if a color package is used. When tabu tests the current group type it now gets a different answer then previously and so takes the wrong code path.
One possibility to get around the problem is to save the currentgrouptype before the color group and to use this value in the tabu code.
Attention I suspect that more places will need adjustments.
documentclass{article}
usepackage{color,array,longtable}
%Save the currentgrouptype before the color@begingroup:
makeatletter
newcountarray@currentgrouptype
def@startpbox#1{bgroup array@currentgrouptypecurrentgrouptype
color@begingroup
setlengthhsize{#1}@arrayparboxrestore
everypar{%
vrule @height ht@arstrutbox @width z@
everypar{}}%
}
makeatother
usepackage{tabu}
makeatletter
%Use the new array@currentgrouptype
deftabu@verticalmeasure{everypar{}%
%showthecurrentgrouptype %14 in tl18, 5 in tl17
ifnum array@currentgrouptype>12 %
setboxtabu@box =hboxbgroup
lettabu@verticalspacing tabu@verticalsp@lcr
d@llarbegin % after hbox ...
else
edeftabu@temp{ifnumarray@currentgrouptype=5vtop
elseifnumarray@currentgrouptype=12vcenter
elsevboxfifi}%
setboxtabu@box hboxbgroup$tabu@temp bgroup
lettabu@verticalspacing tabu@verticalsp@pmb
fi
}% tabu@verticalmeasure
usepackage{etoolbox}
patchcmdtabu@startpboxmeasure
{aftergrouptabu@endpboxmeasure}
{aftergrouptabu@endpboxmeasure
color@begingroup
}{typeout{tabu patched}}{typeout{tabu patch failed!}}
patchcmdtabu@LT@startpbox
{bgroup}{bgroupcolor@begingroup}
{typeout{tabu patched}}{typeout{tabu patch failed!}}
makeatletter
begin{document}
begin{tabu}{X}
[ b ]
end{tabu}
begin{longtabu}{X}
[ b ]
end{longtabu}
end{document}
UPDATE 2019-01-14
An equivalent patch has been applied in tabu 2.9 which has been submitted to ctan.
This is not a full solution, only a first try!!!
At some place in the code tabu checks the "current group type" (What combinations of mode and currentgrouptype exist?).
The problem is that array added an additional "color group" to p-columns to avoid that colors leaks out. This color group is active if a color package is used. When tabu tests the current group type it now gets a different answer then previously and so takes the wrong code path.
One possibility to get around the problem is to save the currentgrouptype before the color group and to use this value in the tabu code.
Attention I suspect that more places will need adjustments.
documentclass{article}
usepackage{color,array,longtable}
%Save the currentgrouptype before the color@begingroup:
makeatletter
newcountarray@currentgrouptype
def@startpbox#1{bgroup array@currentgrouptypecurrentgrouptype
color@begingroup
setlengthhsize{#1}@arrayparboxrestore
everypar{%
vrule @height ht@arstrutbox @width z@
everypar{}}%
}
makeatother
usepackage{tabu}
makeatletter
%Use the new array@currentgrouptype
deftabu@verticalmeasure{everypar{}%
%showthecurrentgrouptype %14 in tl18, 5 in tl17
ifnum array@currentgrouptype>12 %
setboxtabu@box =hboxbgroup
lettabu@verticalspacing tabu@verticalsp@lcr
d@llarbegin % after hbox ...
else
edeftabu@temp{ifnumarray@currentgrouptype=5vtop
elseifnumarray@currentgrouptype=12vcenter
elsevboxfifi}%
setboxtabu@box hboxbgroup$tabu@temp bgroup
lettabu@verticalspacing tabu@verticalsp@pmb
fi
}% tabu@verticalmeasure
usepackage{etoolbox}
patchcmdtabu@startpboxmeasure
{aftergrouptabu@endpboxmeasure}
{aftergrouptabu@endpboxmeasure
color@begingroup
}{typeout{tabu patched}}{typeout{tabu patch failed!}}
patchcmdtabu@LT@startpbox
{bgroup}{bgroupcolor@begingroup}
{typeout{tabu patched}}{typeout{tabu patch failed!}}
makeatletter
begin{document}
begin{tabu}{X}
[ b ]
end{tabu}
begin{longtabu}{X}
[ b ]
end{longtabu}
end{document}
edited 2 days ago
David Carlisle
485k4111201864
485k4111201864
answered Jan 9 at 9:01
Ulrike FischerUlrike Fischer
188k7294673
188k7294673
just to link to another answer as you incorporate its patch which incorporates your longtable patch from yet another answer
– jfbu
Jan 9 at 13:35
add a comment |
just to link to another answer as you incorporate its patch which incorporates your longtable patch from yet another answer
– jfbu
Jan 9 at 13:35
just to link to another answer as you incorporate its patch which incorporates your longtable patch from yet another answer
– jfbu
Jan 9 at 13:35
just to link to another answer as you incorporate its patch which incorporates your longtable patch from yet another answer
– jfbu
Jan 9 at 13:35
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%2f469282%2fxcolor-breaking-and-align-environments-inside-tabu%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
2
you should consider that
tabuis not maintained, so it not respond on recent changes in many of packages. for example inarrayand it seems that inxcolortoo.– Zarko
Jan 9 at 2:37
@Zarko I don't think any change in xcolor is responsible for this, it all comes from change in array.
– jfbu
Jan 9 at 13:36