cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Using an attribute value to output a graphic in FOSI

RickSchoen
5-Regular Member

Using an attribute value to output a graphic in FOSI

We are using Arbortext Editor 6.1 M020. We are beginning to use MathML instead of ATIMath. We are using MathFlow 2.0b for Arbortext as our equation editor. I am creating a FOSI that will allow our copyeditors to produce a very lightly formatted manuscript (PS or PDF) for internal QC purposes. An example of an equation is:


<disp-formula id="df1" medium="all">

     <mml:math altimg="C:\Users\rschoen\AppData\Local\Temp\MMLIMG2768143.png" display="block"> ...

     </mml:math>

</disp-formula>


Since MathFlow has already created an image of the equation for us, I would like to have the FOSI use that to produce the output manuscript. I would like to grab the value of the altimg attribute of the mml:math tag and have that image displayed in the output but I'm not sure whether that is possible. And, if it is possible, how to go about doing it.


Can anyone help?


Thanks,

Rick Schoen


6 REPLIES 6

Hi Rick,

Does the DTD have one or more elements for graphics? If so, is the file name or entity reference method used for specifying the graphic file name?

Suzanne Napoleon

RickSchoen
5-Regular Member
(To:SuzanneNapoleon)

Hi Suzanne,

We have 2 elements for graphics: graphic and inline-graphic. For both elements, we use a file name reference method for specifying the graphic file name:

     <graphic xlink:href="fg15.eps"></graphic>

or

     <inline-graphic xlink:href="ig1.tiff"></inline-graphic>

Rick

RickSchoen
5-Regular Member
(To:SuzanneNapoleon)

Hi Suzanne,

I found a reply you wrote to another discussion in April 2014. You wrote:

For the record, if graphic entities are used in the document, the graphic entity name can be fillvalled into a putgraph that has the desired scaling. For example:

<e-i-c gi="graphic">

<charlist inherit="1"></charlist>

<att>

<specval attname="print-only" attloc="system-var" attval="yes">

<charsubset charsubsetref="SUPPRESS"></charsubset>

</att>

<att>

<specval attname="print-only" attloc="system-var" attval="yes">

<fillval attname="entityref" fillcat="putgraph" fillchar="graphname">

<charsubset>

<putgraph depth="20pi" scalefit="1">

<subchars>...</subchars>

</putgraph>

</charsubset>

</att>

</e-i-c>

The graphic entity and notation do NOT have to be declared in the FOSI.

I was able to use this code in my FOSI:

<e-i-c gi="inline-formula">

     <charlist inherit="1"></charlist>

</e-i-c>

<e-i-c gi="mml:math" context="inline-formula" gitype="element">

     <charlist inherit="1">

          <suppress sup="1">

     </charlist>

     <att>

          <fillval attname="altimg" fillcat="putgraph" fillchar="graphname">

               <charsubset>

                    <putgraph depth="18pt" scalefit="1"></putgraph>

               </charsubset>

     </att>

</e-i-c>

<e-i-c gi="disp-formula">

     <charlist inherit="1"></charlist>

</e-i-c>

<e-i-c gi="mml:math" context="disp-formula" gitype="element">

     <charlist inherit="1">

          <suppress sup="1">

     </charlist>

     <att>

          <fillval attname="altimg" fillcat="putgraph" fillchar="graphname">

               <charsubset>

                    <putgraph width="7in" scalefit="1"></putgraph>

               </charsubset>

     </att>

</e-i-c>

Here are a coouple of examples of the markup from the XML file:

<inline-formula id="if1" medium="all">

     <mml:math altimg="C:\Users\rschoen\AppData\Local\Temp\MMLIMG41801.png" display="inline"> ...

     </mml:math>

</inline-formula>

and

<disp-formula id="df1" medium="all">

     <mml:math altimg="C:\Users\rschoen\AppData\Local\Temp\MMLIMG41803.png" display="block"> ...

     </mml:math>

</disp-formula>

When I select File > Publish > PDF file, I get the following error for each <inline-formula> and <disp-formula>:

ERROR Att Match: Attribute "altimg" of tag "mml:math" has value "C:\Users\rschoen\AppData\Local\Temp\MMLIMG41801.png" which is not valid for "putgraph:graphname".  Ignoring fillval specified for "mml:math" tag.

It isn't clear to me what is causing the value of altimg to be invalid for graphname.

If I insert an <inline-graphic> in either the <inline-formula> or the <disp-formula>, and copy the value of altimg to the xlink:href attribute (which is used for the file name), the the image of the equation appears in the PDF with no errors.

Rick

So, is your solution to use <inline-graphic> and <graphic> respectively in <inline-formula> and <disp-formula>?

Hi Rick,

The error message is appearing because a graphic filename is used and a graphic entity name is expected.

You could make this approach work by 1) using a "publishing DTD" that has an attribute for a graphic entity name on the <mml:math> element, and 2) developing ACL or other scripting to create a graphic entity for every <mml:math> element with an altimg attribute, and to add the graphic entity attribute to the element. For example:

     <mml:math altimg="C:\Users\rschoen\AppData\Local\Temp\MMLIMG2768143.png" display="block">

would become:

     <!ENTITY MMLIMG2768143 SYSTEM "C:\Users\rschoen\AppData\Local\Temp\MMLIMG2768143.png" NDATA png>

and

<mml:math altimg-entity="MMLIMG2768143" altimg="C:\Users\rschoen\AppData\Local\Temp\MMLIMG2768143.png" display="block">

Then you can fillval from the altimg-entity entity into a putgraph.

Clear as mud? Please let me know any questions you may have.

Good luck!

Suzanne

Rick,

    Did the answers provided resolve your issue?

If so, could you indicate which one, or write how you resolved the issue and mark it as correct, so that the community can review this thread and see what is the correct answer?

Top Tags