Run JEuclid "mml2xxx" Command on macOS

Q

How to Run JEuclid "mml2xxx" Command on macOS?

✍: FYIcenter

A

"mml2xxx" is a command provided in JEuclid 3.1.9 that allows you to render a MathML document into an image file in the following formats:

JPEG (always)
PNG (always)
BMP (always)
WBMP (always)
GIF ( > JDK 1.6, or with FreepHEP)
SVG (with Batik)
EMF (with FreeHep)
PDF (with FreeHep)
PS (with FreeHep)
SWF (with FreeHep)

You can follow these steps to run the "mml2xxx" command.

1. Create the following MathML document and save it as JEuclid-MathML-Example-4.xml.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<math xmlns="http://www.w3.org/1998/Math/MathML" 
  mode="display" overflow="scroll">
  <mrow>
    <mo stretchy="false">{</mo>
    <munder>
      <mrow>
        <mover>
          <mrow>
            <mpadded width="0"/>
            <mi>a</mi>
            <mo>,</mo>
            <mo>...</mo>
            <mo>,</mo>
            <mi>a</mi>
          </mrow>
          <mover>
            <mo>︷</mo>
            <mrow>
              <mi>k</mi>
              <mtext> </mtext>
              <mi>a</mi>
              <mtext>'s</mtext>
            </mrow>
          </mover>
        </mover>
        <mo>,</mo>
        <mover>
          <mrow>
            <mpadded/>
            <mi>b</mi>
            <mo>,</mo>
            <mo>...</mo>
            <mo>,</mo>
            <mi>b</mi>
          </mrow>
          <mover>
            <mo>︷</mo>
            <mrow>
              <mi>ℓ</mi>
              <mtext> </mtext>
              <mi>b</mi>
              <mtext>'s</mtext>
            </mrow>
          </mover>
        </mover>
      </mrow>
      <munder>
        <mo>︸</mo>
        <mrow>
          <mi>k</mi>
          <mo>+</mo>
          <mi>ℓ</mi>
          <mtext> elements</mtext>
        </mrow>
      </munder>
    </munder>
    <mo stretchy="false">}</mo>
  </mrow>
</math>

2. Render the MathML document into a PNG image file. You may see the following error.

fyicenter$ ~/Applications/jeuclid-3.1.9/bin/mml2xxx \
  JEuclid-MathML-Example-4.xml output.png -fontSize 48

Exception in thread "main" java.lang.NoClassDefFoundError: org/w3c/dom/events/CustomEvent
  ...
  at net.sourceforge.jeuclid.converter.Converter.render(Converter.java:294)
  at net.sourceforge.jeuclid.converter.ImageIOConverter.convert(ImageIOConverter.java:67)
  at net.sourceforge.jeuclid.converter.Converter.convert(Converter.java:251)
  at net.sourceforge.jeuclid.converter.Converter.convert(Converter.java:175)
  at net.sourceforge.jeuclid.converter.Converter.convert(Converter.java:144)
  at net.sourceforge.jeuclid.app.Mml2xxx.main(Mml2xxx.java:130)

3. Fix the error by using an older version of Java Runtime.

fyicenter$ export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_341.jdk/Contents/Home

fyicenter$ ~/Applications/jeuclid-3.1.9/bin/mml2xxx \
  JEuclid-MathML-Example-4.xml JEuclid-MathML-Example-4.png -fontSize 48

4. View the math formula saved in the PNG file.

JEuclid MathML Example 4
JEuclid MathML Example 4

 

Run JEuclid "mathviewer" Command on macOS

Install JEuclid 3.1.9 Binary Package on macOS

Using JEuclid 3.1.9 on macOS

⇑⇑ FAQ for JEuclid for MathML

2025-04-29, ∼1179🔥, 0💬