xcolor breaking [ and align environments inside tabu












3















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.










share|improve this question


















  • 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











  • @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
















3















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.










share|improve this question


















  • 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











  • @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














3












3








3


0






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.










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 9 at 1:38









Vlad WeltfriedenVlad Weltfrieden

183




183








  • 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











  • @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





    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








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










1 Answer
1






active

oldest

votes


















5














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}





share|improve this answer


























  • 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











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
});


}
});














draft saved

draft discarded


















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









5














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}





share|improve this answer


























  • 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
















5














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}





share|improve this answer


























  • 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














5












5








5







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}





share|improve this answer















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}






share|improve this answer














share|improve this answer



share|improve this answer








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



















  • 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


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

How to send String Array data to Server using php in android

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Is anime1.com a legal site for watching anime?