addMathEquation
- addBibliography
- addBookmark
- addBreak
- addChart
- addCitation
- addComment
- addCrossReference
- addDateAndHour
- addEndnote
- addExternalFile
- addFootnote
- addFormElement
- addHeading
- addImage
- addLink
- addList
- addMathEquation
- addMergeField
- addOLE
- addOnlineVideo
- addPageNumber
- addShape
- addSimpleField
- addSource
- addStructuredDocumentTag
- addSVG
- addTab
- addTable
- addTableContents
- addTableFigures
- addText
- addTextBox
- addWordFragment
- addWordML
- embedHTML
- addBackgroundImage
- addFooter
- addFooterSection
- addHeader
- addHeaderSection
- addLineNumbering
- addMacroFromDoc
- addPageBorders
- addProperties
- addSection
- createDocx
- createDocxAndDownload
- createCharacterStyle
- createListStyle
- createParagraphStyle
- createTableStyle
- docxSettings
- embedFont
- importChartStyle
- importHeadersAndFooters
- importListStyle
- importStyles
- importStylesWordDefault
- modifyPageLayout
- parseStyles
- removeFooters
- removeHeaders
- setBackgroundColor
- setDecimalSymbol
- setDefaultFont
- setDocumentDefaultStyles
- setEncodeUTF8
- setLanguage
- setMarkAsFinal
- setRTL
- clearBlocks
- cloneBlock
- deleteBlock
- getTemplateVariables
- getTemplateVariablesType
- modifyInputFields
- modifyMergeFields
- processTemplate
- removeTemplateVariable
- removeTemplateVariableImage
- replaceBlock
- replaceListVariable
- replacePlaceholderImage
- replaceTableVariable
- replaceVariableByExternalFile
- replaceVariableByHtml
- replaceVariableByText
- replaceVariableByWordFragment
- replaceVariableByWordML
- setTemplateSymbol
- setTemplateBlockSymbol
- tickCheckboxes
addMathEquation
TRIAL / ADVANCED / PREMIUM
Inserts a math equation in OMML or MathML format.
Description
public addMathEquation ( string $equation, string $type [, array $options] )
Adds a math equation to the DOCX.
Adding encoded HTML in a MathML equation may require using html_entity_decode with the equation parameter.
LibreOffice and other DOCX readers may have limited support when applying styles.
Parameters
equation
The OMML equation code.
type
The equation type: docx, omml or mathml.
options
The possible keys and values are (required options are shown with yellow background):
Key | Type | Description |
---|---|---|
align | string | left, center, right |
bold | bool | |
color | string | ffffff, ff0000... |
fontSize | int | 8, 9, 10... |
italic | bool | |
underline | string | single... |
Release notes
- phpdocx 15.5:
- replace " " with blank spaces.
- phpdocx 10.0:
- bold, color, fontSize and italic styles.
- phpdocx 7.5:
- align style.
- phpdocx 5.5:
- supported as WordFragment.