# Is it possible to use MediaWiki Math extension for Semantic Media Wiki annotations?

We are building a knowledge base storing a lot of formulas. For presentation purposes, all our formulas are displayed inside a $...$ pair of tags.

We recently enabled SMW extension, with the intent to store all the formulas as semantic annotations. Sadly, we cannot find a way to enter such an annotation within the math tags.

Is there a way to achieve the desired results ? i.e., storing formulas as SMW annotations, and having them rendered as Latex formula each time they are presented.

Generally, the content of XML-style tags (<foo>...</foo>) is interpreted literally, while the content of template-style functions ({{#foo:...}}) is interpreted as wikimarkup and property lookups or other semantic syntax will work. There is a special function #tag to convert the first type to the second. So you can probably use something like {{#tag:math|{{#show|SomeFormula|?formula}} }}.

• Thank you very much, that adresses our need very elegantly ! Just a remark, I do not know if it is a typo in your answer or a difference in our wikis: we had to replace the first | in each function invocation by a :, resulting in : {{#tag:math|{{#show:SomeFormula|?formula}} }}
In order for the formula to actually show up, one should make sure that the formula property does not have the default Pagetype. Assigning it the Texttype works very well (perhaps other types would work as well).
[[Has type::Text]]