开发者

"$" symbol in a code chunk of noweb (literate programming) file

开发者 https://www.devze.com 2023-01-29 19:35 出处:网络
I have following javascript code inside a code chunk of a noweb(i.e., .nw) file: <<tooltip>>= $(\"span\").tooltip({

I have following javascript code inside a code chunk of a noweb (i.e., .nw) file:

<<tooltip>>=
$("span").tooltip({
   tip: 'tooltip',
   predelay: 30,
   delay: 3000,
   onShow: function(){}
});


@

The generated javascript code is correct. But the generated latex file is wrong. It says that I am missing a "$" symbol ("! Missing $ inserted.").

In this case, how can I generate a correct .tex file using noweave? For now I can gener开发者_如何学Pythonate the correct .tex file by a commented out "$" symbol after the "@" symbol, that is, I substitute the last line from the above example with the following line.

@ %$

I still feel this is not correct enough. It messes up the syntax highlighting in emacs. I appreciate any input regarding this as I am just beginning to like the idea of literate programming.


you can replace the $ symbol with jQuery

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号