• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Applying styles to diferents Anchored Objetsaccordin to its height

Explorer ,
Nov 08, 2018 Nov 08, 2018

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.

Captura de pantalla 2018-11-08 a les 12.39.48 p. m..jpg

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

TOPICS
Scripting

Views

524

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 09, 2018 Nov 09, 2018

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 09, 2018 Nov 09, 2018

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 09, 2018 Nov 09, 2018

Copy link to clipboard

Copied

Hokay Perhaps a moderator can delete these messages now? (I know I cannot.)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 09, 2018 Nov 09, 2018

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Nov 09, 2018 Nov 09, 2018

Copy link to clipboard

Copied

It's  problem of "main internal baseline" of the math equation! … not a simplistic bounds calculations.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 09, 2018 Nov 09, 2018

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Nov 09, 2018 Nov 09, 2018

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 09, 2018 Nov 09, 2018

Copy link to clipboard

Copied

Thanks, Manan… bur it doesn't work as well.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Nov 12, 2018 Nov 12, 2018

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 12, 2018 Nov 12, 2018

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Nov 12, 2018 Nov 12, 2018

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines