addMathEquation

addMathEquation

BASIC / ADVANCED / PREMIUM

Inserts a math equation into the PowerPoint presentation.

Description
public addMathEquation($equation, $type, $position, $options = array())

This method inserts OMML or MathML equations into the PowerPoint presentation.

Parameters

equation

OMML equation string or MathML.

type

Type of equation: omml, mathml.

position

Key Type Description
placeholder array

The content is added in a placeholder of the layout. One of the following options can be used to get the text box.

  • 'name' (string) placeholder name.
  • 'descr' (string) placeholder alt text (descr) value.
  • 'position' (int) placeholder position by order. 0 is the first order position.
  • 'type' (string) title (Title), body (Body), ctrTitle (Centered Title), subTitle (Subtitle).
new array

A new position is generated.

  • 'coordinateX' (int) EMUs (English Metric Unit).
  • 'coordinateY' (int) EMUs (English Metric Unit).
  • 'sizeX' (int) EMUs (English Metric Unit).
  • 'sizeY' (int) EMUs (English Metric Unit).
  • 'name' (string) placeholder internal name. If not set, a random name is generated.
  • 'order' (int) set the display order. Default after existing contents. 0 is the first order position. If the order position doesn't exist add after existing contents.
  • 'textBoxStyles' (array) See addTextBox for text box styles.

options

Key Type Description
align string left, center, right.
color string Hexadecimal color value: 'FF0000', '000000'...
fontSize int 8, 9, 10...
Exceptions

Not valid type.

Position not valid.

Code samples

Example #1

The resulting PPTX looks like:

Example #2

The resulting PPTX looks like:

Release notes
  • phppptx 2.0:
    • new method.