Blame | Last modification | View Log | Download
## UsageTo create a semantics, use the `PhpOffice\Math\Element\Semantics` class.### Methods#### addThe method add an element to the `semantics` element.The method has one parameter :* `PhpOffice\Math\Element\AbstractElement` **$element**#### addAnnotationThe method add an annotation to the `semantics` element.The method has two parameters :* `string` **$encoding*** `string` **$annotation**#### getAnnotationThe method return an annotation based on its encoding.The method has one parameter :* `string` **$encoding**#### getAnnotationsThe method return alls annotation of the `semantics` element.The method has no parameter.#### getElementsThe method return all elements of the `semantics` element.#### removeThe method remove an element to the `semantics` element.The method has one parameter :* `PhpOffice\Math\Element\AbstractElement` **$element**## Example### Math<math display="block"><semantics><mi>y</mi><annotation encoding="application/x-tex"> y </annotation></semantics></math>### XML``` xml<math display="block"><semantics><mi>y</mi><annotation encoding="application/x-tex"> y </annotation></semantics></math>```### PHP``` php<?phpuse PhpOffice\Math\Element;use PhpOffice\Math\Math;$math = new Math();$semantics = new Element\Semantics();$semantics->add(new Element\Identifier('y'));$semantics->addAnnotation('application/x-tex', ' y ');$math->add($semantics);```