Professional Web Applications Themes

Inline Equations X InDesign CS - Adobe Indesign Windows

I am a former PM user, and I have a huge problem to convert my PM files with inline equations (Math Type EPS files). I think it is because the incompatibility with “PM’s proportional leading” and “ID’s baseline leading”. There is some intent to Adobe work out this weird error? Thanks in advance, Fabio Filippon....

  1. #1

    Default Inline Equations X InDesign CS

    I am a former PM user, and I have a huge problem to convert my PM files with inline equations (Math Type EPS files). I think it is because the incompatibility with “PM’s proportional leading” and “ID’s baseline leading”.

    There is some intent to Adobe work out this weird error?

    Thanks in advance,

    Fabio Filippon.
    Fabio_Filippon@adobeforums.com Guest

  2. #2

    Default Re: Inline Equations X InDesign CS

    It's not really an error. It's an unfortunate side effect of the two applications working differently.

    Are you talking about equations that are in paragraphs by themselves or ones that are mixed in with text?

    The former are easy to fix -- you just have to define the paragraph style to be autoleading (PM automatically switches inline graphics to autoleading on import, which used to really annoy me; ID doesn't).

    The latter is more difficult to deal with but I do have some ideas. If they're relevant to your situation, I explain them.

    Dave
    Dave_Saunders@adobeforums.com Guest

  3. #3

    Default Re: Inline Equations X InDesign CS

    Yes, these equations are in paragraphs, mixed in with text. AThe problem occurs when equations are higher than the text font size and, after adjust the base line alignment, overlap the line text below.

    Fabio.
    Fabio_Filippon@adobeforums.com Guest

  4. #4

    Default Re: Inline Equations X InDesign CS

    Nested styles can be used. Assuming you have a relatively small number of heights for the equations you're dealing with.

    First note this: auto-leading works differently in ID than it does in PM. In PM, it made sense only to use 100% when working with inlines because the leading was based entirely on the height of the graphic.

    In ID, the leading is based on: The amount of the graphic above the baseline (when dragged, not when subjected to baseline shifting) plus the (Autoleading - 100) * the specified height of the character holding the graphic. This takes some getting used to, but it makes autoleading values of other than 100 useful.

    However, to solve your problem, you probably need to think in terms of fixed leading for these graphics. Lets say that you have text at 10/12 and you have graphics that are 2, 3 and 4 lines high.

    You need to make 6 character styles, as follows:

    InlineShift2: Sets leading to 16 and baseline shift to -8
    InlineShift3: Sets leading to 24 and baseline shift to -12
    InlineShift4: Sets leading to 32 and baseline shift to -16

    Leading2: Sets leading to 16
    Leading3: Sets leading to 24
    Leading4: Sets leading to 32

    You can now use these in paragraph styles that call for nested styles, or you can apply them manually (you could even write a script that searched for all inlines and applied the appropriate styles based on the height of each graphic).

    The idea is this: if you have an inline that is two lines high, you need to apply character style InlineShift2 to it and then Leading2 to enough following characters that at least one of them is on the next line (remember: leading for a line is based on the largest value applied to any character in that line).

    I'm sure this all sounds ghastly, but I'm inclined to think that it wouldn't be that hard to work with, and that it might well lend itself to a nested style approach where all you have to do is apply the appropriate pargraph style to the affected paragraphs (although that could get tough if you have more than one equation in a paragraph and they're not all the same size).

    Hope this helps.

    Dave
    Dave_Saunders@adobeforums.com Guest

  5. #5

    Default Re: Inline Equations X InDesign CS

    Thanks Dave!

    That is a light in the dark, but I work with 300 to 400 equations in one single PM file.….. You can see how big will be my headache...
    I don’t know scripting, How can I get help whit it?
    If you have another idea…Please!

    Thanks again,

    Fabio.
    Fabio_Filippon@adobeforums.com Guest

  6. #6

    Default Re: Inline Equations X InDesign CS

    OK, I'll see if I can bang out a script.

    Dave
    Dave_Saunders@adobeforums.com Guest

  7. #7

    Default Re: Inline Equations X InDesign CS

    Great!

    Thank you very much!! I’ll wait for that!

    Fabio.
    Fabio_Filippon@adobeforums.com Guest

  8. #8

    Default Re: Inline Equations X InDesign CS

    This comes close to doing the job. I have other commitments right now, so I can't spend any more time on this. Be warned: this is a slow script. Try it out first on a short doent with less than 20 inlines. Make sure you like what it does before you unleash it on a large doent. Be prepared for it to take an hour or more to run if you're looking at 300 inlines.

    I expect there are ways to speed this up, but I can't spend time on it right now. It doesn't seem to work properly for all inlines and I'm not quite sure why, so you may still have to do some cleanup.

    //DESCRIPTION: Fixes up inlines to mimic PageMaker's proportional leading

    //save users measurement preferences
    userHoriz = app.doents[0].viewPreferences.horizontalMeasurementUnits;
    userVert = app.doents[0].viewPreferences.verticalMeasurementUnits;
    app.doents[0].viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
    app.doents[0].viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;

    app.findPreferences = null;
    app.changePreferences = null;
    myDoc = app.activeDoent;
    myInlines = myDoc.search("^g",false,false,undefined);
    if (myInlines.length !=0) {
    for (j=myInlines.length - 1; j >=0; j--) {
    if (myInlines[j].paragraphs[0].characters.length > 2){
    //We got a live one. Might be in a table, so get parent flow
    if (j+1 % 20 == 0) {
    app.doents[0].save(app.doents[0].fullName);
    }
    parFlow = getParentTextFlow(myInlines[j]);
    myIndex = myInlines[j].index;
    myHeight = (getInlineHeight(myInlines[j]));
    myInlines[j].baselineShift = -(myHeight/3);
    newLeading = (myHeight/3)*2 + 3;
    myInlines[j].leading = newLeading
    myBase = myInlines[j].baseline;
    try{
    i = myIndex + 1;
    while (parFlow.characters[i].baseline == myBase) {
    i++;
    }
    parFlow.characters[i+1].leading = newLeading;
    parFlow.characters[i+2].leading = newLeading;
    } catch(e) {
    }
    }
    }
    }

    app.doents[0].viewPreferences.horizontalMeasurementUnits = userHoriz;
    app.doents[0].viewPreferences.verticalMeasurementUnits = userVert;

    function getParentTextFlow(theTextRef) {
    // Returns reference to parent story or text of cell, as appropriate
    if (theTextRef.parent.constructor.name == "Cell") {
    return theTextRef.parent.texts[0];
    } else {
    return theTextRef.parentStory;
    }
    }

    function getInlineHeight(theTextRef) {
    myBounds = theTextRef.pageItems[0].visibleBounds;
    return (myBounds[2] - myBounds[0])
    }

    Good luck. I won't be able to look in here again until tomorrow.

    Dave
    Dave_Saunders@adobeforums.com Guest

  9. #9

    Default Re: Inline Equations X InDesign CS

    Here is a new and better version of that script. It even calculates the value for the extra leading you need based on the paragraph style that is in effect.

    It is just as slow as yesterday's version, but has the attribute of working. With one exception: if you have any inlines in paragraphs that have no paragraph style applied to them (I don't recommend that), the result will be too much leading. I don't have the energy to look into that because you really shoujdn't be doing that anyway.

    Dave

    Here's the script:

    //DESCRIPTION: Fixes up inlines to mimic PageMaker's proportional leading

    //save users measurement preferences
    userHoriz = app.doents[0].viewPreferences.horizontalMeasurementUnits;
    userVert = app.doents[0].viewPreferences.verticalMeasurementUnits;
    app.doents[0].viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
    app.doents[0].viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;

    app.findPreferences = null;
    app.changePreferences = null;
    myDoc = app.activeDoent;
    myInlines = myDoc.search("^g",false,false,undefined);
    if (myInlines.length !=0) {
    for (j=myInlines.length - 1; j >=0; j--) {
    if (myInlines[j].paragraphs[0].characters.length > 2){
    //We got a live one. Might be in a table, so get parent flow
    if (j+1 % 20 == 0) {
    app.doents[0].save(app.doents[0].fullName);
    }
    parFlow = getParentTextFlow(myInlines[j]);
    myIndex = myInlines[j].index;
    myHeight = (getInlineHeight(myInlines[j]));
    myInlines[j].baselineShift = -(myHeight/3);
    myStyle = myInlines[j].appliedParagraphStyle;
    if (myStyle.leading == -1) {
    myInc = myStyle.pointSize * myStyle.autoLeading/100;
    } else {
    myInc = myStyle.leading - myStyle.pointSize;
    }
    newLeading = (myHeight/3)*2 + myInc;
    //myInlines[j].leading = newLeading;
    myLine = myInlines[j].lines[0];
    myStart = myInlines[j].index;
    myEnd = myLine.insertionPoints[-1].index;
    try {
    //have to deal with case where this is the last line of flow
    parFlow.characters[myEnd].contents;
    } catch(e) {
    myEnd--;
    }
    parFlow.characters.itemByRange(myStart,myEnd).lead ing = newLeading;
    }
    }
    }

    app.doents[0].viewPreferences.horizontalMeasurementUnits = userHoriz;
    app.doents[0].viewPreferences.verticalMeasurementUnits = userVert;

    function getParentTextFlow(theTextRef) {
    // Returns reference to parent story or text of cell, as appropriate
    if (theTextRef.parent.constructor.name == "Cell") {
    return theTextRef.parent.texts[0];
    } else {
    return theTextRef.parentStory;
    }
    }

    function getInlineHeight(theTextRef) {
    myBounds = theTextRef.pageItems[0].visibleBounds;
    return (myBounds[2] - myBounds[0])
    }
    Dave_Saunders@adobeforums.com Guest

  10. #10

    Default Re: Inline Equations X InDesign CS

    Thaks Dave!

    I'll try out this script.

    Fabio.
    Fabio_Filippon@adobeforums.com Guest

  11. #11

    Default Re: Inline Equations X InDesign CS

    I tried out your script on a 50-page file with equations and it worked great!! It took some searching on this forum but it definitely paid off! Thank you! Thank you! :)
    Linda_Marie_Williams@adobeforums.com Guest

  12. #12

    Default Re: Inline Equations X InDesign CS

    Wow! Glad it helped. I'd just about forgotten that I'd written it.

    Dave
    Dave_Saunders@adobeforums.com Guest

  13. #13

    Default Re: Inline Equations X InDesign CS

    Linda's finding this script has caused me to take a closer look at it. I am not as happy with it as Linda was. It put too much space below each graphic and not enough above for my taste. So, I've improved it. I've added it to my downloads page. <http://pdsassoc.com/index.php?Nav=downssub&Ban=InformalUtilitiesForDow nload&Info=downloads/index.php>

    Dave
    Dave_Saunders@adobeforums.com Guest

  14. #14

    Default Inline Equations X InDesign CS

    I've tried the script to my adobe indesign cs3 but error and give me the message below

    JavaScript Error!
    Error Number 55
    Error String: Object does not support the property or method
    findPreferences
    Line: 19
    Source: app.findPreferences = null;
    arya Guest

Similar Threads

  1. Help with equations
    By Paul Harris in forum Adobe Indesign Macintosh
    Replies: 0
    Last Post: April 6th, 06:27 AM
  2. Inline Styles
    By mmorton23 in forum Macromedia Dynamic HTML
    Replies: 3
    Last Post: September 16th, 02:41 PM
  3. indesign ME edition files on normal indesign (ME enabler plugin not found)
    By illustrator1@operamail.com in forum Adobe Indesign Macintosh
    Replies: 0
    Last Post: June 16th, 10:04 AM
  4. [PHP-DEV] [PATCH] inline -> static inline
    By Sascha Schumann in forum PHP Development
    Replies: 0
    Last Post: August 15th, 09:03 PM
  5. Inline Refresh Help
    By J. Squeed in forum FileMaker
    Replies: 0
    Last Post: July 23rd, 02:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139