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

Align Math Equation to Baseline

Contributor ,
Dec 11, 2018 Dec 11, 2018

Copy link to clipboard

Copied

Hi,

     I have using the below code to align the math equation to baseline. It was worked but now i am getting issue in that.  Its not align correctly to baseline for one file.

Code:

var sel = app.selection[0];

AlignEqn(sel);

function AlignEqn(obj)

{     

    if(obj != null)

    {

        var fp = obj.graphics[0].itemLink.filePath;

        var f = File(fp);

        f.open('r');

        var fs = f.read();

        f.close();       

        var baseline = fs.match(/%%Baseline:\s+(\S+)/)[1];           

        obj.anchoredObjectSettings.anchorYoffset = -Number(baseline)+"pt";   

        alert("baseline " + baseline)

    }

}

     When I place the equation in InDesign its working.  If I edit the equation or without any changes and save the equation again in MathType, the above code is not working.  When i searching this, i opened both images in textedit, baseline value of those file is getting vary. For your Ref.

Before Save As the Image:

Screen Shot 2018-12-12 at 11.07.57 AM.png

After Save the Image:

Screen Shot 2018-12-12 at 11.08.11 AM.png

     Baseline of the image is getting vary after save the image.  How can I align the equation to its baseline??

TOPICS
Scripting

Views

426

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
Contributor ,
Dec 12, 2018 Dec 12, 2018

Copy link to clipboard

Copied

LATEST

Hi,

     Sorry... Its version issue..

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