diff scripts/general/private/__publish_latex_output__.m @ 23923:62dc81691d73

publish: improve detection of inline markup and fix MathJax usage. * scripts/general/publish.m: improve detection of inline markup by using more sophisticated regular expressions compatible to Matlab. Let the formatter decide what to do with inline and block math, as it is not for granted, that all possible output formats accept "$" and "$$" as math delimiters. * scripts/general/private/__publish_latex_output__.m: New formatting functions for inline and block math. Improved documentation. * scripts/general/private/__publish_html_output__.m: New formatting functions for inline and block math. Improved documentation. Use another CDN according to shutdown of MathJaxCDN https://www.mathjax.org/cdn-shutting-down/.
author Kai T. Ohlhus <k.ohlhus@gmail.com>
date Wed, 16 Aug 2017 16:34:01 +0200
parents 3a730821e4a2
children 58b76c741c3d
line wrap: on
line diff
--- a/scripts/general/private/__publish_latex_output__.m	Wed Aug 16 08:19:16 2017 +0200
+++ b/scripts/general/private/__publish_latex_output__.m	Wed Aug 16 16:34:01 2017 +0200
@@ -71,6 +71,12 @@
 ## @samp{text} (str)
 ##
 ## @item
+## @samp{blockmath} (str)
+##
+## @item
+## @samp{inlinemath} (str)
+##
+## @item
 ## @samp{bold} (str)
 ##
 ## @item
@@ -230,6 +236,14 @@
   outstr = ["\n\n" escape_latex(str) "\n\n"];
 endfunction
 
+function outstr = do_blockmath (str)
+  outstr = ["$$" str "$$"];
+endfunction
+
+function outstr = do_inlinemath (str)
+  outstr = ["$" str "$"];
+endfunction
+
 function outstr = do_bold (str)
   outstr = ['\textbf{' str '}'];
 endfunction