mirror of
https://github.com/Pomax/BezierInfo-2.git
synced 2025-08-24 09:13:07 +02:00
rebuild
This commit is contained in:
@@ -45,13 +45,14 @@ function escapeBlockLaTeX(source) {
|
||||
|
||||
// Make sure we hardcode the size of this LaTeX SVG image, because we absolutely
|
||||
// do not want the page to resize in any possible noticable way if we can help it.
|
||||
// The SVG contains values in "ex" units, but to maximise rendering compatibility
|
||||
// with things like older Android tables etc. we convert these to "em" instead.
|
||||
// The SVG contains values in "ex" units, but to maximise legibility we convert
|
||||
// these to "rem" instead, so that formulae are always sized the same, no matter
|
||||
// the textsize around them.
|
||||
var svg = fs.readFileSync(filename).toString();
|
||||
var exem = 0.45;
|
||||
var w = parseFloat(svg.match(/width="([^"]+)"/)[1]) * exem;
|
||||
var h = parseFloat(svg.match(/height="([^"]+)"/)[1]) * exem;
|
||||
var rewrite = `<img className="LaTeX SVG" src="${filename}" style={{width:"${w}em", height:"${h}em"}} />`;
|
||||
var ex2rem = 0.45;
|
||||
var w = parseFloat(svg.match(/width="([^"]+)"/)[1]) * ex2rem;
|
||||
var h = parseFloat(svg.match(/height="([^"]+)"/)[1]) * ex2rem;
|
||||
var rewrite = `<img className="LaTeX SVG" src="${filename}" style={{width:"${w}rem", height:"${h}rem"}} />`;
|
||||
|
||||
newsource += rewrite;
|
||||
}
|
||||
|
Reference in New Issue
Block a user