Copy link to clipboard
Copied
Hi, everybody,
I Have a long document with matrix equations. They're eps files from MathType. The baseline equation script from MathType doesn't work beacuse different export issues.
I wonder if it's possible to apply a specfic Object Style to each equation accordin to it height. So, if the rectangle that contains an eps is taller than than 10 pt but smaller than 33, then apply Object Style "matrix-double"
Each different Object stylke, has its own Ybaseline offset for anchored objects. Tagguin all differents graphics with a style, could simplify to set up a css file for ePub publishing.
Thanks in advanced
Copy link to clipboard
Copied
Is this the same question as your previous Applying diferent character styles to ~a depends of anchored graphic object height ? If so, please delete it. There is no need to post more than once.
Copy link to clipboard
Copied
Thanks, Jongware. I deleted the other one; although it was dealing with the same problem but from a different approach, I think this one is the «million dollar question» (for the methodology) for me at this time.
Copy link to clipboard
Copied
Hokay Perhaps a moderator can delete these messages now? (I know I cannot.)
Copy link to clipboard
Copied
Try the following
var a = app.activeDocument.allGraphics
var origVal = app.scriptPreferences.measurementUnit
app.scriptPreferences.measurementUnit = MeasurementUnits.POINTS
for(var i = 0 ; i < a.length; i++)
{
if(a instanceof EPS && a.parent.parent instanceof Character )
{
var ht = a.parent.visibleBounds[2] - a.parent.visibleBounds[0]
if(ht > 10 && ht < 33)
a.parent.applyObjectStyle(app.activeDocument.objectStyles.itemByName("matrix-double"))
}
}
app.scriptPreferences.measurementUnit = origVal
-Manan
Copy link to clipboard
Copied
It's problem of "main internal baseline" of the math equation! … not a simplistic bounds calculations.
Copy link to clipboard
Copied
Sorry i did not know that, i focused at the problem statement that mentioned "So, if the rectangle that contains an eps is taller than than 10 pt but smaller than 33, then apply Object Style "matrix-double""
Someone with better insight into this would take a stab on the issue i hope.
Copy link to clipboard
Copied
Manan, don't be sorry! Your script could be enough on simplistic equations! …
I've made tons of "Maths" books by the past. It's more a question for a maths equations editor as MathType or MathMagic, between those I've used. For instance, the alignment of the equations on their main baseline are totally automatic [and perfect] with MathMagic.
Best,
Michel
Copy link to clipboard
Copied
Thanks, Manan… bur it doesn't work as well.
Copy link to clipboard
Copied
In my experience, when importing MathType equations, they come in fine at the right height. The problem is that once paragraph and character overrides are cleared it causes them to jump around.
For me, the answer is a script I use to create character styles for each equation that captures their baseline shift...
Ariel
Copy link to clipboard
Copied
TAW, thanks for sharing your experience.
There's a Script in MathType's site that works as well. But, in this case, it doesn't.
Maybe, because alll equations where made in Word 2004 or 7, then reediting in a newer Mac version, then translated to MathType, go back to a PC enviorement, convert to MT again… maybe, some important data could have been lost in this long trip to IndDesign…
that's why I'm wondering.
Copy link to clipboard
Copied
Sounds like it's time to crack open the EPS specs to see if you can get the baseline info from there...
Or, have you tried reopening the equations in the MathType (right click in InDesign and choose Open in Math Type). Is there any way to reset that info there? There are loads of options, but I'm not so familiar with the software (I only use it for this economics journal I typeset 4 times a year).
Ariel