window.GGBT_jlatexmath=function(){"use strict";function getPixelRatio(){var testCanvas=document.createElement("canvas"),testCtx=testCanvas.getContext("2d"),devicePixelRatio=window.devicePixelRatio||1,backingStorePixelRatio=testCtx.webkitBackingStorePixelRatio||testCtx.mozBackingStorePixelRatio||testCtx.msBackingStorePixelRatio||testCtx.oBackingStorePixelRatio||testCtx.backingStorePixelRatio||1,pixelRatio=devicePixelRatio/backingStorePixelRatio;return pixelRatio}var pixelRatio=getPixelRatio();function initializeCanvas(canvas){var context;context=canvas.getContext("2d");canvas.style.width=canvas.width+"px";canvas.style.height=canvas.height+"px";canvas.width*=pixelRatio;canvas.height*=pixelRatio;context.scale(pixelRatio,pixelRatio)}function drawLatexOnCanvas(canvas){var latex=canvas.getAttribute("data-content"),ctx=canvas.getContext("2d"),opts={context:ctx,latex:latex,size:14,x:0,y:0,type:0,foregroundColor:"#000000",insets:{top:0,right:0,bottom:0,left:0}},size;if(!latex){console.log("empty latex added.....");return}size=window.jlmlib.drawLatex(opts);if(size){canvas.width=size.width;canvas.height=size.height;canvas.style.lineHeight=size.height+"px";canvas.style.verticalAlign=-100+Math.round(size.baseline*100)+"%";initializeCanvas(canvas);window.jlmlib.drawLatex(opts)}else{canvas.width=70;canvas.height=30;ctx.strokeText("LaTeX error",0,25)}}function drawLatexJQ(canvaslist){pixelRatio=getPixelRatio();if(canvaslist&&canvaslist.length){canvaslist.each(function(e){drawLatexOnCanvas(this)})}}return{drawLatexOnjQuery:drawLatexJQ,drawLatexOnCanvas:drawLatexOnCanvas}}();