RE: LyX v2.4.0 RC4 -> Unicode in Program Listing (again...)

2024-04-17 Thread Bernt Lie via lyx-users
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...)

2024-04-17 Thread José Matos
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...)

2024-04-17 Thread Bernt Lie via lyx-users
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...)

2024-04-16 Thread Bernt Lie via lyx-users
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

2024-02-15 Thread Trevor Jenkins
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.

2019-02-11 Thread Paul A. Rubin

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.

2019-02-11 Thread Bernt Lie
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?

2019-01-11 Thread Bernt Lie
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?

2019-01-11 Thread Dr Eberhard Lisse
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?

2019-01-09 Thread Bernt Lie
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 "$"?

2018-11-08 Thread Bernt Lie
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...

2016-09-25 Thread Bernt Lie
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 
<bernt@hit.no<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...

2016-09-24 Thread Scott Kostyshak
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...

2016-09-24 Thread Joel Kulesza
Edit -> Paste Special -> Experiment

On Sat, Sep 24, 2016 at 8:32 AM, Bernt Lie <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
>


Ascii file import into Program Listing...

2016-09-24 Thread Bernt Lie
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

2012-06-04 Thread Leandro Mattioli
Worked like a charm with LyX / TeXLive 2011.

Thanks!






Re: program listing of child documents with accents

2012-06-04 Thread Leandro Mattioli
Worked like a charm with LyX / TeXLive 2011.

Thanks!






Re: program listing of child documents with accents

2012-06-04 Thread Leandro Mattioli
Worked like a charm with LyX / TeXLive 2011.

Thanks!






Lyx - Program Listing - default settings cross-reference

2012-04-01 Thread Rainer Koelle
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: Lyx - Program Listing - default settings cross-reference

2012-04-01 Thread Paul A . Rubin
Rainer Koelle rqkoelle at 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

2012-04-01 Thread Rainer Koelle
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: Lyx - Program Listing - default settings cross-reference

2012-04-01 Thread Paul A . Rubin
Rainer Koelle rqkoelle at 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

2012-04-01 Thread Rainer Koelle
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: Lyx - Program Listing - default settings & cross-reference

2012-04-01 Thread Paul A . Rubin
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





Re: program listing of child documents with accents

2012-03-14 Thread Helge Hafting

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

2012-03-14 Thread Helge Hafting

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

2012-03-14 Thread Helge Hafting

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

2012-02-13 Thread Ricardo
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.

lyx source code

 % 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}



utf8 saved file content:  
Child document. Stored UTF8.
Áéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèá
éíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéí


Re: program listing of child documents with accents

2012-02-13 Thread Ricardo
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.

lyx source code

 % 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}



utf8 saved file content:  
Child document. Stored UTF8.
Áéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèá
éíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéí


Re: program listing of child documents with accents

2012-02-13 Thread Ricardo
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.
Áéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèá
éíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéíóúàèáéí


program listing of child documents with accents

2012-02-12 Thread Ricardo
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: program listing of child documents with accents

2012-02-12 Thread Richard Heck

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

2012-02-12 Thread Ricardo
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: program listing of child documents with accents

2012-02-12 Thread Richard Heck

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

2012-02-12 Thread Ricardo
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: program listing of child documents with accents

2012-02-12 Thread Richard Heck

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



Re: An inline preview of a program listing from an external file

2012-02-08 Thread Marcin Zajączkowski
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 HelpEmbedde 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

2012-02-08 Thread Marcin Zajączkowski
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 HelpEmbedde 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

2012-02-08 Thread Marcin Zajączkowski
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

2012-02-07 Thread Guenter Milde
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 HelpEmbedde Objects and try writing one.

Günter



Re: An inline preview of a program listing from an external file

2012-02-07 Thread Guenter Milde
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 HelpEmbedde Objects and try writing one.

Günter



Re: An inline preview of a program listing from an external file

2012-02-07 Thread Guenter Milde
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

2012-02-06 Thread Guenter Milde
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

2012-02-06 Thread Guenter Milde
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

2012-02-06 Thread Guenter Milde
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



EOL characters removed when pasting a source code into a program listing section

2012-02-02 Thread Marcin Zajączkowski
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: EOL characters removed when pasting a source code into a program listing section

