Documentation / MathType

  • Demos
  • Visit our website
  • Downloads
  • Contact us
  • MathType

    • Wiris Quizzes

      • Learning Lemur

        • CalcMe

          • MathPlayer

            • Store FAQ

              • VPAT for the electronic documentation

                • MathFlow

                  • BF FAQ

                    • Home
                    • MathType
                    • MathType Office Tools
                    • MathType 7 for Windows and Mac
                    • MathType SDK
                    • MathType SDK

                    Extracting baseline info from a Windows Metafile

                    Reading time: 1min

                    MathType inserts data describing the distance in points from the bottom of the frame rectangle to the baseline of the equation. For example:

                    This information can be made use of by word processor and similar applications to ensure proper alignment of the equation baseline with that of a text line in which it is pasted. As of this writing, Many Windows applications currently support this capability (Microsoft Word & Works, PageMaker, to name a few). See Wiris SDK document Interpreting the baseline for information on how to convert this value for use in your application.

                    The baseline data is embedded in the metafile as a MFCOMMENT printer escape (using the Escape function described in the Windows SDK). The baseline comment contains the following 12 bytes of data expressed as a C struct:

                    typedef struct {
                     char signature[8]; %%//%% "MathType" (no terminating null character)
                     WORD type; %%//%% MathType’s comment type (0)
                     WORD baseline_delta; %%//%% in 1/16ths of a point (actually whole points)
                    } MTCommentRec;

                    When attempting to recognize a baseline comment, it is important to make sure the comment type is zero. Although the baseline comment is the only metafile comment currently generated by MathType this may not always be the case.

                    Applications that support baseline positioning can process all objects at import/editing time by either scanning the metafile as described above or, if the object is an OLE object (Microsoft’s Object Linking and Embedding technology), performance may be increased by checking first to see if the object is a MathType equation object. The proper way to do this is to check the object’s ProgId character string. All OLE 1.0 equations produced by MathType have a ProgId of “equation”. All OLE 2.0 equations have a ProgId that begins with “equation.” followed by an arbitrary string that uniquely determines which version of MathType owns the object. For example, Equation Editor 2.0’s ProgId is “Equation.2”. Code that checks ProgIds should do case-insensitive tests.

                    See Wiris SDK document Setting EPS baselines (all platforms) for information on baseline positioning for Encapsulated PostScript files produced by MathType and Setting PICT baselines (Mac) for baseline info in Mac PICTs.

                    Was this article helpful?

                    Yes
                    No
                    Give feedback about this article

                    Related Articles

                    • Application-specific metafile comment convention
                    • Extracting baseline info from a GIF file
                    • Extracting baseline info from an EPS file

                    Making people’s STEM work more meaningful

                    MathType

                    • MathType for Office Tools
                    • MathType for Mac
                    • MathType for Microsoft 365
                    • MathType for Google Workspace
                    • MathType for LMS
                    • MathType for XML Editors
                    • Arabic notation
                    • Our products accessibility
                    • MathType is online

                    WirisQuizzes

                    Learning Lemur

                    Solutions for Education

                    • Blackboard Learn
                    • Brightspace by D2L
                    • Canvas
                    • Google Classroom
                    • Moodle
                    • Schoology

                    Solutions for Publishing Houses

                    Solutions for Technical Writers

                    Solutions for Chemistry

                    Integrations

                    • HTML Editors
                    • MathType in WordPress

                    Pricing

                    Company

                    Careers

                    Blog

                    Contact Us

                    Buy Now

                    Plugin Downloads

                    © Wiris 2025

                    • Cookie Preferences
                    • Cookie Policy
                    • Terms of Use
                    • Privacy Policy / GDPR
                    • Student Data Privacy
                    • Compliance
                    • Powered by Helpjuice
                    Expand