Discussion:
[Docutils-users] Substitution for math formula?
Oleksandr Gavenko
2016-02-15 22:46:19 UTC
Permalink
This:

.. |fib| replace:: :math:`fib(n) = fib(n-1)+fib(n-2)`

works in:

Substitution of mathematic formula: |fib|.

But this:

.. |fib| math:: fib(n) = fib(n-1)+fib(n-2)

produced error:

main.rst:211: (WARNING/2) Substitution definition "fib" empty or invalid.

.. |fib| math:: fib(n) = fib(n-1)+fib(n-2)

main.rst:209: (ERROR/3) Undefined substitution referenced: "fib".

HTML output from rst2html have marked |fib| and formula shown only for
directive.

It that correct?
--
http://defun.work/


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Docutils-users mailing list
Docutils-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.
Guenter Milde
2016-02-16 11:40:48 UTC
Permalink
Post by Oleksandr Gavenko
.. |fib| replace:: :math:`fib(n) = fib(n-1)+fib(n-2)`
Substitution of mathematic formula: |fib|.
.. |fib| math:: fib(n) = fib(n-1)+fib(n-2)
main.rst:211: (WARNING/2) Substitution definition "fib" empty or invalid.
.. |fib| math:: fib(n) = fib(n-1)+fib(n-2)
main.rst:209: (ERROR/3) Undefined substitution referenced: "fib".
HTML output from rst2html have marked |fib| and formula shown only for
directive.
It that correct?
Yes, the second syntax is invalid. There is a limited set of replacement
options, only the directives listed in
http://docutils.sourceforge.net/docs/ref/rst/directives.html#directives-for-substitution-definitions
and image are supported.

Günter


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Docutils-users mailing list
Docutils-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply
Bram Geron
2016-02-16 12:35:03 UTC
Permalink
Which is probably a good thing: the math directive compiles to a
display:block in HTML; the math role compiles to a display:inline in
HTML. The compiled HTML would break if you could (easily) put a math
directive in a paragraph.

Cheers, Bram
Post by Guenter Milde
Post by Oleksandr Gavenko
.. |fib| replace:: :math:`fib(n) = fib(n-1)+fib(n-2)`
Substitution of mathematic formula: |fib|.
.. |fib| math:: fib(n) = fib(n-1)+fib(n-2)
main.rst:211: (WARNING/2) Substitution definition "fib" empty or invalid.
.. |fib| math:: fib(n) = fib(n-1)+fib(n-2)
main.rst:209: (ERROR/3) Undefined substitution referenced: "fib".
HTML output from rst2html have marked |fib| and formula shown only for
directive.
It that correct?
Yes, the second syntax is invalid. There is a limited set of replacement
options, only the directives listed in
http://docutils.sourceforge.net/docs/ref/rst/directives.html#directives-for-substitution-definitions
and image are supported.
Günter
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Docutils-users mailing list
https://lists.sourceforge.net/lists/listinfo/docutils-users
Please use "Reply All" to reply to the list.
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Docutils-users mailing list
Docutils-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.

Continue reading on narkive:
Loading...