2012-02-02 Thread Paul A . Rubin
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



Re: EOL characters removed when pasting a source code into a program listing section

2012-02-02 Thread Rich Shepard

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

2012-02-02 Thread Guenter Milde
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:

  EditPaste SpecialSelection
  
and  

  EditPaste SpecialSelection, Join Lines
  
where the first variant keeps line ends and the second lets paragraphs flow.

Günter  




EOL characters removed when pasting a source code into a program listing section

2012-02-02 Thread Marcin Zajączkowski
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: EOL characters removed when pasting a source code into a program listing section

2012-02-02 Thread Paul A . Rubin
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



Re: EOL characters removed when pasting a source code into a program listing section

2012-02-02 Thread Rich Shepard

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

2012-02-02 Thread Guenter Milde
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:

  EditPaste SpecialSelection
  
and  

  EditPaste SpecialSelection, Join Lines
  
where the first variant keeps line ends and the second lets paragraphs flow.

Günter  




EOL characters removed when pasting a source code into a program listing section

2012-02-02 Thread Marcin Zajączkowski
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: EOL characters removed when pasting a source code into a program listing section

2012-02-02 Thread Paul A . Rubin
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



Re: EOL characters removed when pasting a source code into a program listing section

2012-02-02 Thread Rich Shepard

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

2012-02-02 Thread Guenter Milde
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: Rename algorithm to program listing – How to get my program listings into my article?

2011-02-10 Thread Manveru
2011/1/26 Niko Schwarz niko.schw...@googlemail.com:
 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?

2011-02-10 Thread Manveru
2011/1/26 Niko Schwarz niko.schw...@googlemail.com:
 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?

2011-02-10 Thread Manveru
2011/1/26 Niko Schwarz <niko.schw...@googlemail.com>:
> 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


Rename algorithm to program listing – How to get my program listings into my article?

2011-01-26 Thread 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?

Niko


Re: Rename algorithm to program listing – How to get my program listings into my article?

2011-01-26 Thread Paul Rubin
Niko Schwarz niko.schwarz at 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?

2011-01-26 Thread 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?

Niko


Re: Rename algorithm to program listing – How to get my program listings into my article?

2011-01-26 Thread Paul Rubin
Niko Schwarz niko.schwarz at 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?

2011-01-26 Thread 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?

Niko


Re: Rename "algorithm" to "program listing" – How to get my program listings into my article?

2011-01-26 Thread Paul Rubin
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





math mode in program listing

2011-01-12 Thread Jack Tanner
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: math mode in program listing

2011-01-12 Thread Paul Rubin
Jack Tanner ihok at 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

2011-01-12 Thread Jack Tanner
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: math mode in program listing

2011-01-12 Thread Paul Rubin
Jack Tanner ihok at 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

2011-01-12 Thread Jack Tanner
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: math mode in program listing

2011-01-12 Thread Paul Rubin
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





Insert program listing: all code ends up on one line

2010-11-22 Thread Nikos Chantziaras

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 copypasted the C code inside a program 
listing box (Insert-Program Listing).


However, copypasting 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 copypaste correctly, and is there a way to not 
copypaste at all and use an external *.c file?




Re: Insert program listing: all code ends up on one line

2010-11-22 Thread Vincent van Ravesteijn




So I have two questions at this point:  How do I copypaste correctly, 
and is there a way to not copypaste 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


Re: Insert program listing: all code ends up on one line

2010-11-22 Thread Nikos Chantziaras

On 11/23/2010 12:59 AM, Vincent van Ravesteijn wrote:




So I have two questions at this point: How do I copypaste correctly,
and is there a way to not copypaste 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

2010-11-22 Thread ariestao
On Tue, 23 Nov 2010 00:53:41 +0200, Nikos Chantziaras rea...@arcor.de
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 copypasted the C code inside a program 
 listing box (Insert-Program Listing).
 
 However, copypasting 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 copypaste correctly, and is there a way to not 
 copypaste 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

2010-11-22 Thread Jim Oldfield




- Original Message 
 From: Vincent van Ravesteijn v...@lyx.org
 To: Nikos Chantziaras rea...@arcor.de
 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  copypaste correctly, and 
