RE: LyX v2.4.0 RC4 -> Unicode in Program Listing (again...)
I'm not using gnuplot at all. But I assume you mean that as long as I have produced the input (e.g., Unicode files, plots, etc.), there should be no problem. -Original Message- From: José Matos Sent: Wednesday, April 17, 2024 6:52 PM To: Bernt Lie ; lyx-de...@lists.lyx.org; lyx-users Subject: Re: LyX v2.4.0 RC4 -> Unicode in Program Listing (again...) On Wed, 2024-04-17 at 13:17 +, Bernt Lie wrote: > Question 1: > * Dangerous, because LyX is more likely to *crash*, or > * Dangerous, because it opens up my computer to hacking?? The script that you call can run any code using the gnuplot "system" call. That is the same as having access to a shell... If the gnuplot files that you use are your own, or from one that you trust, then there is no risk... or actually the same risk that you had if you run the script outside of LyX. -- José Abílio -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
Re: LyX v2.4.0 RC4 -> Unicode in Program Listing (again...)
On Wed, 2024-04-17 at 13:17 +, Bernt Lie wrote: > Question 1: > * Dangerous, because LyX is more likely to *crash*, or > * Dangerous, because it opens up my computer to hacking?? The script that you call can run any code using the gnuplot "system" call. That is the same as having access to a shell... If the gnuplot files that you use are your own, or from one that you trust, then there is no risk... or actually the same risk that you had if you run the script outside of LyX. -- José Abílio -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
RE: LyX v2.4.0 RC4 -> Unicode in Program Listing (again...)
OK… I just found I had put the “-shell-escape” string in the wrong cell… I have now changed the preferences, and inserted this string in both of the XeTeX and LuaTeX converters from LaTeX to PDF. Now, I get the (expected) warning that using the “-shell-escape” string is *dangerous*. Question 1: * Dangerous, because LyX is more likely to *crash*, or * Dangerous, because it opens up my computer to hacking?? Experience – here is some listing in LyX: [cid:image003.png@01DA90D8.A23B6C70] This expression is taken from a Jupyter Notebook running in VSCode (language: Julia), where the symbols are created by “\frakm + TAB \dot + TAB = m\dot + TAB v” …and here is what it looks like when I use XeTeX/LuaTeX: [cid:image004.png@01DA90D8.F0F27C50] Questions 2: * Could I expect a better response if I install a font that supports Unicode, and specifies this font in the fonts scheme of Listings? * If I install such a font with Unicode support (e.g., JuliaMono), would that rule out using XeTeX so that I should use LuaTeX? Question 3: * If I should use LuaTeX, how can I change LyX so that issuing command Ctrl+r produces the PDF using LuaTeX? -B From: Bernt Lie Sent: Tuesday, April 16, 2024 7:22 PM To: Bernt Lie ; lyx-de...@lists.lyx.org; lyx-users Subject: LyX v2.4.0 RC4 -> Unicode in Program Listing (again...) OK -- this is the status on my on-going experimentation on Windows 11... (I hope I'm almost there): 1. I experiment with KOMA script Book 2. I have: * Upgraded all packages in MikTeX * Installed Pygments ("pip install Pygments" in Windows Prompt) * Figured out where the "pygmetize" script is located on my computer, and added location to PATH. * In the LyX document, Documents/Settings/Fonts, checked "use non-TeX fonts * In the Documents/Settings/Listings, changed "Syntax Highlighting Package" to "minted" [This didn't work until I set the PATH to "pygmetize"] * In Tools/Preferences/File Handling/Converters, added "-shell-escape" at the end of the Converter line: [cid:image001.png@01DA90D8.479231F0] [This line is slightly different from the Embedded document, since that assumed pdflatex as converter). 3. STATUS: [cid:image002.png@01DA90D8.479231F0] QUESTION 1: What is wrong? I *did* envoke the “-shell-escape” flag, didn’t I? QUESTION 2: By default, Ctrl+R is keyboard shortcut for generating PDF via pdflatex. After I chose “use non-TeX fonts”, Ctrl+R implies generating PDF via XeTeX. How can I change the set-up so that Ctrl+R implies using luatex? -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
LyX v2.4.0 RC4 -> Unicode in Program Listing (again...)
OK -- this is the status on my on-going experimentation on Windows 11... (I hope I'm almost there): 1. I experiment with KOMA script Book 2. I have: * Upgraded all packages in MikTeX * Installed Pygments ("pip install Pygments" in Windows Prompt) * Figured out where the "pygmetize" script is located on my computer, and added location to PATH. * In the LyX document, Documents/Settings/Fonts, checked "use non-TeX fonts * In the Documents/Settings/Listings, changed "Syntax Highlighting Package" to "minted" [This didn't work until I set the PATH to "pygmetize"] * In Tools/Preferences/File Handling/Converters, added "-shell-escape" at the end of the Converter line: [cid:image001.png@01DA9032.84834190] [This line is slightly different from the Embedded document, since that assumed pdflatex as converter). 3. STATUS: [cid:image002.png@01DA9032.E4467C00] QUESTION 1: What is wrong? I *did* envoke the “-shell-escape” flag, didn’t I? QUESTION 2: By default, Ctrl+R is keyboard shortcut for generating PDF via pdflatex. After I chose “use non-TeX fonts”, Ctrl+R implies generating PDF via XeTeX. How can I change the set-up so that Ctrl+R implies using luatex? -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
Problem with `'’ used in program listing
I am clearly doing something stupid with a program listing in LyX. The code in the listing is fragment of SQL (for SQLite3) “name string" regexp "^(\w| |`|'|’|-)+, (\w| |`|'|’|-)+, " That is the regular expression checks for ` ‘ and ’ (backtick, straight quote and right quote). The program listing element is set to Language SQL and Font Family to Typewriter. Unfortunately, as probably expected, when generating View PDF LyX bitches about the presence of one or more of the backtick and right quote. LyX does not allow for TeX code to be inserted into a Program Listing otherwise I would replace the errant character(s) with the appropriate TeX controls. I do not recall where I can change the character code within LyX; vague memory of seeing it somewhere but it is not on the Document Settings dialog nor the Preferences dialog. For completeness the document is using the Tufte Handout class (with a local layout to force use of old style bibtex citations). LyX version 2.3.7 running on macOS Sonoma 14.1.2, Regards, Trevor. <>< Re: deemed!-- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
Re: Program Listing -- programming language, etc.
On 2/11/19 8:44 AM, Bernt Lie wrote: I use LyX 2.3.1-1 on Windows 10. Two questions related to LyX and inserted Program Listing: In the Settings, I can choose Language: * If I make my own definition for syntax highlighting of a programming language (say, Julia or Modelica), where in the directory tree to I put that definition so that it shows up in the pull-down menu of “Language”? * If I want to insert a link to a file instead of the code itself in the Program Listing window, how do I do that? Any hints are welcome, e.g., which help manual to look into, etc. -B The program listings feature uses a LaTeX package (listings by default, minted if you so choose) to handle the syntax highlighting. If you are using listings, the manual gives information on how to add your own language style (and where to store it). If you switch to minted (which requires the Python package Pygments and maybe some other software), I think you can also create your own definition ... but Pygments <http://pygments.org/> supports both Julia and Modelica (among some 300 languages). I have no idea if it's possible to link to an external document inside a program listing inset. I suspect not. Paul
Program Listing -- programming language, etc.
I use LyX 2.3.1-1 on Windows 10. Two questions related to LyX and inserted Program Listing: In the Settings, I can choose Language: [cid:image002.jpg@01D4C218.4CF8E290] * If I make my own definition for syntax highlighting of a programming language (say, Julia or Modelica), where in the directory tree to I put that definition so that it shows up in the pull-down menu of "Language"? * If I want to insert a link to a file instead of the code itself in the Program Listing window, how do I do that? Any hints are welcome, e.g., which help manual to look into, etc. -B
RE: LyX, Program Listing, adding support for Julia, Modelica?
Is it a LaTeX issue? Here is a snapshot of the Settings window for Program Listing in LyX: [cid:image002.jpg@01D4A9A4.26C5B990] My question relates to how I can make Julia (and Modelica) available as choises in the “Language” menu. -B -Original Message- From: Dr Eberhard Lisse Sent: fredag 11. januar 2019 11.48 To: Bernt Lie ; lyx-users@lists.lyx.org Subject: Re: LyX, Program Listing, adding support for Julia, Modelica? That is a LaTeX issue, I think. el On 2019-01-09 17:06 , Bernt Lie wrote: > I use LyX 2.3.1 on Windows 10 (and also LyX 2.2.3 on the same platform). > > > > I’m including some Julia code in my document (Program Listing), but > there is no built-in support for Julia (syntax highlighting, etc.) at > the moment. I have read somewhere that there exists experimental (?) > support for Julia... > > * Is this true? > * If so, where can I get hold of the Julia “plug-in” support file? > * How do I install it? > > > > I’m also including code for the Modelica language. Is there LyX > support for Modelica? If not, it is difficult to develop it? (I have > partial (?) Modelica support for Notepad++ in some XML file, and there > is support for Modelica in Jupyter Notebook...). > > > > Thanks for help! > > -B >
Re: LyX, Program Listing, adding support for Julia, Modelica?
That is a LaTeX issue, I think. el On 2019-01-09 17:06 , Bernt Lie wrote: > I use LyX 2.3.1 on Windows 10 (and also LyX 2.2.3 on the same platform). > > > > I’m including some Julia code in my document (Program Listing), but > there is no built-in support for Julia (syntax highlighting, etc.) at > the moment. I have read somewhere that there exists experimental (?) > support for Julia... > > * Is this true? > * If so, where can I get hold of the Julia “plug-in” support file? > * How do I install it? > > > > I’m also including code for the Modelica language. Is there LyX support > for Modelica? If not, it is difficult to develop it? (I have partial (?) > Modelica support for Notepad++ in some XML file, and there is support > for Modelica in Jupyter Notebook...). > > > > Thanks for help! > > -B >
LyX, Program Listing, adding support for Julia, Modelica?
I use LyX 2.3.1 on Windows 10 (and also LyX 2.2.3 on the same platform). I’m including some Julia code in my document (Program Listing), but there is no built-in support for Julia (syntax highlighting, etc.) at the moment. I have read somewhere that there exists experimental (?) support for Julia... * Is this true? * If so, where can I get hold of the Julia “plug-in” support file? * How do I install it? I’m also including code for the Modelica language. Is there LyX support for Modelica? If not, it is difficult to develop it? (I have partial (?) Modelica support for Notepad++ in some XML file, and there is support for Modelica in Jupyter Notebook...). Thanks for help! -B
Program listing: Julia syntax? inserint "\" and "$"?
Three questions on LyX 2.2.x and newer: 1. Is it possible to choose Julia as language for typesetting program listing? 2. Is it possible to insert Jupyter segments and have them typeset "correctly"? 3. How do I include symbols "\" and "$" in program listing, e.g., if I want to include LaTeX code or Julia code? -B
RE: Ascii file import into Program Listing...
Thanks. --- With best regards/hilsen Bernt Lie, professor University College of Southeast Norway www.usn.no From: Joel Kulesza<mailto:jkule...@gmail.com> Sent: Saturday, September 24, 2016 17:07 To: Bernt Lie<mailto:bernt@hit.no> Cc: lyx-users@lists.lyx.org<mailto:lyx-users@lists.lyx.org> Subject: Re: Ascii file import into Program Listing... Edit -> Paste Special -> Experiment On Sat, Sep 24, 2016 at 8:32 AM, Bernt Lie mailto:bernt@hit.no>> wrote: LyX 2.2.1 on Windows 10 (64 bit)... When I copy and paste the content of an ASCII file (e.g., Notepad, Notepad++, etc.) into a Program Listing window, the code shows up as a single line: information about carriage return, which is seen in the ASCII editor, seems to be lost in the LyX Program Listing file. * WHY??? * How can I preserve the line feeds? Thanks, B
Re: Ascii file import into Program Listing...
On Sat, Sep 24, 2016 at 02:32:38PM +, Bernt Lie wrote: > LyX 2.2.1 on Windows 10 (64 bit)... > > When I copy and paste the content of an ASCII file (e.g., Notepad, Notepad++, > etc.) into a Program Listing window, the code shows up as a single line: > information about carriage return, which is seen in the ASCII editor, seems > to be lost in the LyX Program Listing file. > > * WHY??? I forget. > * How can I preserve the line feeds? Ctrl + shift + v (at least on Linux). Or from the menu, Edit > Paste Special > Plain Text. Scott signature.asc Description: PGP signature
Re: Ascii file import into Program Listing...
Edit -> Paste Special -> Experiment On Sat, Sep 24, 2016 at 8:32 AM, Bernt Lie wrote: > LyX 2.2.1 on Windows 10 (64 bit)... > > When I copy and paste the content of an ASCII file (e.g., Notepad, > Notepad++, etc.) into a Program Listing window, the code shows up as a > single line: information about carriage return, which is seen in the ASCII > editor, seems to be lost in the LyX Program Listing file. > > * WHY??? > * How can I preserve the line feeds? > > Thanks, > B >
Ascii file import into Program Listing...
LyX 2.2.1 on Windows 10 (64 bit)... When I copy and paste the content of an ASCII file (e.g., Notepad, Notepad++, etc.) into a Program Listing window, the code shows up as a single line: information about carriage return, which is seen in the ASCII editor, seems to be lost in the LyX Program Listing file. * WHY??? * How can I preserve the line feeds? Thanks, B
Re: program listing of child documents with accents
Worked like a charm with LyX / TeXLive 2011. Thanks!
Re: Lyx - Program Listing - default settings & cross-reference
Rainer Koelle gmx.net> writes: > > 1.) How to define 'default settings' for program listings? In Document > Settings... > LaTeX Preamble, insert \lset{key=value, key=value, ...} For example: \lstset{language=Fortran,numbers=right}. > > 2.) How to cross reference a program listing Try inserting the following into Document > Settings... > Local Layout: Float Type listing GuiName Listing Placement tbp Extension lol NumberWithin none Style ruled ListName "List of Listings" IsPredefined false UsesFloatPkg true RefPrefix lst End You will now be able to create floats of type "Listing" via Insert > Float > Listing. Put each program listing in a float of that type. Place the labels inside the float captions. Cross-references should now work, and you can create a List of Listings. You are also free to change "Listing" to something else (such as "Program") throughout the code above. Paul
Lyx - Program Listing - default settings & cross-reference
Hello all, I am struggling with 1.) default settings of program listings, and 2.) creating a cross-reference to (a) program listing(s) in my document. Unfortunately, the documentation did not shed any light on me... I use the standard book template for my document. 1.) How to define 'default settings' for program listings? Upon inserting a program listing, I am able to tweak the listing properties through a right-click and adding / ticking the properties I want. It seems that I cannot define personalised preferences. And editing the properties for every program listing will be cumbersome (a lot of work, as I am going to add a lot of program listings). 2.) How to cross reference a program listing It seems that one cannot add a labe or define a label in the program listing settings (adding a label={listing:somefancynameforlabel} ) also failed miserably - did not show up in the reference list. Thanks for any pointer in the right direction. Servus from Belgium, Rainer -- NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a
Re: program listing of child documents with accents
On 13. feb. 2012 20:33, Ricardo wrote: Following Richard advice, below posted source code of a small document. With the current lyx configuration I can insert a child document with the program listing input. The document is saved utf8. I can see accents on the pdf output, but the breaklines of the listings package does not seem to work and I do not why. A long line does not break at any place, despite breaklines=true param is set. Any help welcomed I can use utf8 source code files and have breaklines work too. Of course, breaklines only works for real text. A line with no spaces will not break up. To make utf8 content survive, put \usepackage{listingsutf8} in the document preamble. In the parameters for the included child document, set the "Include Type" to "Program Listing", and in "Listing parameters", set: breaklines=true inputencoding={utf8/latin1} Or possibly utf8/latin9, if you use euro symbols in your program. With this approach, it is not necessary to change the document encoding away from default. Document: http://www.aitel.hist.no/~helgehaf/sw/lyxdemo/listing.lyx Included program code: http://www.aitel.hist.no/~helgehaf/sw/lyxdemo/listing.c Helge Hafting
Re: program listing of child documents with accents
Following Richard advice, below posted source code of a small document. With the current lyx configuration I can insert a child document with the program listing input. The document is saved utf8. I can see accents on the pdf output, but the breaklines of the listings package does not seem to work and I do not why. A long line does not break at any place, despite breaklines=true param is set. Any help welcomed Thanks again. <<<<<<<<<<<<>>>>>>>>>>>>>>>>>> % Preview source code %% LyX 1.6.7 created this file. For more info, see http://www.lyx.org/. %% Do not edit unless you really know what you are doing. \documentclass[11pt,catalan]{report} \usepackage[T1]{fontenc} \usepackage[utf8x]{inputenc} \usepackage{listings} \usepackage[a4paper]{geometry} \geometry{verbose,tmargin=3cm,bmargin=2cm,lmargin=3.5cm,rmargin=2.5cm,headheight=2cm,headsep=1cm,footskip=1.5cm} \setlength{\parskip}{\bigskipamount} \setlength{\parindent}{0pt} \usepackage{calc} \usepackage{amsthm} \usepackage{amsmath} \usepackage{amssymb} \usepackage{esint} \makeatletter %% Textclass specific LaTeX commands. \numberwithin{equation}{section} \numberwithin{figure}{section} %% User specified LaTeX commands. \usepackage{verbatim} \usepackage{varioref} \usepackage{ucs} \usepackage{framed} \usepackage[T1]{fontenc} \usepackage{ucs} \usepackage[utf8x]{inputenc} \makeatother \usepackage{babel} \begin{document} Document d'exemple. document;settings;language;català document;settings;language;other utf8x No problem with accents on main document: áéíóú % \framebox{\begin{minipage}[t]{1\columnwidth}% Inserted child document with accents stored utf-8. Program listing input selected \scriptsize \lstinputlisting[breaklines=true,extendedchars=false]{childdoc-utf8} \scriptsize% \end{minipage}} \nocite{*} \end{document} <<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>> Child document. Stored UTF8. Áéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèá éíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéí
Re: program listing of child documents with accents
On 02/12/2012 11:20 AM, Ricardo wrote: Hello. I use lyx 1.6.7 and Debian GNU/Linux 6.0 Sorry if it's a stupid question, I'm not a lyx advanced user too. I have no problem with the main document in lyx. I can use accents and see them in the output. I have problems with insert;file;child documents and some of the program listing options. Seems that accents and other symbols are a problem when try to get the pdf output.The child documents are saved UTF-8. Despite I browsed the web, and checked the listings package doc, tested some options like extendedchars=true, I can not get what I want. I would like to see the child document as it's saved, the same way if I edit it with a plain text editor, but I did not find the way to do it. For example: I can not insert one word child document "àéèíòóú" I have defined Catalan as language in Lyx and unicode UTF-8 as codification. With this options, and the *verbatim listing* for child document, I can export to pdf the main document with child documents. OK, there are no complaints, I get "àéèíòóú" inside a box on the main document. But I would like to use the *program listing* option, because I need to breaklines for example. I have not found the way to do it. Lyx complains when generate the pdf file if I change form verbatim listing, to program listing (same stupid one word child document), despite any option I tested with listing parameters. It's possible that LaTeX package doing the listings does not like UTF-8. I don't know. I'd suggest you look into the documentation for that package. It will help others to help you, too, if you could post a small set of example files that exhibit the problem. Richard
program listing of child documents with accents
Hello. I use lyx 1.6.7 and Debian GNU/Linux 6.0 Sorry if it's a stupid question, I'm not a lyx advanced user too. I have no problem with the main document in lyx. I can use accents and see them in the output. I have problems with insert;file;child documents and some of the program listing options. Seems that accents and other symbols are a problem when try to get the pdf output.The child documents are saved UTF-8. Despite I browsed the web, and checked the listings package doc, tested some options like extendedchars=true, I can not get what I want. I would like to see the child document as it's saved, the same way if I edit it with a plain text editor, but I did not find the way to do it. For example: I can not insert one word child document "àéèíòóú" I have defined Catalan as language in Lyx and unicode UTF-8 as codification. With this options, and the *verbatim listing* for child document, I can export to pdf the main document with child documents. OK, there are no complaints, I get "àéèíòóú" inside a box on the main document. But I would like to use the *program listing* option, because I need to breaklines for example. I have not found the way to do it. Lyx complains when generate the pdf file if I change form verbatim listing, to program listing (same stupid one word child document), despite any option I tested with listing parameters. Thanks in advance and sorry about my bad English.
Re: An inline preview of a program listing from an external file
On 2012-02-07 10:49, Guenter Milde wrote: > On 2012-02-06, Marcin Zajączkowski wrote: >> On 2012-01-30 13:14, Marcin Zajączkowski wrote: >>> Hi, > >>> I added a program listing from an external file to my document using >>> Insert -> File -> Child document (with type Program Listing). Everything >>> works fine, but I would like to have an ability to turn on preview of >>> that file when working with Lyx (like with program listings pasted into >>> directly into document with Insert -> Program listing). > >>> Is it possible to do that (I tried to use Preview, but with any success)? > >> Anyone, is it currently achievable somehow? Or it's better to enter a >> feature request to be able to follow potential progress in the further >> versions? > > A preview should be possible with an external inset. > You may read the documentation under Help>Embedde Objects and try writing one. Thanks for your reply. I will take a look at it. Marcin
Re: An inline preview of a program listing from an external file
On 2012-02-06, Marcin Zajączkowski wrote: > On 2012-01-30 13:14, Marcin Zajączkowski wrote: >> Hi, >> I added a program listing from an external file to my document using >> Insert -> File -> Child document (with type Program Listing). Everything >> works fine, but I would like to have an ability to turn on preview of >> that file when working with Lyx (like with program listings pasted into >> directly into document with Insert -> Program listing). >> Is it possible to do that (I tried to use Preview, but with any success)? > Anyone, is it currently achievable somehow? Or it's better to enter a > feature request to be able to follow potential progress in the further > versions? A preview should be possible with an external inset. You may read the documentation under Help>Embedde Objects and try writing one. Günter
Re: EOL characters removed when pasting a source code into a program listing section
On 2012-02-03, Marcin Zajączkowski wrote: ... > I just did CTRL-V (normal Edit -> Paste). When after a reply I tried > with paste special "Plain Text" keeps as expected the end of line > characters while "Plain Text, Join Lines" not. > So, generally thanks for your explanation, but don't you think that for > a "Program Listening" section because of its usage normal Edit -> Paste > should keep EOL characters? This makes sense, indeed. Can you file a bug/enhancement report? Günter
Re: EOL characters removed when pasting a source code into a program listing section
On 2012-02-02, Rich Shepard wrote: > On Thu, 2 Feb 2012, Paul A. Rubin wrote: >> How are you doing the pasting? The edit menu gives a couple of options for >> pasting external content, one of which preserves line breaks. >... which is the LyX code environment. The "LyX code" environment is a paragraph style that preserves whitespace in the output. When pasting from somewhere into LyX, there is a Choice between: Edit>Paste Special>Selection and Edit>Paste Special>Selection, Join Lines where the first variant keeps line ends and the second lets paragraphs flow. Günter
Re: EOL characters removed when pasting a source code into a program listing section
On Thu, 2 Feb 2012, Paul A. Rubin wrote: How are you doing the pasting? The edit menu gives a couple of options for pasting external content, one of which preserves line breaks. ... which is the LyX code environment. Rich
Re: EOL characters removed when pasting a source code into a program listing section
How are you doing the pasting? The edit menu gives a couple of options for pasting external content, one of which preserves line breaks. Paul
EOL characters removed when pasting a source code into a program listing section
Hi, When I add Program Listing section (Insert -> Program Listing) and paste source code from IDE or a text editor the EOL characters are removed. For example: usedArgument.setValue1(); usedArgument.getValue2(); becase: usedArgument.setValue1(); usedArgument.getValue2(); Is it necessary to remove those characters for some reason or it should be treated as a bug? I'm using Lyx 2.0.2 under Fedora 15. Regards Marcin
Re: Rename "algorithm" to "program listing" – How to get my program listings into my article?
2011/1/26 Niko Schwarz : > Hi, I'm using LyX with the springer LNCS article class. In my previous > work, all the program listings I had to write could reasonably well be > called "algorithms," so I used the algorithm class in a float. This > time, they aren't really algorithms, they're just program listings. > So, I'd the surrounding float to be called "program listing," not > "algorithm." > > What to do? LyX has listings in Inset menu. You receive fully configurable listings, however if you want floats with captions, you probably need to write a module. -- Manveru jabber: manv...@manveru.pl gg: 1624001 http://www.manveru.pl
Re: Rename "algorithm" to "program listing" – How to get my program listings into my article?
Niko Schwarz googlemail.com> writes: > > Hi, I'm using LyX with the springer LNCS article class. In my previous > work, all the program listings I had to write could reasonably well be > called "algorithms," so I used the algorithm class in a float. This > time, they aren't really algorithms, they're just program listings. > So, I'd the surrounding float to be called "program listing," not > "algorithm." > If you will have exclusively program listings and no algorithm floats, you can put the listings in algorithm floats and add to your preamble \floatname{algorithm}{Program Listing}. That will change the float captions to "Program Listing 1", "Program Listing 2" etc. in the output (they'll still say "Algorithm" in the LyX GUI). Note that if you insert a List of Algorithms, the heading of that will still use the word "algorithm". If you want to mix algorithms and program listings, you'll need to declare a new float class for the program listings and insert the floats using ERT. /Paul
Rename "algorithm" to "program listing" – How to get my program listings into my article?
Hi, I'm using LyX with the springer LNCS article class. In my previous work, all the program listings I had to write could reasonably well be called "algorithms," so I used the algorithm class in a float. This time, they aren't really algorithms, they're just program listings. So, I'd the surrounding float to be called "program listing," not "algorithm." What to do? Niko
Re: math mode in program listing
Jack Tanner hotmail.com> writes: > > I'd like to have a program listing, and to be able to insert math in > comments in the listing. Is that possible? > > For example, > > void main(argv[]) { >// calculate the mean $\mu$ >for (int i = 0; ... > } > > Right click on the listing, click Settings..., go to the Advanced tab, and enter mathescape=true in the right-hand box. /Paul
math mode in program listing
I'd like to have a program listing, and to be able to insert math in comments in the listing. Is that possible? For example, void main(argv[]) { // calculate the mean $\mu$ for (int i = 0; ... }
Re: Insert program listing: all code ends up on one line
- Original Message > From: Vincent van Ravesteijn > To: Nikos Chantziaras > Cc: lyx-users@lists.lyx.org > Sent: Mon, 22 November, 2010 22:59:39 > Subject: Re: Insert program listing: all code ends up on one line > > > > > > So I have two questions at this point: How do I copy&paste correctly, and >is there a way to not copy&paste at all and use an external *.c file? > > > > 1. Try Edit->Paste Special->Plain Text. > > 2. Try Insert->File->Child Document and select Include Type = Program Listing. > > Vincent > I've also noticed in the past that pasting plain text swallows line breaks (although I've not realised in the past that I can paste special to avoid it, thanks for the tip). Perhaps this makes sense on Linux, even Mac, where people sometimes copy from console windows, but on Windows this just breaks 99% of non-LyX pastes. Maybe LyX could be changed, at least on Windows, to not join lines by default? I notice there is an explicit option in Paste Special to join lines, so that wouldn't be completely lost? Jim
Re: Insert program listing: all code ends up on one line
On Tue, 23 Nov 2010 00:53:41 +0200, Nikos Chantziaras wrote: > I'm on LyX 2.0 beta1. > > I wanted to include a *.c file in my document. There doesn't seem to be > a way to do that, so I just copy&pasted the C code inside a "program > listing" box (Insert->Program Listing). > > However, copy&pasting results in all code being put in one line. For > example, this: > > steps = 0; > while (1. + atom_d > 1.) { > atom_d /= 2.; > ++steps; > } > > ends up as: > > steps = 0;while (1. + atom_d > 1.) { atom_d /= 2.; > ++steps;} > > > in LyX (and in the rendered PDF.) So I have two questions at this > point: How do I copy&paste correctly, and is there a way to not > copy&paste at all and use an external *.c file? After you do Ctrl + c place your cursor where you want to paste and do Shift + Ctrl + v but that might not work for you? I can't test it just now. HTH Charlie
Re: Insert program listing: all code ends up on one line
On 11/23/2010 12:59 AM, Vincent van Ravesteijn wrote: So I have two questions at this point: How do I copy&paste correctly, and is there a way to not copy&paste at all and use an external *.c file? 1. Try Edit->Paste Special->Plain Text. 2. Try Insert->File->Child Document and select Include Type = Program Listing. Thank you. Both methods work. I think a "special" paste should not be needed here, given that the only thing one would paste inside a Program Listing box is source code.
Re: Insert program listing: all code ends up on one line
So I have two questions at this point: How do I copy&paste correctly, and is there a way to not copy&paste at all and use an external *.c file? 1. Try Edit->Paste Special->Plain Text. 2. Try Insert->File->Child Document and select Include Type = Program Listing. Vincent
Insert program listing: all code ends up on one line
I'm on LyX 2.0 beta1. I wanted to include a *.c file in my document. There doesn't seem to be a way to do that, so I just copy&pasted the C code inside a "program listing" box (Insert->Program Listing). However, copy&pasting results in all code being put in one line. For example, this: steps = 0; while (1. + atom_d > 1.) { atom_d /= 2.; ++steps; } ends up as: steps = 0; while (1. + atom_d > 1.) { atom_d /= 2.; ++steps;} in LyX (and in the rendered PDF.) So I have two questions at this point: How do I copy&paste correctly, and is there a way to not copy&paste at all and use an external *.c file?
program listing justification
Is there perchance a global setting (or at least a per-document) to make all program listing insets be left-justified?
Re: Marking lines in a Program Listing in Lyx
On Fri, Dec 4, 2009 at 6:18 PM, Paul A. Rubin wrote: > Steve Litt wrote: > > >> I suggest you look at the lyx-code environment. I think it's better for >> displaying computer programs. >> >> > The listings environment gives you a whole lot of options, including syntax > formatting for a number of languages, that you wouldn't have (or would have > to fake manually) in lyx-code. > > /Paul > > Hi, That's exactly the reason I'm using the listings environment. I'll poke around with writing a custom program listing and see what happens. Cheers, Luke
Re: Marking lines in a Program Listing in Lyx
Steve Litt wrote: I suggest you look at the lyx-code environment. I think it's better for displaying computer programs. The listings environment gives you a whole lot of options, including syntax formatting for a number of languages, that you wouldn't have (or would have to fake manually) in lyx-code. /Paul
Re: Marking lines in a Program Listing in Lyx
On Thursday 03 December 2009 16:19:19 you wrote: > On Thu, Dec 3, 2009 at 4:06 PM, Steve Litt wrote: > > On Thursday 03 December 2009 06:59:25 Luke Venediger wrote: > > > Hi Guys, > > > > > > Is it possible to mark certain lines in a Program Listing in Lyx? I'm > > > writing a book and want to point out certain things in code examples. > > > I'm trying to get the same effect as the one used by Mark Pilgrim, see > > > http://diveintopython.org/native_data_types/lists.html#d0e5623 > > > (example 3.6) > > > > > > Many Thanks, > > > Luke Venediger > > > My book: Erlang for Skeptics: http://erlangforskeptics.com/book/ > > > > There are probably a hundred ways to do it. The way that occurs to me is > > to create a new environment -- call it lyx-code-marked, from the lyx-code > > environment. lyx-code-marked would be a different color. So you would > > change > > the environment of the marked lines from lyx-code to lyx-code-marked. > > > > HTH > > > > SteveT > > > > Steve Litt > > Recession Relief Package > > http://www.recession-relief.US > > Twitter: http://www.twitter.com/stevelitt > > Hi Steve, > > Are you saying that inside my "program listing" block I would change to a > custom environment? Currently all text in a program listing block is in the > Plain Layout environment. I'm also using "program listing" to get syntax > highlighting when the output is rendered. Whoa, you're doing things a whole lot differently than I do. I always use the lyx-code environment for program listings. Whatever environment you're using for code listings, use that environment to derive a new environment differing from the original only in color, either foreground or background. Probably if you're printing black and white paper or if you expect some readers to be color blind, you're probably better off changing the background color so it appears gray instead of white. I suggest you look at the lyx-code environment. I think it's better for displaying computer programs. SteveT Steve Litt Recession Relief Package http://www.recession-relief.US Twitter: http://www.twitter.com/stevelitt
Re: Marking lines in a Program Listing in Lyx
On Thu, Dec 3, 2009 at 4:06 PM, Steve Litt wrote: > On Thursday 03 December 2009 06:59:25 Luke Venediger wrote: > > Hi Guys, > > > > Is it possible to mark certain lines in a Program Listing in Lyx? I'm > > writing a book and want to point out certain things in code examples. I'm > > trying to get the same effect as the one used by Mark Pilgrim, see > > http://diveintopython.org/native_data_types/lists.html#d0e5623 (example > > 3.6) > > > > Many Thanks, > > Luke Venediger > > My book: Erlang for Skeptics: http://erlangforskeptics.com/book/ > > There are probably a hundred ways to do it. The way that occurs to me is to > create a new environment -- call it lyx-code-marked, from the lyx-code > environment. lyx-code-marked would be a different color. So you would > change > the environment of the marked lines from lyx-code to lyx-code-marked. > > HTH > > SteveT > > Steve Litt > Recession Relief Package > http://www.recession-relief.US > Twitter: http://www.twitter.com/stevelitt > > Hi Steve, Are you saying that inside my "program listing" block I would change to a custom environment? Currently all text in a program listing block is in the Plain Layout environment. I'm also using "program listing" to get syntax highlighting when the output is rendered. Thanks, Luke
Re: Marking lines in a Program Listing in Lyx
Hi Steve, Thanks very much, I'll give it a try. Cheers, Luke On Thu, Dec 3, 2009 at 4:06 PM, Steve Litt wrote: > On Thursday 03 December 2009 06:59:25 Luke Venediger wrote: > > Hi Guys, > > > > Is it possible to mark certain lines in a Program Listing in Lyx? I'm > > writing a book and want to point out certain things in code examples. I'm > > trying to get the same effect as the one used by Mark Pilgrim, see > > http://diveintopython.org/native_data_types/lists.html#d0e5623 (example > > 3.6) > > > > Many Thanks, > > Luke Venediger > > My book: Erlang for Skeptics: http://erlangforskeptics.com/book/ > > There are probably a hundred ways to do it. The way that occurs to me is to > create a new environment -- call it lyx-code-marked, from the lyx-code > environment. lyx-code-marked would be a different color. So you would > change > the environment of the marked lines from lyx-code to lyx-code-marked. > > HTH > > SteveT > > Steve Litt > Recession Relief Package > http://www.recession-relief.US > Twitter: http://www.twitter.com/stevelitt > >
Re: Marking lines in a Program Listing in Lyx
On Thursday 03 December 2009 06:59:25 Luke Venediger wrote: > Hi Guys, > > Is it possible to mark certain lines in a Program Listing in Lyx? I'm > writing a book and want to point out certain things in code examples. I'm > trying to get the same effect as the one used by Mark Pilgrim, see > http://diveintopython.org/native_data_types/lists.html#d0e5623 (example > 3.6) > > Many Thanks, > Luke Venediger > My book: Erlang for Skeptics: http://erlangforskeptics.com/book/ There are probably a hundred ways to do it. The way that occurs to me is to create a new environment -- call it lyx-code-marked, from the lyx-code environment. lyx-code-marked would be a different color. So you would change the environment of the marked lines from lyx-code to lyx-code-marked. HTH SteveT Steve Litt Recession Relief Package http://www.recession-relief.US Twitter: http://www.twitter.com/stevelitt
Marking lines in a Program Listing in Lyx
Hi, Is it possible to mark certain lines in a Program Listing in Lyx? I'm writing a book and want to point out certain things in code examples. I'm trying to get the same effect as the one used by Mark Pilgrim, see http://diveintopython.org/native_data_types/lists.html#d0e5623 (example 3.6) Many Thanks, Luke Venediger My book: Erlang for Skeptics: http://erlangforskeptics.com/book/
Marking lines in a Program Listing in Lyx
Hi Guys, Is it possible to mark certain lines in a Program Listing in Lyx? I'm writing a book and want to point out certain things in code examples. I'm trying to get the same effect as the one used by Mark Pilgrim, see http://diveintopython.org/native_data_types/lists.html#d0e5623 (example 3.6) Many Thanks, Luke Venediger My book: Erlang for Skeptics: http://erlangforskeptics.com/book/
Re: Trouble adding Program Listing
On 2009-11-25, James Shapiro wrote: > I am using Lyx to write a book, which I am well into (~100 pages). When I > try to insert a "Program Listing" I get the following error: > LaTex Error: File 'listings.sty' not found. > I am running: Lyx version 1.5.3 on Ubuntu version 8.04 and LaTex is > installed. On my Debian system, #> apt-file find listings.sty revealed texlive-latex-recommended: /usr/share/texmf-texlive/tex/latex/listings/listings.sty i.e. you most probably need to install the package texlive-latex-recommended. Günter
Re: Trouble adding Program Listing
James Shapiro schrieb: When I try to insert a "Program Listing" I get the following error: LaTex Error: File 'listings.sty' not found. So listings is not installed in your LaTeX distribution. To install listings, use the package manager of your LaTeX distribution (I guess you are using TeXLive 2008). regards Uwe
Trouble adding Program Listing
I'm sorry if this is the wrong place to post this question, but I did a search for "listings.sty" in this user's list and couldn't find an answer. I am using Lyx to write a book, which I am well into (~100 pages). When I try to insert a "Program Listing" I get the following error: LaTex Error: File 'listings.sty' not found. I am running: Lyx version 1.5.3 on Ubuntu version 8.04 and LaTex is installed. Thanks. -- Best, Jim Shapiro
Re: program listing
* Sajjad wrote, On 12/10/09 14:08: Hello forum, I want to write pseudo-code and i am doing that inside the program listing. But when i generate the pdf , the code are cropped sideways. Any hint to get around that issue? Regards Sajjad
Re: program listing
* Sajjad wrote, On 12/10/09 14:08: Hello forum, I want to write pseudo-code and i am doing that inside the program listing. But when i generate the pdf , the code are cropped sideways. Any hint to get around that issue? Use smaller fonts, or short lines? Sam
program listing
Hello forum, I want to write pseudo-code and i am doing that inside the program listing. But when i generate the pdf , the code are cropped sideways. Any hint to get around that issue? Regards Sajjad
Is it possible to put lines in bold in a program listing?
Hello, I'm new in Lyx and I would like to do something that I am not sure if it is even possible. I have a program listing in my document, but I would like some of its lines in bold, to emphasize them. Is it possible to do that adding an attributte to the program listing? If not is it any other way to do what I want? This is what i have now: \lstinputlisting[basicstyle={\scriptsize},breaklines=true,frame=lines,language=Ada,numbers=left,tabsize=2]{img/example.adb} Thanks in advance, Ander
Re: Program Listing
Paul A. Rubin writes: Thanks Paul, that works fine. I was using float. Graham
Re: Program Listing
Graham wrote: Hi, is it possible to make a "Program Listing" that will not fit on one page, to continue onto the following page. Thanks The listings environment (Insert > Program Listing) will straddle a page boundary automatically. If you're putting the listing in a float, though, that's another story. I don't know how to split that. /Paul
Re: Program Listing
2009/2/17 Graham : > Hi, is it possible to make a "Program Listing" that will not fit on one page, > to continue onto the following page. Is it a question or statament? -- Manveru jabber: manv...@manveru.pl gg: 1624001 http://www.manveru.pl
Program Listing
Hi, is it possible to make a "Program Listing" that will not fit on one page, to continue onto the following page. Thanks
Re: How to insert colored program listing in LYX
Hello, Yes, if you choose a fixed length font like Courrier, the layout of the listing is left as in your text editor, with the possibility of syntax highlighting, line numbering and a lot of other possibilities. For me it works very well : I teach Fortran and I use a lot of program extracts in my documents. The only problem I had was with the trees ... they use special characters and it seems to block LyX... Siegfried.
Re: How to insert colored program listing in LYX
Title: MEUNIER-GUTTIN-CLUZEL Hello, Yes, if you first insert the Listings inset and after, you paste your code ( special paste and plain text ... or something like that ... my LyX speaks french ! ). On the screen it was OK and the tree wasn't affected. Remember I'm on Windows XP with LyX 1.5.6, it can be different with linux. In my case, the problem with the listings solution was that I was unable to produce an ouput. No message, nothing and no output ( I think that LaTeX wasn't called ...). I think it's a problem of characters but I don't have time to investigate. The solution with LyX Code produced a good rendering of the directory tree on the PDF output. Siegfried. -- Siegfried MEUNIER-GUTTIN-CLUZEL Maître de conférence à l'INSA de Rouen Fax. 33 (0)2 32 95 37 94 Tél. 02 32 95 37 46 (CORIA) 02 32 95 97 76 ( INSA ) CNRS UMR 6614 - CORIA Université de Rouen Site Universitaire du Madrillet - BP 12 76801 Saint Etienne du Rouvray cedex Tél. 33 (0)2 32 95 36 00 - Fax 33 (0)2 32 91 04 85 www.coria.fr
Re: How to insert colored program listing in LYX
On Tue, 4 Nov 2008, Siegfried MEUNIER-GUTTIN-CLUZEL wrote: To: Md. Golam Parvez <[EMAIL PROTECTED]> From: Siegfried MEUNIER-GUTTIN-CLUZEL <[EMAIL PROTECTED]> Subject: Re: How to insert colored program listing in LYX Hello, You can use the listings package ( Insert > Listings ). If you right-clic on the listing insert box, you can choose the language you use and the syntax will be highlighted. In the listings manual there are many options, so I suppose you can change the colors if you really want. Hope it helps. Siegfried. Hi Siegfried. Would the listings package insert some code verbatim, without affecting the layout or format of the code? Regards, Keith - Websites: http://www.php-debuggers.net http://www.karsites.net http://www.raised-from-the-dead.org.uk Where will you spend Eternity? http://www.fellowshiptractleague.org/tracts/images/PDF/tract_130.pdf All email addresses are challenge-response protected with TMDA [http://tmda.net] -
Re: How to insert colored program listing in LYX
Md. Golam Parvez schrieb: > I am using lyx-1.5.6 in UBUNTU 8.04. Can anybody tell me how to insert > colored program listing. Thanks in advanced. a) use the listings package http://dante.ctan.org/CTAN/help/Catalogue/entries/listings.html with Insert>Listing or Insert>File>Listing (names may vary, my LyX speaks German) or raw LaTeX (ERT). Read its documentation to find out how to style the code with colours (in the documents LaTeX preamble or the listing settings field under Document>Settings>Text Format). b) use Pygments http://pygments.org to generate LaTeX code for a coloured listing and insert as ERT or as Subdocument. c) use some other tool to generate a PDF or PS version of the listing and insert as graphic. Günter
Re: How to insert colored program listing in LYX
Md. Golam Parvez wrote: Hi I am using lyx-1.5.6 in UBUNTU 8.04. Can anybody tell me how to insert colored program listing. Thanks in advanced. Golam Parvez First, make sure you have the listings LaTeX package (listings.sty) installed, as well as one of the color packages (color.sty or xcolor.sty). In LyX, use Document -> Settings -> Preamble to load the color package (e.g., \usepackage{xcolor}). Now use Insert -> Program Listing to get a listing inset, into which you insert your code. Right-click the handle (the word "Listing") to get the settings dialog. In the Main Settings tab, use the lower left portion to select your language and, if necessary, dialect. In the Advanced tab, type in parameters from the listings.sty LaTeX package to control colors. For instance, 'keywordstyle=\color{blue}' will set keywords in a blue font. Consult the documentation of the listings package for possible color settings. /Paul
Re: How to insert colored program listing in LYX
I have used this Highlight converter with good results. http://www.andre-simon.de/ Output in Latex and then import into your LyX document. --- On Tue, 11/4/08, Ernesto Posse <[EMAIL PROTECTED]> wrote: > From: Ernesto Posse <[EMAIL PROTECTED]> > Subject: Re: How to insert colored program listing in LYX > To: lyx-users@lists.lyx.org > Cc: "Md. Golam Parvez" <[EMAIL PROTECTED]> > Date: Tuesday, November 4, 2008, 8:52 AM > And if your language is not on the list, and you know a > little Python, > I recommend Pygments (http://pygments.org) a very nice > syntax > colouring package that generates, among other things, LaTeX > which you > then can include as a file in your LyX document. > > > > On Tue, Nov 4, 2008 at 7:54 AM, Siegfried > MEUNIER-GUTTIN-CLUZEL > <[EMAIL PROTECTED]> wrote: > > Hello, > > > > You can use the listings package ( Insert > > Listings ). > > If you right-clic on the listing insert box, you can > choose the language you > > use and the syntax will be highlighted. > > In the listings manual there are many options, so I > suppose you can change > > the colors if you really want. > > > > Hope it helps. > > > > Siegfried. > > > > > > -- > Ernesto Posse > > Applied Formal Methods Group - Software Technology Lab > School of Computing > Queen's University - Kingston, Ontario, Canada
Re: How to insert colored program listing in LYX
And if your language is not on the list, and you know a little Python, I recommend Pygments (http://pygments.org) a very nice syntax colouring package that generates, among other things, LaTeX which you then can include as a file in your LyX document. On Tue, Nov 4, 2008 at 7:54 AM, Siegfried MEUNIER-GUTTIN-CLUZEL <[EMAIL PROTECTED]> wrote: > Hello, > > You can use the listings package ( Insert > Listings ). > If you right-clic on the listing insert box, you can choose the language you > use and the syntax will be highlighted. > In the listings manual there are many options, so I suppose you can change > the colors if you really want. > > Hope it helps. > > Siegfried. > -- Ernesto Posse Applied Formal Methods Group - Software Technology Lab School of Computing Queen's University - Kingston, Ontario, Canada
Re: How to insert colored program listing in LYX
Hello, You can use the listings package ( Insert > Listings ). If you right-clic on the listing insert box, you can choose the language you use and the syntax will be highlighted. In the listings manual there are many options, so I suppose you can change the colors if you really want. Hope it helps. Siegfried.
How to insert colored program listing in LYX
Hi I am using lyx-1.5.6 in UBUNTU 8.04. Can anybody tell me how to insert colored program listing. Thanks in advanced. Golam Parvez
Re: Inconsistent indentation behaviour after LyX-Code and Program Listing Inset
Jürgen Spitzmüller wrote: Paul A. Rubin wrote: I'm attaching a small proof-of-concept example that shows three things: Let me rephrase that: once I wake up, I'll be attaching ... The example compiles fine in 1.6svn. It's probably too tricky to backport the changes to 1.5. No reason to waste irreplaceable developer brain cells on backporting something nobody is asking for. :-) If it becomes an issue for someone, they can either use ERT or upgrade to 1.6 once it goes gold. /Paul
Re: Inconsistent indentation behaviour after LyX-Code and Program Listing Inset
Paul A. Rubin wrote: > > I'm attaching a small proof-of-concept example that shows three things: > > Let me rephrase that: once I wake up, I'll be attaching ... The example compiles fine in 1.6svn. It's probably too tricky to backport the changes to 1.5. Jürgen
Re: Inconsistent indentation behaviour after LyX-Code and Program Listing Inset
Paul A. Rubin wrote: I'm attaching a small proof-of-concept example that shows three things: Let me rephrase that: once I wake up, I'll be attaching ... listingsExample.lyx Description: application/lyx
Re: Inconsistent indentation behaviour after LyX-Code and Program Listing Inset
G. Milde wrote: On 20.07.08, Paul A. Rubin wrote: Jürgen Spitzmüller wrote: Anyway, I don't think you'll find a working example. As listings fails with multibyte glyphs, it will also fail when multibyte glyphs are used in ERT, no? Not according to the documentation. You can define an "escape to LaTeX" character, and anything bracketed by that character is handed off to LaTeX verbatim. According to the docs, that allows you to put multibyte characters in a comment (though apparently _only_ in a comment). Anyway, I can't find a way to test this here, since I don't have any CJK fonts installed and wouldn't know how to use them if I did. You can insert a comment with some accented latin characters (like ä or é) and set the encoding to utf8. If this is an issue, we'll find out when someone barks about it. Until then, I'm not sure it's worth worrying about. True again. BTW: While German does not depend on a multibyte encoding, the German umlauts are multibyte characters in UTF-8. Günter Thanks for the tip, Günter. I'm attaching a small proof-of-concept example that shows three things: 1. The version of the listing done in ERT comes out correctly, including Günter's two example multibyte characters. 2. The version done with a listing inset (which has the ä removed for reasons I'll mention in a minute) comes out but with the second comment garbled. I assume this is because forcing latin1 encoding results in the two bytes of é being interpreted as separate characters. 3. If you put the ä back in the document and try to compile it, not only are the two bytes interpreted as separate characters, but one of them apparently is not available in T1, so LaTeX throws an error message. That last part means that we may not be entirely successful in protecting the user from himself (unless Jürgen's patch fixes that). All that said, it's not an issue for me, and I don't recall any users complaining that their comments turned into Klingon, so it's not a priority issue. Cheers, Paul
Re: Inconsistent indentation behaviour after LyX-Code and Program Listing Inset
On 20.07.08, Paul A. Rubin wrote: > Jürgen Spitzmüller wrote: >> Anyway, I don't think you'll find a working example. As listings fails >> with multibyte glyphs, it will also fail when multibyte glyphs are used >> in ERT, no? > Not according to the documentation. You can define an "escape to LaTeX" > character, and anything bracketed by that character is handed off to > LaTeX verbatim. According to the docs, that allows you to put multibyte > characters in a comment (though apparently _only_ in a comment). > Anyway, I can't find a way to test this here, since I don't have any CJK > fonts installed and wouldn't know how to use them if I did. You can insert a comment with some accented latin characters (like ä or é) and set the encoding to utf8. > If this is an issue, we'll find out when someone barks about it. Until > then, I'm not sure it's worth worrying about. True again. BTW: While German does not depend on a multibyte encoding, the German umlauts are multibyte characters in UTF-8. Günter
Re: Inconsistent indentation behaviour after LyX-Code and Program Listing Inset
Jürgen Spitzmüller wrote: Anyway, I don't think you'll find a working example. As listings fails with multibyte glyphs, it will also fail when multibyte glyphs are used in ERT, no? Not according to the documentation. You can define an "escape to LaTeX" character, and anything bracketed by that character is handed off to LaTeX verbatim. According to the docs, that allows you to put multibyte characters in a comment (though apparently _only_ in a comment). Anyway, I can't find a way to test this here, since I don't have any CJK fonts installed and wouldn't know how to use them if I did. If this is an issue, we'll find out when someone barks about it. Until then, I'm not sure it's worth worrying about. /Paul
Re: Inconsistent indentation behaviour after LyX-Code and Program Listing Inset
Paul A. Rubin wrote: > If you mean an example for doing a listing in ERT, the OP (Álvaro) had > one in his original message. If you mean an example using multibyte > encoding, Yes, I mean the latter. > I don't think so -- the closest I come to a "foreign" language > is some long-forgotten German, and that's still single byte, isn't it? It is. I LyX, the only multibyte encodings besides utf8 are the CJK encodings (EUC-JP, BIG5, etc.). Anyway, I don't think you'll find a working example. As listings fails with multibyte glyphs, it will also fail when multibyte glyphs are used in ERT, no? Jürgen
Re: Inconsistent indentation behaviour after LyX-Code and Program Listing Inset
Jürgen Spitzmüller wrote: Paul A. Rubin wrote: I saw the patch you proposed on the developer list, and I think it's a reasonable compromise. The only limitation I can see is that users writing in a language that needs multibyte encoding won't be able to embed native language comments in a listing. If that's important, they can always do the listing in ERT. Can you provide an example for that? Jürgen If you mean an example for doing a listing in ERT, the OP (Álvaro) had one in his original message. If you mean an example using multibyte encoding, I don't think so -- the closest I come to a "foreign" language is some long-forgotten German, and that's still single byte, isn't it? /Paul
Re: Inconsistent indentation behaviour after LyX-Code and Program Listing Inset
Paul A. Rubin wrote: > I saw the patch you proposed on the developer list, and I think it's a > reasonable compromise. The only limitation I can see is that users > writing in a language that needs multibyte encoding won't be able to > embed native language comments in a listing. If that's important, they > can always do the listing in ERT. Can you provide an example for that? Jürgen
Re: Inconsistent indentation behaviour after LyX-Code and Program Listing Inset
Jürgen Spitzmüller wrote: However, I agree the encoding switch is a hack, and we should at least limit the hack to the case where it is needed, i.e. only switch to latin1 if we actually are in a multibyte encoding. So fundamentally, I think, it's a question of whether protecting the user from himself on the encoding issue is worth the price. Suggestions are welcome. But they have to work in any encoding. I saw the patch you proposed on the developer list, and I think it's a reasonable compromise. The only limitation I can see is that users writing in a language that needs multibyte encoding won't be able to embed native language comments in a listing. If that's important, they can always do the listing in ERT. /Paul
Re: Inconsistent indentation behaviour after LyX-Code and Program Listing Inset
Paul A. Rubin wrote: > The listings package does not require or force the \begingroup + > \inputencoding{latin1} + \endgroup commands, nor the two blank lines. > The blank lines are purely LyX. These mark a new paragraph. They are not inserted if you ommit a paragraph break after the listings inset. So the lines are correct, AFAICS. But I see now that the \endgroup tag indeed makes a difference. > It seems to me that there has already > been discussion elsewhere of situations in which LyX inserts unwanted > blank lines. This was something different (and is fixed in 1.6; I did not fix it in 1.5.x, because it might have unwanted side effects) > As far as the input encoding goes, my guess is that > whoever coded the listings support put this in to prevent the user from > accidentally blowing up the package by using a multibyte encoding. > However, as I mentioned above, the package specifically provides an > escape-to-LaTeX mechanism that allows the user to insert text from other > encodings. This presumably would be blocked by the current LyX > implementation (although I'm not the person to test this, since I'm > blissfully ignorant about non-Latin encodings). The problem is that the listings package cannot deal with unicode or any other multibyte encoding (such as some CJK encodings); the listings parser simply is not ready for that, and unfortunately, it's also not maintained currently. Heiko Oberdiek has written a listingsutf8 extension package, but this only fixes the encoding of lstinputlisting). So the reason for the brute-force encoding switch is a fundamental limitation of the listings package. However, I agree the encoding switch is a hack, and we should at least limit the hack to the case where it is needed, i.e. only switch to latin1 if we actually are in a multibyte encoding. > So fundamentally, I think, it's a question of whether protecting the > user from himself on the encoding issue is worth the price. Suggestions are welcome. But they have to work in any encoding. Jürgen
Re: Inconsistent indentation behaviour after LyX-Code and Program Listing Inset
Jürgen Spitzmüller wrote: Paul A. Rubin wrote: I think it's a consequence of LyX setting the input encoding to latin1 (and surrounding the listing with \begingroup ... \endgroup). No, without those, it shows exactly the same behaviour. Not if you also take out the two blank lines that LyX inserts after \endgroup. Still, am I right that forcing latin1 in the listings environment means that you cannot in fact put, say, CJK characters in a comment that escapes to LaTeX? Seems a bit restrictive. Maybe you should open a bugzilla entry about this. A bugzilla report does not strike me very sensible, since this is not a LyX bug, but a listings bug/restriction. The listings package does not require or force the \begingroup + \inputencoding{latin1} + \endgroup commands, nor the two blank lines. The blank lines are purely LyX. It seems to me that there has already been discussion elsewhere of situations in which LyX inserts unwanted blank lines. As far as the input encoding goes, my guess is that whoever coded the listings support put this in to prevent the user from accidentally blowing up the package by using a multibyte encoding. However, as I mentioned above, the package specifically provides an escape-to-LaTeX mechanism that allows the user to insert text from other encodings. This presumably would be blocked by the current LyX implementation (although I'm not the person to test this, since I'm blissfully ignorant about non-Latin encodings). One last thing. The listings package allows you to specify an escape character that delimits strings that should be passed directly to LaTeX. So, taking an excerpt from the .tex version of Álvaro's sample file, ... \begin{lstlisting}[escapechar=`] `\inputencoding{latin1}` This is a lstlisting code added through an inset. LyX surrounds this with\begingroup and\endgroup, and creates a new paragraph after this one. \end{lstlisting} This is indented.\LyX{}-Code behaves differently than code listing insets.Isn't this a contradiction to the User Guide? ... seems to work. I can't test whether the encoding limitation is being enforced, but the \inputencoding command is not printed in the listing, and the following line is not indented. The problem with this approach is that different users will want different escape characters. So fundamentally, I think, it's a question of whether protecting the user from himself on the encoding issue is worth the price. /Paul
Re: Inconsistent indentation behaviour after LyX-Code and Program Listing Inset
Paul A. Rubin wrote: > I think it's a consequence of LyX setting the input encoding to latin1 > (and surrounding the listing with \begingroup ... \endgroup). No, without those, it shows exactly the same behaviour. > Still, am I right that forcing latin1 > in the listings environment means that you cannot in fact put, say, CJK > characters in a comment that escapes to LaTeX? Seems a bit restrictive. > > Maybe you should open a bugzilla entry about this. A bugzilla report does not strike me very sensible, since this is not a LyX bug, but a listings bug/restriction. Jürgen
Re: Inconsistent indentation behaviour after LyX-Code and Program Listing Inset
Álvaro Manuel Recio Pérez wrote: Program listing insets doesn't follow the same rules. Paragraphs after listing insets are indented even if they are conceptually identical to the LyX-Code environment. My questions are: Why does this happen? And, is there a way to globally prevent the indentation of paragraphs following listing insets? I think it's a consequence of LyX setting the input encoding to latin1 (and surrounding the listing with \begingroup ... \endgroup). There's something in the manual for the listings package that says that the package can't cope with multibyte character encodings (other than in comments). Goofy encodings confuse me, so I can sympathize if they confusing the listings package. Still, am I right that forcing latin1 in the listings environment means that you cannot in fact put, say, CJK characters in a comment that escapes to LaTeX? Seems a bit restrictive. Maybe you should open a bugzilla entry about this. /Paul
Inconsistent indentation behaviour after LyX-Code and Program Listing Inset
Hello, First of all, I'm still fairly new to Latex, so please excuse me if this doesn't make sense. I'm using LyX to write a thesis with lots of programming code snippets. I'm using indentation to separate paragraphs and LyX correctly keeps the first paragraph after a title, an enumeration, a figure, etc. not indented. A paragraph after LyX-Code are not indented, and it makes sense because the paragraph can be easily told apart form code. Program listing insets doesn't follow the same rules. Paragraphs after listing insets are indented even if they are conceptually identical to the LyX-Code environment. My questions are: Why does this happen? And, is there a way to globally prevent the indentation of paragraphs following listing insets? I've attached an example showing the different behaviours. Best regards and thanks, Álvaro M. This is the output of "lyx -version": LyX 1.5.5 (Sun, May 11, 2008) Built on May 28 2008, 15:56:07 Configuration Host type:i486-pc-linux-gnu Special build flags: aiksaurus pch warnings use-aspell use-ispell C Compiler: gcc C Compiler LyX flags: C Compiler flags: -Wextra -Wall-g -O2 C++ Compiler: g++ (4.1.2) C++ Compiler LyX flags: C++ Compiler flags: -Wextra -Wall-g -O2 Linker flags: Linker user flags:-Wl,-z,defs -Wl,--as-needed Qt 4 Frontend: Qt 4 version:4.2.1 Packaging:posix LyX binary dir: /usr/bin LyX files dir:/usr/share/lyx The example file: #LyX 1.5.5 created this file. For more info see http://www.lyx.org/ \lyxformat 276 \begin_document \begin_header \textclass article \language english \inputencoding auto \font_roman default \font_sans default \font_typewriter default \font_default_family default \font_sc false \font_osf false \font_sf_scale 100 \font_tt_scale 100 \graphics default \paperfontsize default \papersize default \use_geometry false \use_amsmath 1 \use_esint 1 \cite_engine basic \use_bibtopic false \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language english \papercolumns 1 \papersides 1 \paperpagestyle default \tracking_changes false \output_changes false \author "" \author "" \end_header \begin_body \begin_layout Section LyX-Code vs. code listing insets \end_layout \begin_layout Standard This is the first paragraph. It is not indented as it comes after the section title. \end_layout \begin_layout Standard This is the second paragraph. It is indented so you can distinguish it from the previous one. \end_layout \begin_layout LyX-Code This is LyX-Code. It stands out from the previous paragraphs. \end_layout \begin_layout Standard A paragraph after LyX-Code is not indented. It is just the same as it would come after an enumeration (itemize), for example. \end_layout \begin_layout Standard \begin_inset ERT status open \begin_layout Standard \backslash begin{lstlisting}[language={C++}] \end_layout \begin_layout Standard This is lstlisting added by hand with an ERT. \end_layout \begin_layout Standard It is just as LyX-Code but better. \end_layout \begin_layout Standard \backslash end{lstlisting} \end_layout \begin_layout Standard This is how a paragraph after lstlisting would appear if it would have been dealt with as it is done with LyX-code. It is not indented, as it stands out from the code (really?). \end_layout \end_inset \end_layout \begin_layout Standard \begin_inset listings inline false status open \begin_layout Standard This is a lstlisting code added through an inset. \end_layout \begin_layout Standard LyX surrounds this with \backslash begingroup and \backslash endgroup, \end_layout \begin_layout Standard and creates a new paragraph after this one. \end_layout \end_inset \end_layout \begin_layout Standard This is indented. LyX-Code behaves differently than code listing insets. Isn't this a contradiction to the User Guide? \end_layout \begin_layout Quote Only a paragraph following another paragraph gets indented. \end_layout \end_body \end_document
Re: Error when using ticks in lyx-code or program listing
Rune Schjellerup Philosof wrote: I'm using Lyx 1.5.4 in Windows Vista ("official" installer on top of an installed "unofficial", because pdf thingie didn't work in Vista). When I try to insert ` or ´ in lyx-code or program listing the document won't compile. Actually nothing at all happens when I click any of the button that are supposed to create dvi, pdf or ... Welcome to bug # 4727: http://bugzilla.lyx.org/show_bug.cgi?id=4727. The best workaround I know of is to enter "\`\ \'\ " (without the quotes) in ERT. /Paul
Error when using ticks in lyx-code or program listing
I'm using Lyx 1.5.4 in Windows Vista ("official" installer on top of an installed "unofficial", because pdf thingie didn't work in Vista). When I try to insert ` or ´ in lyx-code or program listing the document won't compile. Actually nothing at all happens when I click any of the button that are supposed to create dvi, pdf or ... -- Rune tick_error.lyx Description: application/lyx
Re: [lyx 1.5.3 ubuntu hardy] No caption using the program listing feature
>Jürgen Spitzmüller: > 1. Insert->Program Listing > 2. Insert->Caption Never ever before noticed this feature ;) But (german) documentation should be updated - i'll post a comment on the doc list. Thanks a lot
Re: [lyx 1.5.3 ubuntu hardy] No caption using the program listing feature
Axel Pospischil wrote: > What am I doing wrong? > How can I get numberd program listings without copying from the > users-guide? 1. Insert->Program Listing 2. Insert->Caption Jürgen
[lyx 1.5.3 ubuntu hardy] No caption using the program listing feature
Hello, i am having some weird behaviour using the program listing environment. Using Lyx 1.5.3 under Ubuntu 8.04. Also tested the debian version 1.5.4 backport) both with the same problem. Also tested on opensuse 10.3 (lyx 1.5.2) with the same result. Looking at the (german) users-guide, i'll find a listing containing a numbered caption and space after it for a description. But when i try to insert a listing via menu->insert->program listing, i only get an __empty__ listing environment __without__ neither a numbered caption nor a space for putting a label. Copying the listing environment out of the users-guide lyx document into another lyx file works fine, the numbering is correct and so on. Inserting another list into the users-guide doesn't work either. What am I doing wrong? How can I get numberd program listings without copying from the users-guide? Greets Axel -- Axel Pospischil Wiesbaden, Germany E-Mail: [EMAIL PROTECTED]
Re: Different program listing styles
On Mon, Mar 17, 2008 at 8:04 AM, Jürgen Spitzmüller <[EMAIL PROTECTED]> wrote: > Dominik Böhm wrote: > > > Please do not use 1.6.0svn for any serious work. It is simply not ready. > > > > I have been using 1.6.0svn since 1,5 months for my diploma thesis and > > it has been working really great, yet. This program listing problem is > > the first "serious" problem that I am experiencing with 1.6.0svn. So, > > I would say for me is it ready, but maybe I am not using all the > > features. > > Nevertheless: It's a development version, and even if it's working rather > well > currently, it might be break and become unusable and eat your docs the next > hour, if some developer is in the mood (or has a bad day). So do not use it > for serious work such as a diploma thesis, unless you really think your > diploma thesis is worthless. I am aware of the fact that there are risks involved using LyX for serious work. But rest assured that my files are safe: I use an SVN-server for my thesis and upload my work to the server twice a day. Thus, I might loose about 4 hours of it at maximum. Further I upload my files each time I update LyX to make sure that apparent bugs don't ruin my work. With other words I am well prepared for the day LyX stops working: I can switch back to my last version of LyX at any time. I know that there might also be changes in the LyX file format. If that happens and I won't be able to adapt my files to the new format, I will still be able to finish my thesis, as my current version works very well and I have to hand it in by the end of March. Due to the time frame stepping back to 1.5.4 is no option for me: there are already too many changes in the file format regarding the layout modules for example. Dominik
Re: Different program listing styles
Dominik Böhm wrote: > > Please do not use 1.6.0svn for any serious work. It is simply not ready. > > I have been using 1.6.0svn since 1,5 months for my diploma thesis and > it has been working really great, yet. This program listing problem is > the first "serious" problem that I am experiencing with 1.6.0svn. So, > I would say for me is it ready, but maybe I am not using all the > features. Nevertheless: It's a development version, and even if it's working rather well currently, it might be break and become unusable and eat your docs the next hour, if some developer is in the mood (or has a bad day). So do not use it for serious work such as a diploma thesis, unless you really think your diploma thesis is worthless. Jürgen
Re: Different program listing styles
> This program listing problem is > the first "serious" problem that I am experiencing with 1.6.0svn. So, > I would say for me is it ready, but maybe I am not using all the > features. Right now, the context dialog is overridden by context menu (a new feature of 1.6.x). This should be fixed soon. > I know how to handle the listings package "by hand" with ERT-insets, > but I would rather like to have some GUI-support :-) I usually insert listings as child document because this allows me to modify them from outside of lyx, and because the space/tab support of the listings inset is not optimal. Maybe you can try this as well. Cheers, Bo
Re: Different program listing styles
On Sun, Mar 16, 2008 at 6:27 PM, Bo Peng <[EMAIL PROTECTED]> wrote: > > Maybe it's a bug in LyX 1.6.0svn: I don't find the "handle" of the > > listing inset. When I right click on it, the popup menu has only one > > option "No action defined!". What am I missing? > > Please do not use 1.6.0svn for any serious work. It is simply not ready. I have been using 1.6.0svn since 1,5 months for my diploma thesis and it has been working really great, yet. This program listing problem is the first "serious" problem that I am experiencing with 1.6.0svn. So, I would say for me is it ready, but maybe I am not using all the features. I know how to handle the listings package "by hand" with ERT-insets, but I would rather like to have some GUI-support :-) Thanks anyways, maybe this feature will be working, soon. If not, I'll switch back to ERT-insets. Dominik
Re: Different program listing styles
> > I hope there is another solution that doing it with an ERT-inset... > > Insert -> Program Listing, In case you do not know, inset->file->child document->listings allows you to insert files (or lines of files), and you can set global listings parameters in document->settings. There are many options for listings and you would better read listings manual if you plan to use listings extensively. Bo
Re: Different program listing styles
> Maybe it's a bug in LyX 1.6.0svn: I don't find the "handle" of the > listing inset. When I right click on it, the popup menu has only one > option "No action defined!". What am I missing? Please do not use 1.6.0svn for any serious work. It is simply not ready. Bo
Re: Different program listing styles
Thanks for your quick answer, Paul. On Sun, Mar 16, 2008 at 5:25 PM, Paul A. Rubin <[EMAIL PROTECTED]> wrote: > Dominik Böhm wrote: > Insert -> Program Listing, then right click the "handle" of the listing > widget. Select your language (Java or XML) from the list on the main > settings tab (lower left). Click the advanced tab and enter any > keyword=value pairs in the box. Note that if you want to use colors, > you need to add \usepackage{xcolor} (or \usepackage{color}?) in the > preamble; the listings widget does not add it automatically. Maybe it's a bug in LyX 1.6.0svn: I don't find the "handle" of the listing inset. When I right click on it, the popup menu has only one option "No action defined!". What am I missing? > > Further I am wondering, why the listing's captions are above the > > listing and not beneath it (as we're used from figures). > > It's the default for the listings package. I guess the author likes his > captions on the top. In the advanced tab, add the option 'captionpos=b' > to move the caption to the bottom. I think this question will be anwered as soon as I can open the listing's settings window. Dominik
Re: Different program listing styles
Dominik Böhm wrote: Hello, I would like to use the program listing inset for Java-Code, XML-Code and some custom code and was wondering, if it's possible to define different styles for it. So, how can I differentiate between a Java-Code listing and an XML-Code listing? The highlighting will be different and maybe I would like to use different options. I hope there is another solution that doing it with an ERT-inset... Insert -> Program Listing, then right click the "handle" of the listing widget. Select your language (Java or XML) from the list on the main settings tab (lower left). Click the advanced tab and enter any keyword=value pairs in the box. Note that if you want to use colors, you need to add \usepackage{xcolor} (or \usepackage{color}?) in the preamble; the listings widget does not add it automatically. Further I am wondering, why the listing's captions are above the listing and not beneath it (as we're used from figures). It's the default for the listings package. I guess the author likes his captions on the top. In the advanced tab, add the option 'captionpos=b' to move the caption to the bottom. /Paul
Different program listing styles
Hello, I would like to use the program listing inset for Java-Code, XML-Code and some custom code and was wondering, if it's possible to define different styles for it. So, how can I differentiate between a Java-Code listing and an XML-Code listing? The highlighting will be different and maybe I would like to use different options. I hope there is another solution that doing it with an ERT-inset... Further I am wondering, why the listing's captions are above the listing and not beneath it (as we're used from figures). Best regards and thanks Dominik
Re: Program Listing Parameters
Siegfried MEUNIER-GUTTIN-CLUZEL <[EMAIL PROTECTED]> writes: > > The documentation of this package is very well done : see at > > http://www.pvv.ntnu.no/~berland/latex/docs/listings.pdf > > Siegfried Hi Siegfried. I defined the color 'lightblue' and then used backgroundcolor={\color {lightblue}} and this worked fine. Thanks for your help. Graham
Re: Program Listing Parameters
You need the color LaTeX package. Siegfried.
Re: Program Listing Parameters
Graham Griffiths <[EMAIL PROTECTED]> writes: > > The program listing feature is very useful and I wonder if there is some > documentation available showing how to set parameters under the advanced tab. I have manged to eliminate the error message by including a parameter statement of the form: fillcolor=\color{red} However, the colour does not show up when rendered as a pdf document. Do I need to load a LaTex package? Any help appreciated.