1

We are building a knowledge base storing a lot of formulas. For presentation purposes, all our formulas are displayed inside a <math>...</math> 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.

1

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}} }}.

1
  • 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}} }} – Ad N Apr 22 '15 at 8:15
0

To complete Tgr answer:

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).

To do that, go to the Properties:Formula special page on the wiki, and create it with the content:

[[Has type::Text]]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.