MathJax doesn't have anything built in that allows you to change the column spacing. But it is possible to implement it. Here is a configuration that does so:
// These would be replaced by import commands if you wanted to make
const {Configuration} = MathJax._.input.tex.Configuration;
const {EnvironmentMap, CommandMap} = MathJax._.input.tex.SymbolMap;
const TexError = MathJax._.input.tex.TexError.default;
const ParseMethods = MathJax._.input.tex.ParseMethods.default;
const BaseMethods = MathJax._.input.tex.base.BaseMethods.default;
const {AmsMethods} = MathJax._.input.tex.ams.AmsMethods;
// This function replaces the column spacing by the \arraycolsep, if specified
// and the row spacing is adjusted by \arraystretch, if it is defined.
function AdjustSpacing(parser, array) {
const def = array.arraydef;
def.columnspacing = lengths.get('\\arraycolsep');
const stretch = parser.lookup('macro', 'arraystretch'); // check if the macro is defined
const [, n, u] = def.rowspacing.match(/^(\d(?:\.\d*)?|\.\d+)([a-z]+)$/) || [];
const f = parseFloat(stretch._args[0]);
def.rowspacing = (parseFloat(n) * f) + u;
// Define an environment map to override the array environments
// so that we can adjust the spacing
new EnvironmentMap('my-array-env', ParseMethods.environment, {
subarray: ['Array', null, null, null, null, '0em', '0.1em', 'S', 1],
smallmatrix: ['Array', null, null, null, 'c', '.333em', '.2em', 'S', 1],
matrix: ['Array', null, null, null, 'c'],
pmatrix: ['Array', null, '(', ')', 'c'],
bmatrix: ['Array', null, '[', ']', 'c'],
Bmatrix: ['Array', null, '\\{', '\\}', 'c'],
vmatrix: ['Array', null, '\\vert', '\\vert', 'c'],
Vmatrix: ['Array', null, '\\Vert', '\\Vert', 'c'],
cases: ['Array', null, '\\{', '.', 'll', null, '.2em', 'T']
// Create the usual array, but adjust the spacing after that.
AlignedArray(parser, begin) {
return AdjustSpacing(parser, BaseMethods.AlignedArray(parser, begin));
Array(parser, begin, ...args) {
return AdjustSpacing(parser, BaseMethods.Array(parser, begin, ...args));
// This stores the lengths that can be set (only \arraycolsep for now).
const lengths = new Map([
// Define the \setlength macro
// It should check that the dimension is valid, but currently doesn't
new CommandMap('my-setlength', {
SetLength(parser, name) {
const id = parser.GetArgument('\\' + name);
const dim = parser.GetArgument('\\' + name);
throw new TexError('MyBadLength', 'Length "' + id + '" is not a known length');
// Define the package for our new environments and macro
Configuration.create('my-arraysep', {
environment: ['my-array-env'],
MathJax.startup.defaultReady();
tex: {packages: {'[+]': ['my-arraysep']}} // Tell TeX to iuse our package
Note, however, that MathJax doesn't have local definition grouping, so everything is global. That means you would need to reset these values by hand if you want them to go back to their defaults: \setlength{\arraycolsep}{} and \renewcommand\arraystretch{1} will do that.
Perhaps that will fit the bill.