Re[2]: I'm unable to add a language to the listing package
Steve Burton wrote: Hi, I've just spent an afternoon and evening failing to add a language to listings. This is what I have: Lyx 1.5.6 with MiKTeX 2.7 running on Windows XP. I have written a language definition to highlight Cisco IOS configurations and :- put it in a file lstlang0.sty in C:\Program Files\MiKTeX 2.7\tex\latex\listings, refreshed the FNDB and formats in MiKTeX and reconfigured Lyx. It doesn't appear in the language drop down. Added the definition to an existing .sty refreshed and reconfigured - same result. Moved the files in the listing directory above to somewhere else. Refreshed and reconfigured and Lyx put them back! Same result. I have read the listing documentation, searched the Lyx users archive and googled extensively but I'm no further forward. I realize that I've done wrong and that I'm probably stupid but I can't trigger as much as an error message. Any help or pointers would be appreciated before my mind goes completely. Steve. This should work, as I'm using it extensively. If you define the language in the preamble like: \usepackage[usenames]{color} \definecolor{darkgreen}{rgb}{0.3,0.5,0.3} \definecolor{darkblue}{rgb}{0.3,0.3,0.5} \definecolor{darkred}{rgb}{0.5,0.3,0.3} \definecolor{darkcyan}{rgb}{0.3,0.5,0.5} \lstdefinelanguage{LUA}{% sensitive=true,% columns=fixed,% keywordstyle=[1]{\color{darkblue}\bfseries},% keywordstyle=[2]{\color{darkgreen}\bfseries},% morekeywords=[1]{local,if,then,else,end,while,do,function,coroutine,yield},% Official LUA keywords morekeywords=[2]{},% Your private keywords otherkeywords={.,=,~,*,,:},% morestring=[b],% stringstyle={\color{darkred}\itshape},% breaklines=true,% linewidth=\textwidth,% comment=[l]{--}% } You can set it as language in the inline or external listing by using language=LUA and bypassing validation. Marc Flerackers Marc, I've played with this and it's just what I need. Now I can produce truly ghastly multicoloured listings at the drop of a hat. Is there a blink tag? It would be nice though if Lyx picked up the language definitions from lstlangx.sty. Thanks to all for helpful advice and solutions. Steve.
Re[2]: I'm unable to add a language to the listing package
Steve Burton wrote: Hi, I've just spent an afternoon and evening failing to add a language to listings. This is what I have: Lyx 1.5.6 with MiKTeX 2.7 running on Windows XP. I have written a language definition to highlight Cisco IOS configurations and :- put it in a file lstlang0.sty in C:\Program Files\MiKTeX 2.7\tex\latex\listings, refreshed the FNDB and formats in MiKTeX and reconfigured Lyx. It doesn't appear in the language drop down. Added the definition to an existing .sty refreshed and reconfigured - same result. Moved the files in the listing directory above to somewhere else. Refreshed and reconfigured and Lyx put them back! Same result. I have read the listing documentation, searched the Lyx users archive and googled extensively but I'm no further forward. I realize that I've done wrong and that I'm probably stupid but I can't trigger as much as an error message. Any help or pointers would be appreciated before my mind goes completely. Steve. This should work, as I'm using it extensively. If you define the language in the preamble like: \usepackage[usenames]{color} \definecolor{darkgreen}{rgb}{0.3,0.5,0.3} \definecolor{darkblue}{rgb}{0.3,0.3,0.5} \definecolor{darkred}{rgb}{0.5,0.3,0.3} \definecolor{darkcyan}{rgb}{0.3,0.5,0.5} \lstdefinelanguage{LUA}{% sensitive=true,% columns=fixed,% keywordstyle=[1]{\color{darkblue}\bfseries},% keywordstyle=[2]{\color{darkgreen}\bfseries},% morekeywords=[1]{local,if,then,else,end,while,do,function,coroutine,yield},% Official LUA keywords morekeywords=[2]{},% Your private keywords otherkeywords={.,=,~,*,,:},% morestring=[b],% stringstyle={\color{darkred}\itshape},% breaklines=true,% linewidth=\textwidth,% comment=[l]{--}% } You can set it as language in the inline or external listing by using language=LUA and bypassing validation. Marc Flerackers Marc, I've played with this and it's just what I need. Now I can produce truly ghastly multicoloured listings at the drop of a hat. Is there a blink tag? It would be nice though if Lyx picked up the language definitions from lstlangx.sty. Thanks to all for helpful advice and solutions. Steve.
Re[2]: I'm unable to add a language to the listing package
> Steve Burton wrote: >> Hi, >> >> I've just spent an afternoon and evening failing to add a language to >> listings. This is what I have: >> >> Lyx 1.5.6 with MiKTeX 2.7 running on Windows XP. >> >> I have written a language definition to highlight Cisco IOS >> configurations and :- >> >> put it in a file lstlang0.sty in C:\Program Files\MiKTeX >> 2.7\tex\latex\listings, refreshed the FNDB and formats in MiKTeX and >> reconfigured Lyx. It doesn't appear in the language drop down. >> >> Added the definition to an existing .sty refreshed and reconfigured - >> same result. >> >> Moved the files in the listing directory above to somewhere else. >> Refreshed and reconfigured and Lyx put them back! Same result. >> >> I have read the listing documentation, searched the Lyx users archive >> and googled extensively but I'm no further forward. >> >> I realize that I've done wrong and that I'm probably stupid but I >> can't trigger as much as an error message. >> >> Any help or pointers would be appreciated before my mind goes >> completely. >> >> Steve. >> >> >> > This should work, as I'm using it extensively. If you define the > language in the preamble like: > \usepackage[usenames]{color} > \definecolor{darkgreen}{rgb}{0.3,0.5,0.3} > \definecolor{darkblue}{rgb}{0.3,0.3,0.5} > \definecolor{darkred}{rgb}{0.5,0.3,0.3} > \definecolor{darkcyan}{rgb}{0.3,0.5,0.5} > \lstdefinelanguage{LUA}{% > sensitive=true,% > columns=fixed,% > keywordstyle=[1]{\color{darkblue}\bfseries},% > keywordstyle=[2]{\color{darkgreen}\bfseries},% > morekeywords=[1]{local,if,then,else,end,while,do,function,coroutine,yield},% > Official LUA keywords > morekeywords=[2]{},% Your private keywords > otherkeywords={.,=,~,*,>,:},% > morestring=[b]",% > stringstyle={\color{darkred}\itshape},% > breaklines=true,% > linewidth=\textwidth,% > comment=[l]{--}% > } > You can set it as language in the inline or external listing by using > "language=LUA" and bypassing validation. > Marc Flerackers Marc, I've played with this and it's just what I need. Now I can produce truly ghastly multicoloured listings at the drop of a hat. Is there a tag? It would be nice though if Lyx picked up the language definitions from lstlangx.sty. Thanks to all for helpful advice and solutions. Steve.
Re[2]: I'm unable to add a language to the listing package
Steve Burton wrote: Hi, I've just spent an afternoon and evening failing to add a language to listings. This is what I have: Lyx 1.5.6 with MiKTeX 2.7 running on Windows XP. I have written a language definition to highlight Cisco IOS configurations and :- put it in a file lstlang0.sty in C:\Program Files\MiKTeX 2.7\tex\latex\listings, refreshed the FNDB and formats in MiKTeX and reconfigured Lyx. It doesn't appear in the language drop down. Added the definition to an existing .sty refreshed and reconfigured - same result. Moved the files in the listing directory above to somewhere else. Refreshed and reconfigured and Lyx put them back! Same result. I have read the listing documentation, searched the Lyx users archive and googled extensively but I'm no further forward. I realize that I've done wrong and that I'm probably stupid but I can't trigger as much as an error message. Any help or pointers would be appreciated before my mind goes completely. I don't know anything about listings, so I probably won't be terribly helpful. But the first thing I'd suggest, with this and similar problems, is that you try to get it working just with LaTeX. That takes any LyX issues out of the mix, at least. If it's not working with LaTeX, then at least you know it's a configuration issue there. rh Steve. yes, yes, yes and no! I hadn't tried this as I don't 'do' LaTeX and it was probably going to be too complicated. Still nothing ventured... I set up an editor to run pdflatex on .tex files and found that the language couldn't be loaded. I then corrected the .sty syntax and I can now write LaTeX files containing IOS listings and generate correct pdf's. This is a great step forward and I thank you for your advice. However, the language drop-down list in Lyx still doesn't contain 'Cisco' and using the 'language=' parameter doesn't work either. I did reconfigure and restart Lyx. Is there a Lyx specific configuration I need to change to make this work? thanks again, Steve.
Re[2]: I'm unable to add a language to the listing package
Steve Burton wrote: Steve Burton wrote: Hi, I've just spent an afternoon and evening failing to add a language to listings. This is what I have: Lyx 1.5.6 with MiKTeX 2.7 running on Windows XP. I have written a language definition to highlight Cisco IOS configurations and :- put it in a file lstlang0.sty in C:\Program Files\MiKTeX 2.7\tex\latex\listings, refreshed the FNDB and formats in MiKTeX and reconfigured Lyx. It doesn't appear in the language drop down. Added the definition to an existing .sty refreshed and reconfigured - same result. Moved the files in the listing directory above to somewhere else. Refreshed and reconfigured and Lyx put them back! Same result. I have read the listing documentation, searched the Lyx users archive and googled extensively but I'm no further forward. I realize that I've done wrong and that I'm probably stupid but I can't trigger as much as an error message. Any help or pointers would be appreciated before my mind goes completely. I don't know anything about listings, so I probably won't be terribly helpful. But the first thing I'd suggest, with this and similar problems, is that you try to get it working just with LaTeX. That takes any LyX issues out of the mix, at least. If it's not working with LaTeX, then at least you know it's a configuration issue there. rh Steve. yes, yes, yes and no! I hadn't tried this as I don't 'do' LaTeX and it was probably going to be too complicated. Still nothing ventured... I set up an editor to run pdflatex on .tex files and found that the language couldn't be loaded. I then corrected the .sty syntax and I can now write LaTeX files containing IOS listings and generate correct pdf's. This is a great step forward and I thank you for your advice. However, the language drop-down list in Lyx still doesn't contain 'Cisco' and using the 'language=' parameter doesn't work either. I did reconfigure and restart Lyx. Is there a Lyx specific configuration I need to change to make this work? Unfortunately, on looking at this now, it appears that the available languages have been hardcoded into the listings UI---not a good decision. If you can compile LyX yourself---I'm guessing you can, if you're using listings---it would be VERY easy to add a language, and I'd be happy even to provide the patch to do it. Better yet, the available languages should be made configurable. rh rh, I probably could, though I'm using Windows at the moment and I only have an elderly Borland compiler installed. It's years since I programmed for Windows (Windows 95, in fact). I could perhaps do do it under FreeBSD but then I'm trying to use Lyx at work and a non-Windows version wouldn't fit there at all! I tried using ERT. If I got it wrong Lyx crashed. If I got it right it worked until I closed Lyx. When the document was re-opened Lyx spotted the listings stuff but didn't understand the language. Return to Go, go directly to Go, do not collect £200! I tried using an included TeX file but the layout was all wrong. I haven't written anything this weekend and this is rather a lot of trouble for a handful of configuration files. I'll revert to just using Lyx-Code. I might come back to this when I'm not in mid-document! Steve.
Re[2]: I'm unable to add a language to the listing package
Steve Burton wrote: Hi, I've just spent an afternoon and evening failing to add a language to listings. This is what I have: Lyx 1.5.6 with MiKTeX 2.7 running on Windows XP. I have written a language definition to highlight Cisco IOS configurations and :- put it in a file lstlang0.sty in C:\Program Files\MiKTeX 2.7\tex\latex\listings, refreshed the FNDB and formats in MiKTeX and reconfigured Lyx. It doesn't appear in the language drop down. Added the definition to an existing .sty refreshed and reconfigured - same result. Moved the files in the listing directory above to somewhere else. Refreshed and reconfigured and Lyx put them back! Same result. I have read the listing documentation, searched the Lyx users archive and googled extensively but I'm no further forward. I realize that I've done wrong and that I'm probably stupid but I can't trigger as much as an error message. Any help or pointers would be appreciated before my mind goes completely. I don't know anything about listings, so I probably won't be terribly helpful. But the first thing I'd suggest, with this and similar problems, is that you try to get it working just with LaTeX. That takes any LyX issues out of the mix, at least. If it's not working with LaTeX, then at least you know it's a configuration issue there. rh Steve. yes, yes, yes and no! I hadn't tried this as I don't 'do' LaTeX and it was probably going to be too complicated. Still nothing ventured... I set up an editor to run pdflatex on .tex files and found that the language couldn't be loaded. I then corrected the .sty syntax and I can now write LaTeX files containing IOS listings and generate correct pdf's. This is a great step forward and I thank you for your advice. However, the language drop-down list in Lyx still doesn't contain 'Cisco' and using the 'language=' parameter doesn't work either. I did reconfigure and restart Lyx. Is there a Lyx specific configuration I need to change to make this work? thanks again, Steve.
Re[2]: I'm unable to add a language to the listing package
Steve Burton wrote: Steve Burton wrote: Hi, I've just spent an afternoon and evening failing to add a language to listings. This is what I have: Lyx 1.5.6 with MiKTeX 2.7 running on Windows XP. I have written a language definition to highlight Cisco IOS configurations and :- put it in a file lstlang0.sty in C:\Program Files\MiKTeX 2.7\tex\latex\listings, refreshed the FNDB and formats in MiKTeX and reconfigured Lyx. It doesn't appear in the language drop down. Added the definition to an existing .sty refreshed and reconfigured - same result. Moved the files in the listing directory above to somewhere else. Refreshed and reconfigured and Lyx put them back! Same result. I have read the listing documentation, searched the Lyx users archive and googled extensively but I'm no further forward. I realize that I've done wrong and that I'm probably stupid but I can't trigger as much as an error message. Any help or pointers would be appreciated before my mind goes completely. I don't know anything about listings, so I probably won't be terribly helpful. But the first thing I'd suggest, with this and similar problems, is that you try to get it working just with LaTeX. That takes any LyX issues out of the mix, at least. If it's not working with LaTeX, then at least you know it's a configuration issue there. rh Steve. yes, yes, yes and no! I hadn't tried this as I don't 'do' LaTeX and it was probably going to be too complicated. Still nothing ventured... I set up an editor to run pdflatex on .tex files and found that the language couldn't be loaded. I then corrected the .sty syntax and I can now write LaTeX files containing IOS listings and generate correct pdf's. This is a great step forward and I thank you for your advice. However, the language drop-down list in Lyx still doesn't contain 'Cisco' and using the 'language=' parameter doesn't work either. I did reconfigure and restart Lyx. Is there a Lyx specific configuration I need to change to make this work? Unfortunately, on looking at this now, it appears that the available languages have been hardcoded into the listings UI---not a good decision. If you can compile LyX yourself---I'm guessing you can, if you're using listings---it would be VERY easy to add a language, and I'd be happy even to provide the patch to do it. Better yet, the available languages should be made configurable. rh rh, I probably could, though I'm using Windows at the moment and I only have an elderly Borland compiler installed. It's years since I programmed for Windows (Windows 95, in fact). I could perhaps do do it under FreeBSD but then I'm trying to use Lyx at work and a non-Windows version wouldn't fit there at all! I tried using ERT. If I got it wrong Lyx crashed. If I got it right it worked until I closed Lyx. When the document was re-opened Lyx spotted the listings stuff but didn't understand the language. Return to Go, go directly to Go, do not collect £200! I tried using an included TeX file but the layout was all wrong. I haven't written anything this weekend and this is rather a lot of trouble for a handful of configuration files. I'll revert to just using Lyx-Code. I might come back to this when I'm not in mid-document! Steve.
Re[2]: I'm unable to add a language to the listing package
> Steve Burton wrote: >> Hi, >> >> I've just spent an afternoon and evening failing to add a language to >> listings. This is what I have: >> >> Lyx 1.5.6 with MiKTeX 2.7 running on Windows XP. >> >> I have written a language definition to highlight Cisco IOS >> configurations and :- >> >> put it in a file lstlang0.sty in C:\Program Files\MiKTeX >> 2.7\tex\latex\listings, refreshed the FNDB and formats in MiKTeX and >> reconfigured Lyx. It doesn't appear in the language drop down. >> >> Added the definition to an existing .sty refreshed and reconfigured - >> same result. >> >> Moved the files in the listing directory above to somewhere else. >> Refreshed and reconfigured and Lyx put them back! Same result. >> >> I have read the listing documentation, searched the Lyx users archive >> and googled extensively but I'm no further forward. >> >> I realize that I've done wrong and that I'm probably stupid but I >> can't trigger as much as an error message. >> >> Any help or pointers would be appreciated before my mind goes >> completely. >> >> > I don't know anything about listings, so I probably won't be terribly > helpful. But the first thing I'd suggest, with this and similar > problems, is that you try to get it working just with LaTeX. That takes > any LyX issues out of the mix, at least. If it's not working with LaTeX, > then at least you know it's a configuration issue there. > rh >> Steve. >> yes, yes, yes and no! I hadn't tried this as I don't 'do' LaTeX and it was probably going to be too complicated. Still nothing ventured... I set up an editor to run pdflatex on .tex files and found that the language couldn't be loaded. I then corrected the .sty syntax and I can now write LaTeX files containing IOS listings and generate correct pdf's. This is a great step forward and I thank you for your advice. However, the language drop-down list in Lyx still doesn't contain 'Cisco' and using the 'language=' parameter doesn't work either. I did reconfigure and restart Lyx. Is there a Lyx specific configuration I need to change to make this work? thanks again, Steve.
Re[2]: I'm unable to add a language to the listing package
> Steve Burton wrote: >>> Steve Burton wrote: >>> Hi, I've just spent an afternoon and evening failing to add a language to listings. This is what I have: Lyx 1.5.6 with MiKTeX 2.7 running on Windows XP. I have written a language definition to highlight Cisco IOS configurations and :- put it in a file lstlang0.sty in C:\Program Files\MiKTeX 2.7\tex\latex\listings, refreshed the FNDB and formats in MiKTeX and reconfigured Lyx. It doesn't appear in the language drop down. Added the definition to an existing .sty refreshed and reconfigured - same result. Moved the files in the listing directory above to somewhere else. Refreshed and reconfigured and Lyx put them back! Same result. I have read the listing documentation, searched the Lyx users archive and googled extensively but I'm no further forward. I realize that I've done wrong and that I'm probably stupid but I can't trigger as much as an error message. Any help or pointers would be appreciated before my mind goes completely. >>> I don't know anything about listings, so I probably won't be terribly >>> helpful. But the first thing I'd suggest, with this and similar >>> problems, is that you try to get it working just with LaTeX. That takes >>> any LyX issues out of the mix, at least. If it's not working with LaTeX, >>> then at least you know it's a configuration issue there. >>> >> >> >>> rh >>> >> >> Steve. >> >> yes, yes, yes and no! >> >> I hadn't tried this as I don't 'do' LaTeX and it was probably going to >> be too complicated. Still nothing ventured... >> >> I set up an editor to run pdflatex on .tex files and found that the >> language couldn't be loaded. I then corrected the .sty syntax and I >> can now write LaTeX files containing IOS listings and generate correct >> pdf's. >> >> This is a great step forward and I thank you for your advice. >> >> However, the language drop-down list in Lyx still doesn't contain >> 'Cisco' and using the 'language=' parameter doesn't work either. I >> did reconfigure and restart Lyx. >> >> Is there a Lyx specific configuration I need to change to make this >> work? >> >> > Unfortunately, on looking at this now, it appears that the available > languages have been hardcoded into the listings UI---not a good > decision. If you can compile LyX yourself---I'm guessing you can, if > you're using listings---it would be VERY easy to add a language, and I'd > be happy even to provide the patch to do it. Better yet, the available > languages should be made configurable. > rh rh, I probably could, though I'm using Windows at the moment and I only have an elderly Borland compiler installed. It's years since I programmed for Windows (Windows 95, in fact). I could perhaps do do it under FreeBSD but then I'm trying to use Lyx at work and a non-Windows version wouldn't fit there at all! I tried using ERT. If I got it wrong Lyx crashed. If I got it right it worked until I closed Lyx. When the document was re-opened Lyx spotted the listings stuff but didn't understand the language. Return to Go, go directly to Go, do not collect £200! I tried using an included TeX file but the layout was all wrong. I haven't written anything this weekend and this is rather a lot of trouble for a handful of configuration files. I'll revert to just using Lyx-Code. I might come back to this when I'm not in mid-document! Steve.