3

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

rayhan
  • 197
  • 1
  • 6
  • 1
    Since you haven't got an answer, I recommend just emailing Norman Ramsey, the author of noweb. (He's also a Stack Overflow user.) If you find out an answer, do post it here, so that it will help others with the same question. – ShreevatsaR Mar 22 '11 at 11:44

1 Answers1

1

you can replace the $ symbol with jQuery

TheBrain
  • 5,528
  • 2
  • 25
  • 26
  • Yes, I think so and I also did that. I was looking for a more robust solution. In that way, I will not have to search-and-replace JavaScript code that has already been written using `$`. Besides, writing `$` instead of `jQuery` has essentially became a second nature. Anyway, I am up-voting your answer for now. – rayhan May 10 '11 at 19:30