From fbd81715060f5960be7109bb5a84994a01d9fc13 Mon Sep 17 00:00:00 2001 From: Divide-By-0 Date: Mon, 28 Sep 2026 18:25:38 -0700 Subject: [PATCH] Increase MathJax raster resolution without changing equation size --- Common/Code.ts | 2 + Docs/Code.ts | 23 ++++-- SidebarMathJaxShared.ts | 30 +++++-- Slides/Code.ts | 13 +++- Slides/Sidebar.ts | 2 + tests/browser/render-matrix.js | 27 +++++-- tests/mathjax-resolution.test.js | 130 +++++++++++++++++++++++++++++++ types/common-types/index.d.ts | 2 + 8 files changed, 211 insertions(+), 18 deletions(-) create mode 100644 tests/mathjax-resolution.test.js diff --git a/Common/Code.ts b/Common/Code.ts index bd8a575..5f8fdb8 100644 --- a/Common/Code.ts +++ b/Common/Code.ts @@ -73,6 +73,8 @@ interface RenderEquationResult { * @public */ interface ClientRenderOptions extends CommonRenderOptions { + supportsRasterScale?: boolean; + rasterScale?: number; rangeId: string; equation: string; equationLinkEncoded: string; diff --git a/Docs/Code.ts b/Docs/Code.ts index df67404..e5540a7 100644 --- a/Docs/Code.ts +++ b/Docs/Code.ts @@ -873,7 +873,7 @@ function clientRenderComplete(equations: { options: DocsClientRenderOptions, ren } const equationBlob = Utilities.newBlob(Utilities.base64Decode(equation.renderedEquationB64), "image/png"); - const result = placeImage(rangeElements[0], equationBlob, mathjaxRenderer, equation.options.equationLinkEncoded, equation.options.size, equation.options.delim, equation.options.customAltText); + const result = placeImage(rangeElements[0], equationBlob, mathjaxRenderer, equation.options.equationLinkEncoded, equation.options.size, equation.options.delim, equation.options.customAltText, equation.options.rasterScale); if (result.status === DocsEquationRenderStatus.Success) { c++; @@ -1014,6 +1014,7 @@ function buildClientRenderResponse( const clientRenderOptions: DocsClientRenderOptions = { ...coloredRenderOptions, size, + supportsRasterScale: true, rangeId: namedRange.getId(), equation: clientEquation, equationLinkEncoded: encodeURIComponent(clientEquation), @@ -1140,7 +1141,8 @@ function placeImage( equation: string, size: number, delim: AutoLatexCommon.Delimiter, - customAltText?: string + customAltText?: string, + rasterScale?: number ) { // GET VARIABLES let textElement = startElement.getElement().asText(); @@ -1217,7 +1219,7 @@ function placeImage( try { // Configure and size the image while the source equation is still present. Only // commit the text replacement after all image-side operations have succeeded. - result = repairImage(paragraph, childIndex, size, renderer, delim, renderedEquation, equation, customAltText); + result = repairImage(paragraph, childIndex, size, renderer, delim, renderedEquation, equation, customAltText, rasterScale); } catch (err) { // REASON: If image configuration fails, remove the uncommitted image and leave the // original equation untouched. Cleanup itself is best-effort during a Docs outage. @@ -1244,7 +1246,8 @@ function repairImage( delim: AutoLatexCommon.Delimiter, resp: GoogleAppsScript.Base.Blob, equationOriginal: string, - customAltText?: string + customAltText?: string, + rasterScale?: number ): DocsEquationRenderResult { let attemptsToSetImageUrl = 3; Common.reportDeltaTime(552); // 3 seconds!! inserting an inline image takes time @@ -1317,9 +1320,10 @@ function repairImage( //C [75.4, 79.6] on width and height ratio multiple = size / 76.0; else if (renderer[5] === "MathJax") - // The MathJax renderer returns scaled equations. We scale down by 5 (resolution), and 1.26 is just for consistency with other renderers. + // The MathJax renderer reports its actual raster scale. Missing metadata + // means an old 5x sidebar; 1.26 preserves consistency with other renderers. // TODO: When MathJax supports changing font, switch to a font that's more similar to CodeCogs - multiple = 1.26 / 5; + multiple = getMathJaxDisplayScale(rasterScale); Common.reportDeltaTime(595); Common.sizeImage(getDocsApp(), paragraph, childIndex + 1, Math.round(height * multiple), Math.round(width * multiple)); @@ -1576,3 +1580,10 @@ function editEquations(sizeRaw: string, delimiter: string, renderer: string = "a successCount: cursorResult === Common.DerenderResult.Success ? 1 : 0 }; } + +// REASON: local to each server bundle so a Common-library version mismatch +// cannot break image sizing. Old sidebars omit the metadata and rendered at 5x. +function getMathJaxDisplayScale(rasterScale?: number) { + const scale = typeof rasterScale === "number" && Number.isFinite(rasterScale) && rasterScale > 0 && rasterScale <= 12 ? rasterScale : 5; + return 1.26 / scale; +} diff --git a/SidebarMathJaxShared.ts b/SidebarMathJaxShared.ts index 7959506..1502096 100644 --- a/SidebarMathJaxShared.ts +++ b/SidebarMathJaxShared.ts @@ -15,6 +15,9 @@ interface SharedMathJaxApi { } interface SharedMathJaxRenderOptions { + // Server capability and successful-client response metadata, respectively. + supportsRasterScale?: boolean; + rasterScale?: number; equation: string; inline: boolean; size: number; @@ -283,21 +286,34 @@ async function renderEquationPngWithMathJax( }); } - // measure at the requested font size, then rasterize at 5x for quality + // Measure at the requested font size, then oversample without changing layout. + // REASON: 5x looked softer than CodeCogs. 12x gives 2.4x more pixels per + // dimension. Only opt in when the server can undo the actual scale; old + // servers and already-open old sidebars must retain their original sizing. svg.classList.add("mathjax-equation-hidden-render"); svg.style.fontSize = `${renderOptions.size}px`; document.body.appendChild(svg); - const width = svg.clientWidth * 5; - const height = svg.clientHeight * 5; + const layoutWidth = svg.clientWidth; + const layoutHeight = svg.clientHeight; svg.remove(); // REASON: a whitespace-only / empty equation (e.g. a lone "\r") typesets to a 0x0 SVG. A // zero-size OffscreenCanvas then throws an opaque IndexSizeError in convertToBlob ("The size // of OffscreenCanvas is zero"), which surfaced in prod as "MathJax failed to render 1 // equation(s)". Docs skips these upstream in findPos, but Slides/Sheets share this renderer, // so fail fast here with a clear, self-explaining message instead of the canvas crash. - if (width <= 0 || height <= 0) { + if (!Number.isFinite(layoutWidth) || !Number.isFinite(layoutHeight) || layoutWidth <= 0 || layoutHeight <= 0) { throw new Error("Empty equation (zero-size render); nothing to rasterize."); } + // REASON: bound each RGBA canvas to ~32 MB, including very wide/tall + // equations. Four concurrent jobs otherwise multiply the 12x memory cost. + const desiredScale = renderOptions.supportsRasterScale === true ? 12 : 5; + const rasterScale = Math.min(desiredScale, 4096 / layoutWidth, 4096 / layoutHeight, + Math.sqrt(8000000 / (layoutWidth * layoutHeight))); + if (!renderOptions.supportsRasterScale && rasterScale < 5) { + throw new Error("Equation is too large to render safely. Split it into smaller equations."); + } + const width = Math.max(1, Math.floor(layoutWidth * rasterScale)); + const height = Math.max(1, Math.floor(layoutHeight * rasterScale)); svg.setAttribute("width", `${width}px`); svg.setAttribute("height", `${height}px`); @@ -345,7 +361,11 @@ async function renderEquationPngWithMathJax( } }, "image/png"); }); - return await withMathJaxTimeout(pngExport, equationTimeoutMs, "creating the equation image"); + const png = await withMathJaxTimeout(pngExport, equationTimeoutMs, "creating the equation image"); + // The caller sends the same options object back with the PNG. Set this only + // after successful export; an old sidebar never supplies it (server uses 5). + renderOptions.rasterScale = rasterScale; + return png; } finally { URL.revokeObjectURL(svgUrl); } diff --git a/Slides/Code.ts b/Slides/Code.ts index d06e2d3..384c2c1 100644 --- a/Slides/Code.ts +++ b/Slides/Code.ts @@ -42,6 +42,8 @@ interface DerenderData { } interface SlidesClientRenderOptions { + supportsRasterScale?: boolean; + rasterScale?: number; size: number; inline: boolean; r: number; @@ -443,6 +445,7 @@ function findAllClientRenderEquationsInTextElement( delim: renderOptions.delim, equation: clientEquation, equationLinkEncoded: encodeURIComponent(clientEquation), + supportsRasterScale: true, slideId: slide.getObjectId(), pageElementId: getTargetObjectId(textElement), tableRow: isTableCell(textElement) ? textElement.getRowIndex() : undefined, @@ -865,6 +868,7 @@ function findClientRenderEquationInTextElement( delim: renderOptions.delim, equation: clientEquation, equationLinkEncoded: encodeURIComponent(clientEquation), + supportsRasterScale: true, slideId: slide.getObjectId(), pageElementId: getTargetObjectId(textElement), tableRow: isTableCell(textElement) ? textElement.getRowIndex() : undefined, @@ -1277,7 +1281,7 @@ function placeImageAndFillSpaces( const mathJaxRenderer = Common.getRenderer(Common.rendererIds.MATHJAX); const image = target.slide.insertImage(renderedEquation); - resize(image, 1.26 / 5, textHorizontalAlignment, textVerticalAlignment, bounds, pos); + resize(image, getMathJaxDisplayScale(options.rasterScale), textHorizontalAlignment, textVerticalAlignment, bounds, pos); const imageWidth = image.getWidth(); // Replace the equation source with spaces sized to the rendered image (real font's space width). @@ -1670,3 +1674,10 @@ function editEquations(sizeRaw: string, delimiter: string, renderer: string = "a return { result: SlidesDerenderResult.CursorNotFound, successCount: 0 }; } } + +// REASON: local to each server bundle so a Common-library version mismatch +// cannot break image sizing. Old sidebars omit the metadata and rendered at 5x. +function getMathJaxDisplayScale(rasterScale?: number) { + const scale = typeof rasterScale === "number" && Number.isFinite(rasterScale) && rasterScale > 0 && rasterScale <= 12 ? rasterScale : 5; + return 1.26 / scale; +} diff --git a/Slides/Sidebar.ts b/Slides/Sidebar.ts index d836d9b..d6b482c 100644 --- a/Slides/Sidebar.ts +++ b/Slides/Sidebar.ts @@ -42,6 +42,8 @@ function reportMathJaxClientError(context: string, error: unknown, extra: Record } interface SlidesClientRenderOptions { + supportsRasterScale?: boolean; + rasterScale?: number; size: number; inline: boolean; r: number; diff --git a/tests/browser/render-matrix.js b/tests/browser/render-matrix.js index ea83a93..d67a808 100644 --- a/tests/browser/render-matrix.js +++ b/tests/browser/render-matrix.js @@ -23,7 +23,7 @@ const css = fs.readFileSync(path.join(root, 'Docs/ALEStylesheet.html'), 'utf8'). const samples = ['1+1=2', String.raw`\text{Work} = F \times d`, String.raw`\frac{1+1}{2}=1`, String.raw`\sum_{i=1}^{n} i = \frac{n(n+1)}{2}`]; const glyphs = [['2B', '3D', '32'], ['3D', 'D7', '1D451'], ['2B', '3D', '31'], ['2211', '3D', '32']]; const clientCases = cases.filter(c => c.renderer === 'auto' || c.renderer === 'mathjax'); -const records = [], visuals = []; +const records = [], visuals = [], resolutionChecks = []; async function main() { fs.mkdirSync(out, { recursive: true }); @@ -70,7 +70,7 @@ async function main() { MathJax.tex2svgPromise = async (...args) => { const result = await realTypeset(...args); window.lastTypeset = { - fragmentCount: result.querySelectorAll('svg').length, + fragmentCount: [...result.children].filter(child => child.tagName.toLowerCase() === 'svg').length, glyphs: [...result.querySelectorAll('[data-c]')].map(n => n.getAttribute('data-c')), errors: [...result.querySelectorAll('[data-mjx-error]')].map(n => n.getAttribute('data-mjx-error')), }; @@ -89,9 +89,23 @@ async function main() { } const bytes = new Uint8Array(await blob.arrayBuffer()); const b64 = btoa(Array.from(bytes, b => String.fromCharCode(b)).join('')); - return { ...window.lastTypeset, width: bitmap.width, height: bitmap.height, ink, left, right, b64, mime: blob.type }; + return { rasterScale: options.rasterScale || 5, ...window.lastTypeset, width: bitmap.width, height: bitmap.height, ink, left, right, b64, mime: blob.type }; }; }); + // Real PNG A/B: equal layout, more pixels, including the reported angle + // and multi-row cases. The legacy request models a server without scale support. + for (const equation of [String.raw`m\angle 2 = 75^\circ`, + String.raw`\begin{cases}K &: a window.renderPng(p), options); + const after = await page.evaluate(p => window.renderPng(p), { ...options, supportsRasterScale: true }); + assert.equal(after.rasterScale, 12, 'new client must report higher resolution'); + assert.ok(after.width >= before.width * 2.3 && after.height >= before.height * 2.3); + assert.ok(Math.abs(after.width / after.rasterScale - before.width / 5) < 1); + assert.ok(Math.abs(after.height / after.rasterScale - before.height / 5) < 1); + assert.deepEqual(after.errors, []); + resolutionChecks.push({ equation, before: [before.width, before.height], after: [after.width, after.height] }); + } const pngBySettings = new Map(); for (const c of clientCases) { for (let sample = 0; sample < samples.length; sample++) { @@ -102,6 +116,7 @@ async function main() { assert.deepEqual(result.errors, []); for (const glyph of glyphs[sample]) assert.ok(result.glyphs.includes(glyph), `${samples[sample]} missing ${glyph}; got ${result.glyphs}`); assert.equal(result.mime, 'image/png'); + assert.equal(result.rasterScale, 12, 'both apps and renderer preferences negotiate high resolution'); assert.ok(result.ink > 100 && result.width > 0 && result.height > 0, 'PNG contains visible ink'); assert.ok(result.right - result.left > result.width / 2, 'ink reaches across the image'); const hash = crypto.createHash('sha256').update(Buffer.from(result.b64, 'base64')).digest('hex'); @@ -110,7 +125,7 @@ async function main() { const key = `${c.app}/${c.mode}/${sample}`; if (pngBySettings.has(key)) assert.equal(hash, pngBySettings.get(key), 'delimiters/preference must not change pixels'); else pngBySettings.set(key, hash); - records.push({ ...c, sample: samples[sample], delimiterId: p.delim[6], width: result.width, height: result.height, pngSha256: hash }); + records.push({ ...c, sample: samples[sample], delimiterId: p.delim[6], width: result.width, height: result.height, rasterScale: result.rasterScale, pngSha256: hash }); if (c.renderer === 'mathjax' && c.delimiter === '$$') visuals.push({ app: c.app, mode: c.mode, sample, ...result }); } } @@ -129,12 +144,12 @@ async function main() { const escapeHtml = s => s.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>'); await gallery.setContent(`

${app} equation rendering · Auto vs Inline size

Actual PNG output from the production renderer in Chromium.
Automatic and MathJax renderer choices produced identical pixels across every delimiter.

${samples.map((eq, sample) => `${['smart', 'inline'].map(mode => { const v = cells.find(v => v.sample === sample && v.mode === mode); return ``; }).join('')}`).join('')}
Source equationAutomatic sizeInline size
${escapeHtml(eq)}${escapeHtml(eq)}

2× viewing scale · Source font: ${app === 'Docs' ? 11 : 18}px · Delimiters tested: $$, $ (Beta), \\[ \\], \\( \\), All.
Local rendering evidence; not a screenshot of the deployed Google ${app} add-on. External renderer availability and Google insertion are separate checks.
Renderer SHA-256: ${rendererSha256.slice(0, 20)} · Base revision: ${revision.slice(0, 7)}

`); +

${app} equation rendering · Auto vs Inline size

Actual PNG output from the production renderer in Chromium.
Automatic and MathJax renderer choices produced identical pixels across every delimiter.

${samples.map((eq, sample) => `${['smart', 'inline'].map(mode => { const v = cells.find(v => v.sample === sample && v.mode === mode); return ``; }).join('')}`).join('')}
Source equationAutomatic sizeInline size
${escapeHtml(eq)}${escapeHtml(eq)}

2× viewing scale · Source font: ${app === 'Docs' ? 11 : 18}px · Delimiters tested: $$, $ (Beta), \\[ \\], \\( \\), All.
Local rendering evidence; not a screenshot of the deployed Google ${app} add-on. External renderer availability and Google insertion are separate checks.
Renderer SHA-256: ${rendererSha256.slice(0, 20)} · Base revision: ${revision.slice(0, 7)}

`); await gallery.locator('img').evaluateAll(imgs => Promise.all(imgs.map(img => img.decode()))); await gallery.screenshot({ path: path.join(out, `${app.toLowerCase()}-auto-inline.png`), fullPage: true }); await gallery.close(); } - fs.writeFileSync(path.join(out, 'results.json'), JSON.stringify({ revision, rendererSha256, browser: browser.version(), matrixCases: cases.length, browserCases: clientCases.length, pngRenders: records.length, records }, null, 2)); + fs.writeFileSync(path.join(out, 'results.json'), JSON.stringify({ revision, rendererSha256, browser: browser.version(), matrixCases: cases.length, browserCases: clientCases.length, pngRenders: records.length, resolutionChecks, records }, null, 2)); console.log(`PASS: ${clientCases.length} browser settings, ${records.length} real PNG renders. Screenshots: ${out}`); } finally { if (browser) await browser.close(); diff --git a/tests/mathjax-resolution.test.js b/tests/mathjax-resolution.test.js new file mode 100644 index 0000000..fea8809 --- /dev/null +++ b/tests/mathjax-resolution.test.js @@ -0,0 +1,130 @@ +const assert = require('node:assert/strict'); +const test = require('node:test'); +const vm = require('node:vm'); +const path = require('node:path'); +const { compileScript } = require('./helpers/compile-script'); +const source = compileScript(path.join(__dirname, '../SidebarMathJaxShared.ts')); + +// Only SVG layout and browser bitmap APIs are doubled. Browser CI additionally +// checks actual PNG pixels; this harness exercises limits and protocol variants. +async function raster(width, height, supportsRasterScale = true, fail = false) { + const options = { equation: 'x+1', inline: false, size: 11, r: 0, g: 0, b: 0, + ...(supportsRasterScale ? { supportsRasterScale: true } : {}) }; + let dimensions; + const svg = { tagName: 'svg', querySelector: () => null, classList: { add() {} }, + style: {}, clientWidth: width, clientHeight: height, remove() {}, setAttribute() {} }; + const blob = new Blob(['PNG'], { type: 'image/png' }); + const runtime = vm.createContext({ Blob, console, + window: { setTimeout, clearTimeout, MathJax: { + tex2svgPromise: async () => ({ children: [svg] }), svgStylesheet: () => ({ outerHTML: '' }), + } }, + document: { body: { appendChild() {} } }, + XMLSerializer: class { serializeToString() { return ''; } }, + URL: { createObjectURL: () => 'blob:test', revokeObjectURL() {} }, + Image: class { set src(value) { queueMicrotask(() => this.onload()); } }, + OffscreenCanvas: class { + constructor(w, h) { dimensions = [w, h]; } + getContext() { return { drawImage() {}, fillRect() {} }; } + async convertToBlob() { if (fail) throw new Error('export failed'); return blob; } + }, + }); + vm.runInContext(source, runtime, { filename: 'production-raster.js' }); + const output = await runtime.renderEquationPngWithMathJax(options); + return { dimensions, options, output }; +} + +test('normal equations get 12x pixels and report their actual scale', async () => { + const { dimensions, options } = await raster(100, 20); + assert.deepEqual(dimensions, [1200, 240]); + assert.equal(options.rasterScale, 12); +}); + +test('large equations stay within canvas area and dimension budgets', async () => { + for (const [w, h] of [[800, 500], [10000, 10], [10, 10000]]) { + const { dimensions: [width, height], options } = await raster(w, h); + assert.ok(width <= 4096 && height <= 4096); + assert.ok(width * height <= 8000000); + assert.ok(width > 0 && height > 0); + assert.ok(Math.abs(width / options.rasterScale - w) <= 1 / options.rasterScale); + assert.ok(Math.abs(height / options.rasterScale - h) <= 1 / options.rasterScale); + } +}); + +test('new sidebar talking to an old server retains 5x rendering', async () => { + const { dimensions, options } = await raster(100, 20, false); + assert.deepEqual(dimensions, [500, 100]); + assert.equal(options.rasterScale ?? 5, 5); +}); + +test('empty equations and failed exports still reject', async () => { + await assert.rejects(raster(0, 0), /Empty equation/); + await assert.rejects(raster(100, 20, true, true), /export failed/); +}); + +function server(app, extras = {}) { + const runtime = vm.createContext({ console: { log() {}, warn() {}, error() {} }, escape, ...extras }); + vm.runInContext(compileScript(path.join(__dirname, `../${app}/Code.ts`)), runtime); + return runtime; +} + +test('both app scan paths advertise support but leave response scale unset', () => { + const { runCase } = require('./helpers/render-matrix'); + for (const app of ['Docs', 'Slides']) for (const renderer of ['auto', 'mathjax']) { + const { payloads } = runCase({ app, renderer, delimiter: '$$', mode: 'smart' }); + assert.ok(payloads.length); + for (const options of payloads) { + assert.equal(options.supportsRasterScale, true); + assert.equal(options.rasterScale, undefined, 'old sidebar must not echo a requested scale as actual'); + } + } +}); + +test('Docs completion forwards actual raster scale to image placement', () => { + let placed; + const span = { getElement: () => ({ getType: () => 'TEXT' }) }; + const context = server('Docs', { + Common: { rendererIds: { MATHJAX: 0 }, getRenderer: () => [] }, + DocumentApp: { ElementType: { TEXT: 'TEXT' } }, + Utilities: { base64Decode: () => [], newBlob: () => ({}) }, + }); + context.getDocsApp = () => ({ getActive: () => ({ getNamedRangeById: () => ({ + getRange: () => ({ getRangeElements: () => [span] }), remove() {}, + }) }) }); + context.placeImage = (...args) => { placed = args; return { status: 8 }; }; + context.clientRenderComplete([{ options: { rangeId: 'range', rasterScale: 12 }, renderedEquationB64: '' }]); + assert.equal(placed[7], 12); +}); + +test('Docs sizes high-resolution and legacy PNGs identically', () => { + for (const scale of [undefined, 12, 2.5]) { + const actualScale = scale ?? 5; + let sized; + const image = { asInlineImage: () => image, setLinkUrl() {}, setAltDescription() {}, + getWidth: () => 100 * actualScale, getHeight: () => 20 * actualScale }; + const context = server('Docs', { Common: { reportDeltaTime() {}, debugLog() {}, + getClientEquation: () => 'x', sizeImage: (...args) => { sized = args.slice(3); } } }); + context.getDocsApp = () => ({}); + context.repairImage({ getChild: () => image }, 0, 11, [0, '', '', '', '', 'MathJax'], + ['$$', '$$', '', '', 2, 1, 0], { getDataAsString: () => 'PNG' }, 'x', undefined, scale); + assert.deepEqual(sized, [25, 126]); + } +}); + +test('Slides keeps image size and text spacing stable across raster scales', () => { + const results = []; + for (const scale of [undefined, 12, 2.5]) { + let width = 100 * (scale ?? 5), spaces; + const image = { getWidth: () => width, setTitle() {} }; + const context = server('Slides', { Common: { rendererIds: { MATHJAX: 0 }, getRenderer: () => [0, '', 'url'] } }); + context.resize = (_image, factor) => { width *= factor; }; + const textRange = { insertText(_offset, value) { spaces = value; } }; + const range = { getParagraphs: () => [{ getRange: () => ({ getParagraphStyle: () => ({ getParagraphAlignment: () => 'START' }) }) }], clear() {} }; + const result = context.placeImageAndFillSpaces({ slide: { insertImage: () => image }, + textElement: { getContentAlignment: () => 'TOP' }, textRange }, + { rasterScale: scale, size: 11, delim: ['$$', '$$', '', '', 2, 1, 0] }, {}, range, 0, {}, {}); + results.push([result.imageWidth, spaces.length]); + } + assert.deepEqual(results[0], results[1]); + assert.deepEqual(results[0], results[2]); + assert.equal(results[0][0], 126); +}); diff --git a/types/common-types/index.d.ts b/types/common-types/index.d.ts index 8d6b6e7..e30fbb5 100644 --- a/types/common-types/index.d.ts +++ b/types/common-types/index.d.ts @@ -79,6 +79,8 @@ declare namespace AutoLatexCommon { * Options/state for rendering on the client - these are settings for a specific equation */ export interface ClientRenderOptions { + supportsRasterScale?: boolean; + rasterScale?: number; b: number;