Syntax highlighting Javascript in LyX, insert child & # 8594; program list

I am writing a master's thesis, which includes javascript alotta. Im including it as a child file, as a list of programs with the following parameters:

breaklines=true captionpos=b frame=tb language=Python 

There is no javascript language / listing file, so Im trying to use python. Also tried Java, but not very good either.

Is there any way to get js syntax highlighting here? This is really a lot of code, so it is not very easy to read when everything is black.

thank

0
javascript syntax-highlighting lyx
May 2 '12 at 19:58
source share
1 answer

Actually there is no JavaScript / language file, but you can configure it manually. When you right-click on a block of code in your LyX editor, tabs "Options-> Advanced", you can manually set the parameters for your publication (NB: my LyX is in French, so the path to the click may be slightly different).

Following http://lenaherrmann.net/2010/05/20/javascript-syntax-highlighting-in-the-latex-listings-package , I added:

 comment={[l]{//}} commentstyle={\color{purple}\ttfamily} identifierstyle={\color{black}} keywords={typeof, new, true, false, catch, function, return, null, catch, switch, var, if, in, while, do, else, case, break} keywordstyle={\color{blue}\bfseries} morecomment={[s]{/*}{*/}} ndkeywords={class, export, boolean, throw, implements, import, this} ndkeywordstyle={\color{darkgray}\bfseries} sensitive=false stringstyle={\color{red}\ttfamily} 
+3
Mar 05 '13 at 13:27
source share



All Articles