is there a way to not copypaste 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





Insert program listing: all code ends up on one line

2010-11-22 Thread Nikos Chantziaras

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 copypasted the C code inside a program 
listing box (Insert-Program Listing).


However, copypasting 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 copypaste correctly, and is there a way to not 
copypaste at all and use an external *.c file?




Re: Insert program listing: all code ends up on one line

2010-11-22 Thread Vincent van Ravesteijn




So I have two questions at this point:  How do I copypaste correctly, 
and is there a way to not copypaste 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


Re: Insert program listing: all code ends up on one line

2010-11-22 Thread Nikos Chantziaras

On 11/23/2010 12:59 AM, Vincent van Ravesteijn wrote:




So I have two questions at this point: How do I copypaste correctly,
and is there a way to not copypaste 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

2010-11-22 Thread ariestao
On Tue, 23 Nov 2010 00:53:41 +0200, Nikos Chantziaras rea...@arcor.de
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 copypasted the C code inside a program 
 listing box (Insert-Program Listing).
 
 However, copypasting 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 copypaste correctly, and is there a way to not 
 copypaste 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

2010-11-22 Thread Jim Oldfield




- Original Message 
 From: Vincent van Ravesteijn v...@lyx.org
 To: Nikos Chantziaras rea...@arcor.de
 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  copypaste correctly, and 
is there a way to not copypaste 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





Insert program listing: all code ends up on one line

2010-11-22 Thread Nikos Chantziaras

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 the C code inside a "program 
listing" box (Insert->Program Listing).


However, copy 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 correctly, and is there a way to not 
copy at all and use an external *.c file?




Re: Insert program listing: all code ends up on one line

2010-11-22 Thread Vincent van Ravesteijn




So I have two questions at this point:  How do I copy correctly, 
and is there a way to not copy 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


Re: Insert program listing: all code ends up on one line

2010-11-22 Thread Nikos Chantziaras

On 11/23/2010 12:59 AM, Vincent van Ravesteijn wrote:




So I have two questions at this point: How do I copy correctly,
and is there a way to not copy 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

2010-11-22 Thread ariestao
On Tue, 23 Nov 2010 00:53:41 +0200, Nikos Chantziaras <rea...@arcor.de>
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 the C code inside a "program 
> listing" box (Insert->Program Listing).
> 
> However, copy 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 correctly, and is there a way to not 
> copy 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

2010-11-22 Thread Jim Oldfield




- Original Message 
> From: Vincent van Ravesteijn <v...@lyx.org>
> To: Nikos Chantziaras <rea...@arcor.de>
> 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 correctly, and 
>is there a way to not copy 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





program listing justification

2010-10-01 Thread Jack Tanner
Is there perchance a global setting (or at least a per-document) to make 
all program listing insets be left-justified?


program listing justification

2010-10-01 Thread Jack Tanner
Is there perchance a global setting (or at least a per-document) to make 
all program listing insets be left-justified?


program listing justification

2010-10-01 Thread Jack Tanner
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

2009-12-05 Thread Luke Venediger
On Fri, Dec 4, 2009 at 6:18 PM, Paul A. Rubin ru...@msu.edu 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

2009-12-05 Thread Luke Venediger
On Fri, Dec 4, 2009 at 6:18 PM, Paul A. Rubin ru...@msu.edu 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

2009-12-05 Thread Luke Venediger
On Fri, Dec 4, 2009 at 6:18 PM, Paul A. Rubin <ru...@msu.edu> 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

2009-12-04 Thread Paul A. Rubin

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

2009-12-04 Thread Paul A. Rubin

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

2009-12-04 Thread Paul A. Rubin

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



Marking lines in a Program Listing in Lyx

2009-12-03 Thread Luke Venediger
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/


Marking lines in a Program Listing in Lyx

2009-12-03 Thread Luke Venediger
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/


Re: Marking lines in a Program Listing in Lyx

2009-12-03 Thread Steve Litt
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

2009-12-03 Thread Luke Venediger
Hi Steve,

Thanks very much, I'll give it a try.

Cheers,
Luke

On Thu, Dec 3, 2009 at 4:06 PM, Steve Litt sl...@troubleshooters.comwrote:

 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




  1   2   3   >