Re: math macros via LaTex preamble

2012-07-21 Thread Allen Barker

On 07/20/2012 03:40 AM, Guenter Milde wrote:

Also, math-macros are document specific - defining a math-macro in one
document does not make it available in other ones. This is why my
documents include a file of commonly used math macros -- just like I
\input a file with commonly used preamble definitions in my LaTeX
documents.


Could you elaborate on the best way to include a file of
commonly-used math macros, in a way which is compatible
with Lyx?  I tend to use a lot of \DeclareMathOperator
commands in the preamble, for example.

I've avoided the Lyx macro stuff so far because it has
seemed to me to be *too* document specific.  I don't know
if it actually is, but I haven't found that information in
the preliminary searches I've conducted.

Any general comments on the best way to organize and
include preamble material in a way which is compatible
with Lyx would also be appreciated.




Re: math macros via LaTex preamble

2012-07-21 Thread Allen Barker

On 07/20/2012 03:40 AM, Guenter Milde wrote:

Also, math-macros are document specific - defining a math-macro in one
document does not make it available in other ones. This is why my
documents include a file of commonly used math macros -- just like I
\input a file with commonly used preamble definitions in my LaTeX
documents.


Could you elaborate on the best way to include a file of
commonly-used math macros, in a way which is compatible
with Lyx?  I tend to use a lot of \DeclareMathOperator
commands in the preamble, for example.

I've avoided the Lyx macro stuff so far because it has
seemed to me to be *too* document specific.  I don't know
if it actually is, but I haven't found that information in
the preliminary searches I've conducted.

Any general comments on the best way to organize and
include preamble material in a way which is compatible
with Lyx would also be appreciated.




Re: math macros via LaTex preamble

2012-07-21 Thread Allen Barker

On 07/20/2012 03:40 AM, Guenter Milde wrote:

Also, math-macros are document specific - defining a math-macro in one
document does not make it available in other ones. This is why my
documents include a file of commonly used math macros -- just like I
\input a file with commonly used preamble definitions in my LaTeX
documents.


Could you elaborate on the best way to include a file of
commonly-used math macros, in a way which is compatible
with Lyx?  I tend to use a lot of \DeclareMathOperator
commands in the preamble, for example.

I've avoided the Lyx macro stuff so far because it has
seemed to me to be *too* document specific.  I don't know
if it actually is, but I haven't found that information in
the preliminary searches I've conducted.

Any general comments on the "best" way to organize and
include preamble material in a way which is compatible
with Lyx would also be appreciated.




Re: Help with command sequence

2012-06-22 Thread Allen Barker

On 06/21/2012 03:46 PM, Fabio Sobral wrote:

Hello,

I want to create a shortcut for a minipage with a drop shadw box and line width.
After reading the page about command sequences on the wiki
(http://wiki.lyx.org/Tips/CommandSequences) I down to this:
command-sequence box-insert Shadowbox

I just need to set the box width, from columnwidth to linewidth, is this 
possible?


Cheers,

Fabio.


Messing around with lyx -dbg action and inset-modify, I get:

command-sequence box-insert Shadowbox; escape; word-backward; inset-modify box Box Shadowbox 
position t hor_pos c has_inner_box 1 inner_pos t use_parbox 0 use_makebox 0 width 100line% 
special none height 1in height_special totalheight


Just passing the arguments to box-insert doesn't seem to work.
Most (if not all) of the arguments seem to be required for the
resulting box to be the same as the usual box inserted from
the menu.  You can add a char-right to the end of the sequence
(after another semicolon) to move the cursor back inside the box,
instead of having it end up just before the box.










Re: Help with command sequence

2012-06-22 Thread Allen Barker

On 06/22/2012 04:09 PM, Allen Barker wrote:

On 06/21/2012 03:46 PM, Fabio Sobral wrote:

Hello,

I want to create a shortcut for a minipage with a drop shadw box and line width.
After reading the page about command sequences on the wiki
(http://wiki.lyx.org/Tips/CommandSequences) I down to this:
command-sequence box-insert Shadowbox

I just need to set the box width, from columnwidth to linewidth, is this 
possible?


Cheers,

Fabio.


Messing around with lyx -dbg action and inset-modify, I get:

command-sequence box-insert Shadowbox; escape; word-backward; inset-modify box 
Box Shadowbox
position t hor_pos c has_inner_box 1 inner_pos t use_parbox 0 use_makebox 0 width 
100line%
special none height 1in height_special totalheight

Just passing the arguments to box-insert doesn't seem to work.
Most (if not all) of the arguments seem to be required for the
resulting box to be the same as the usual box inserted from
the menu.  You can add a char-right to the end of the sequence
(after another semicolon) to move the cursor back inside the box,
instead of having it end up just before the box.


On further messing around, eliminating the escape command
in the sequence above seems to work better for inserting
nested boxes; it works about the same otherwise.

(This is because when text is selected before the insert it
is placed inside the box and the cursor ends up just after
the box.  When no text is selected the cursor ends up inside
the box.  The word-backward command sends the cursor to
before the box in both cases.)







Re: Help with command sequence

2012-06-22 Thread Allen Barker

On 06/21/2012 03:46 PM, Fabio Sobral wrote:

Hello,

I want to create a shortcut for a minipage with a drop shadw box and line width.
After reading the page about command sequences on the wiki
(http://wiki.lyx.org/Tips/CommandSequences) I down to this:
command-sequence box-insert Shadowbox

I just need to set the box width, from columnwidth to linewidth, is this 
possible?


Cheers,

Fabio.


Messing around with lyx -dbg action and inset-modify, I get:

command-sequence box-insert Shadowbox; escape; word-backward; inset-modify box Box Shadowbox 
position t hor_pos c has_inner_box 1 inner_pos t use_parbox 0 use_makebox 0 width 100line% 
special none height 1in height_special totalheight


Just passing the arguments to box-insert doesn't seem to work.
Most (if not all) of the arguments seem to be required for the
resulting box to be the same as the usual box inserted from
the menu.  You can add a char-right to the end of the sequence
(after another semicolon) to move the cursor back inside the box,
instead of having it end up just before the box.










Re: Help with command sequence

2012-06-22 Thread Allen Barker

On 06/22/2012 04:09 PM, Allen Barker wrote:

On 06/21/2012 03:46 PM, Fabio Sobral wrote:

Hello,

I want to create a shortcut for a minipage with a drop shadw box and line width.
After reading the page about command sequences on the wiki
(http://wiki.lyx.org/Tips/CommandSequences) I down to this:
command-sequence box-insert Shadowbox

I just need to set the box width, from columnwidth to linewidth, is this 
possible?


Cheers,

Fabio.


Messing around with lyx -dbg action and inset-modify, I get:

command-sequence box-insert Shadowbox; escape; word-backward; inset-modify box 
Box Shadowbox
position t hor_pos c has_inner_box 1 inner_pos t use_parbox 0 use_makebox 0 width 
100line%
special none height 1in height_special totalheight

Just passing the arguments to box-insert doesn't seem to work.
Most (if not all) of the arguments seem to be required for the
resulting box to be the same as the usual box inserted from
the menu.  You can add a char-right to the end of the sequence
(after another semicolon) to move the cursor back inside the box,
instead of having it end up just before the box.


On further messing around, eliminating the escape command
in the sequence above seems to work better for inserting
nested boxes; it works about the same otherwise.

(This is because when text is selected before the insert it
is placed inside the box and the cursor ends up just after
the box.  When no text is selected the cursor ends up inside
the box.  The word-backward command sends the cursor to
before the box in both cases.)







Re: Help with command sequence

2012-06-22 Thread Allen Barker

On 06/21/2012 03:46 PM, Fabio Sobral wrote:

Hello,

I want to create a shortcut for a minipage with a drop shadw box and line width.
After reading the page about command sequences on the wiki
(http://wiki.lyx.org/Tips/CommandSequences) I down to this:
"command-sequence box-insert Shadowbox"

I just need to set the box width, from columnwidth to linewidth, is this 
possible?


Cheers,

Fabio.


Messing around with "lyx -dbg action" and inset-modify, I get:

command-sequence box-insert Shadowbox; escape; word-backward; inset-modify box Box Shadowbox 
position "t" hor_pos "c" has_inner_box 1 inner_pos "t" use_parbox 0 use_makebox 0 width "100line%" 
special "none" height "1in" height_special "totalheight"


Just passing the arguments to box-insert doesn't seem to work.
Most (if not all) of the arguments seem to be required for the
resulting box to be the same as the usual box inserted from
the menu.  You can add a char-right to the end of the sequence
(after another semicolon) to move the cursor back inside the box,
instead of having it end up just before the box.










Re: Help with command sequence

2012-06-22 Thread Allen Barker

On 06/22/2012 04:09 PM, Allen Barker wrote:

On 06/21/2012 03:46 PM, Fabio Sobral wrote:

Hello,

I want to create a shortcut for a minipage with a drop shadw box and line width.
After reading the page about command sequences on the wiki
(http://wiki.lyx.org/Tips/CommandSequences) I down to this:
"command-sequence box-insert Shadowbox"

I just need to set the box width, from columnwidth to linewidth, is this 
possible?


Cheers,

Fabio.


Messing around with "lyx -dbg action" and inset-modify, I get:

command-sequence box-insert Shadowbox; escape; word-backward; inset-modify box 
Box Shadowbox
position "t" hor_pos "c" has_inner_box 1 inner_pos "t" use_parbox 0 use_makebox 0 width 
"100line%"
special "none" height "1in" height_special "totalheight"

Just passing the arguments to box-insert doesn't seem to work.
Most (if not all) of the arguments seem to be required for the
resulting box to be the same as the usual box inserted from
the menu.  You can add a char-right to the end of the sequence
(after another semicolon) to move the cursor back inside the box,
instead of having it end up just before the box.


On further messing around, eliminating the "escape" command
in the sequence above seems to work better for inserting
nested boxes; it works about the same otherwise.

(This is because when text is selected before the insert it
is placed inside the box and the cursor ends up just after
the box.  When no text is selected the cursor ends up inside
the box.  The word-backward command sends the cursor to
before the box in both cases.)







Re: How to get rid of excessive vertical whitespace

2012-06-16 Thread Allen Barker

On 06/16/2012 03:53 PM, Roger House wrote:

I'm using Lyx for the first time and find it, by and large, quite nice.
However, I've run into a situation where Lyx's automatic vertical layout
is creating ugly output.  Example:

   input
 text
 small figure
 caption
 text
 large figure (taking an entire page)

   output
 PAGE BREAK
 text
 small figure
 LOTS OF VERTICAL WHITESPACE
 caption
 LOTS OF VERTICAL WHITESPACE
 text
 PAGE BREAK
 large figure (taking an entire page)

I want a page break before the large figure, so that works fine. However the
vertical whitespace is really unacceptable.  I understand that the algorithm
is trying to spread things out uniformly in the vertical direction, but in
this case, I would like all the vertical whitespace to go away and just let
the printed portion of the page stop wherever it stops.  (Also, the whitespace
between the figure and the caption just seems plain wrong.  I have the caption
marked Definitely here, but my idea of here does not seem to agree with
the way it works.)

I would greatly appreciate any advice on how to prevent the layout shown
above.


If \flushbottom is set it might help to put \raggedbottom in an
ERT TeX box before the parts which space excessively.  You can
then turn \flushbottom back on afterwards, if desired, in another
ERT inset.








Re: How to get rid of excessive vertical whitespace

2012-06-16 Thread Allen Barker

On 06/16/2012 03:53 PM, Roger House wrote:

I'm using Lyx for the first time and find it, by and large, quite nice.
However, I've run into a situation where Lyx's automatic vertical layout
is creating ugly output.  Example:

   input
 text
 small figure
 caption
 text
 large figure (taking an entire page)

   output
 PAGE BREAK
 text
 small figure
 LOTS OF VERTICAL WHITESPACE
 caption
 LOTS OF VERTICAL WHITESPACE
 text
 PAGE BREAK
 large figure (taking an entire page)

I want a page break before the large figure, so that works fine. However the
vertical whitespace is really unacceptable.  I understand that the algorithm
is trying to spread things out uniformly in the vertical direction, but in
this case, I would like all the vertical whitespace to go away and just let
the printed portion of the page stop wherever it stops.  (Also, the whitespace
between the figure and the caption just seems plain wrong.  I have the caption
marked Definitely here, but my idea of here does not seem to agree with
the way it works.)

I would greatly appreciate any advice on how to prevent the layout shown
above.


If \flushbottom is set it might help to put \raggedbottom in an
ERT TeX box before the parts which space excessively.  You can
then turn \flushbottom back on afterwards, if desired, in another
ERT inset.








Re: How to get rid of excessive vertical whitespace

2012-06-16 Thread Allen Barker

On 06/16/2012 03:53 PM, Roger House wrote:

I'm using Lyx for the first time and find it, by and large, quite nice.
However, I've run into a situation where Lyx's automatic vertical layout
is creating ugly output.  Example:

   input
 text
 small figure
 caption
 text
 large figure (taking an entire page)

   output
 PAGE BREAK
 text
 small figure
 LOTS OF VERTICAL WHITESPACE
 caption
 LOTS OF VERTICAL WHITESPACE
 text
 PAGE BREAK
 large figure (taking an entire page)

I want a page break before the large figure, so that works fine. However the
vertical whitespace is really unacceptable.  I understand that the algorithm
is trying to spread things out uniformly in the vertical direction, but in
this case, I would like all the vertical whitespace to go away and just let
the printed portion of the page stop wherever it stops.  (Also, the whitespace
between the figure and the caption just seems plain wrong.  I have the caption
marked "Definitely here", but my idea of "here" does not seem to agree with
the way it works.)

I would greatly appreciate any advice on how to prevent the layout shown
above.


If \flushbottom is set it might help to put \raggedbottom in an
ERT TeX box before the parts which space excessively.  You can
then turn \flushbottom back on afterwards, if desired, in another
ERT inset.








Re: I'm certain it has been discussed here previously..............

2012-06-04 Thread Allen Barker

On 06/03/2012 05:38 AM, Charlie wrote:


I'm certain it's been discussed here before, but I can't find a
reference to it.

The way to stop a URL as an insert URL from running out over the
margins into infinity. This happens in various document classes.

The first line of the Insert URL has the right idea, but the second one
doesn't stop at any margin.

I know it can be done easily without using the insert URL application,
but then the URL can't just be clicked on in the .pdf version to take
the reader to the location. Instead it needs to be copied and pasted
into a browser address bar.

I think it should be possible to show the URL in a different way, even
if it's just a link to the correct page.

Just thought I would ask if someone can point me to the location of the
discussion.


There's a good discussion on the page
http://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url

The solution to just add

\renewcommand{\UrlBreaks}{\do\/\do\a\do\b\do\c\do\d\do\e\do\f\do\g
\do\h\do\i\do\j\do\k\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t
\do\u\do\v\do\w\do\x\do\y\do\z\do\A\do\B\do\C\do\D\do\E\do\F\do\G
\do\H\do\I\do\J\do\K\do\L\do\M\do\N\do\O\do\P\do\Q\do\R\do\S\do\T
\do\U\do\V\do\W\do\X\do\Y\do\Z\do\0\do\1\do\2\do\3\do\4\do\5\do\6
\do\7\do\8\do\9\do\_\do\%\do\\do\.\do\?}

to the preamble seems to work for me with pdfLatex, but not with
Postscript.  It lets Latex do a line break after a forward slash or
any alphabetic character.  I also added numbers and some punctuation
symbols, though a few are probably superfluous.  (Any character which
is not on the list but is in the URL seems to make the line breaks
overhang just slightly, by a character.)  The only downside seems to
be that the breaks are placed arbitrarily in the URL.

A different option would be to use \href directly in an ERT:

\def\ab{\allowbreak}
\href{http://longURL.com/thisIsALongStringWhichCanBreakBetweenWords}
{\texttt{http://longURL.com/this\ab Is\ab A\ab Long\ab String\ab
Which\ab Can\ab Break\ab Between\ab Words}}

Note that this allows breaks wherever the \ab is.  It also allows
for the text of the link to be different from the URL itself, so
you could just substitute some descriptive phrase in place of the
full URL in the second argument.  (Without \texttt it will be in
the same font as the surrounding text, just like a hyperlink.)
In pdfLatex the links are clickable, but even in Postscript they
seem to print and line-break OK.  Unfortunately, the Latex
\allowbreak command cannot be entered from the Insert  Hyperlink
dialog.







Re: I'm certain it has been discussed here previously..............

2012-06-04 Thread Allen Barker

On 06/03/2012 05:38 AM, Charlie wrote:


I'm certain it's been discussed here before, but I can't find a
reference to it.

The way to stop a URL as an insert URL from running out over the
margins into infinity. This happens in various document classes.

The first line of the Insert URL has the right idea, but the second one
doesn't stop at any margin.

I know it can be done easily without using the insert URL application,
but then the URL can't just be clicked on in the .pdf version to take
the reader to the location. Instead it needs to be copied and pasted
into a browser address bar.

I think it should be possible to show the URL in a different way, even
if it's just a link to the correct page.

Just thought I would ask if someone can point me to the location of the
discussion.


There's a good discussion on the page
http://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url

The solution to just add

\renewcommand{\UrlBreaks}{\do\/\do\a\do\b\do\c\do\d\do\e\do\f\do\g
\do\h\do\i\do\j\do\k\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t
\do\u\do\v\do\w\do\x\do\y\do\z\do\A\do\B\do\C\do\D\do\E\do\F\do\G
\do\H\do\I\do\J\do\K\do\L\do\M\do\N\do\O\do\P\do\Q\do\R\do\S\do\T
\do\U\do\V\do\W\do\X\do\Y\do\Z\do\0\do\1\do\2\do\3\do\4\do\5\do\6
\do\7\do\8\do\9\do\_\do\%\do\\do\.\do\?}

to the preamble seems to work for me with pdfLatex, but not with
Postscript.  It lets Latex do a line break after a forward slash or
any alphabetic character.  I also added numbers and some punctuation
symbols, though a few are probably superfluous.  (Any character which
is not on the list but is in the URL seems to make the line breaks
overhang just slightly, by a character.)  The only downside seems to
be that the breaks are placed arbitrarily in the URL.

A different option would be to use \href directly in an ERT:

\def\ab{\allowbreak}
\href{http://longURL.com/thisIsALongStringWhichCanBreakBetweenWords}
{\texttt{http://longURL.com/this\ab Is\ab A\ab Long\ab String\ab
Which\ab Can\ab Break\ab Between\ab Words}}

Note that this allows breaks wherever the \ab is.  It also allows
for the text of the link to be different from the URL itself, so
you could just substitute some descriptive phrase in place of the
full URL in the second argument.  (Without \texttt it will be in
the same font as the surrounding text, just like a hyperlink.)
In pdfLatex the links are clickable, but even in Postscript they
seem to print and line-break OK.  Unfortunately, the Latex
\allowbreak command cannot be entered from the Insert  Hyperlink
dialog.







Re: I'm certain it has been discussed here previously..............

2012-06-04 Thread Allen Barker

On 06/03/2012 05:38 AM, Charlie wrote:


I'm certain it's been discussed here before, but I can't find a
reference to it.

The way to stop a URL as an "insert URL" from running out over the
margins into infinity. This happens in various document classes.

The first line of the Insert URL has the right idea, but the second one
doesn't stop at any margin.

I know it can be done easily without using the insert URL application,
but then the URL can't just be clicked on in the .pdf version to take
the reader to the location. Instead it needs to be copied and pasted
into a browser address bar.

I think it should be possible to show the URL in a different way, even
if it's just a link to the correct page.

Just thought I would ask if someone can point me to the location of the
discussion.


There's a good discussion on the page
http://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url

The solution to just add

\renewcommand{\UrlBreaks}{\do\/\do\a\do\b\do\c\do\d\do\e\do\f\do\g
\do\h\do\i\do\j\do\k\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t
\do\u\do\v\do\w\do\x\do\y\do\z\do\A\do\B\do\C\do\D\do\E\do\F\do\G
\do\H\do\I\do\J\do\K\do\L\do\M\do\N\do\O\do\P\do\Q\do\R\do\S\do\T
\do\U\do\V\do\W\do\X\do\Y\do\Z\do\0\do\1\do\2\do\3\do\4\do\5\do\6
\do\7\do\8\do\9\do\_\do\%\do\&\do\.\do\?}

to the preamble seems to work for me with pdfLatex, but not with
Postscript.  It lets Latex do a line break after a forward slash or
any alphabetic character.  I also added numbers and some punctuation
symbols, though a few are probably superfluous.  (Any character which
is not on the list but is in the URL seems to make the line breaks
overhang just slightly, by a character.)  The only downside seems to
be that the breaks are placed arbitrarily in the URL.

A different option would be to use \href directly in an ERT:

\def\ab{\allowbreak}
\href{http://longURL.com/thisIsALongStringWhichCanBreakBetweenWords}
{\texttt{http://longURL.com/this\ab Is\ab A\ab Long\ab String\ab
Which\ab Can\ab Break\ab Between\ab Words}}

Note that this allows breaks wherever the \ab is.  It also allows
for the text of the link to be different from the URL itself, so
you could just substitute some descriptive phrase in place of the
full URL in the second argument.  (Without \texttt it will be in
the same font as the surrounding text, just like a hyperlink.)
In pdfLatex the links are clickable, but even in Postscript they
seem to print and line-break OK.  Unfortunately, the Latex
\allowbreak command cannot be entered from the Insert > Hyperlink
dialog.







Re: program to use Lyx as a code-evaluating notebook

2012-05-30 Thread Allen Barker


I've set up a repo on github for the program.

The code:
https://github.com/abarker/lyxNotebook

For a quick overview, see the first section of the documentation:
https://github.com/abarker/lyxNotebook/blob/master/lyxNotebookDocs.pdf




Re: program to use Lyx as a code-evaluating notebook

2012-05-30 Thread Allen Barker

On 05/30/2012 04:06 PM, Pavel Sanda wrote:

Allen Barker wrote:


I've set up a repo on github for the program.


It maight be goo to add note to http://wiki.lyx.org/Tools/Tools
P


Thanks, I've added a note to that list.




Re: program to use Lyx as a code-evaluating notebook

2012-05-30 Thread Allen Barker

On 05/30/2012 05:32 PM, Nico Williams wrote:

On Wed, May 30, 2012 at 11:24 AM, Allen Barkerallen.l.bar...@gmail.com  wrote:

I've set up a repo on github for the program.

The code:
https://github.com/abarker/lyxNotebook

For a quick overview, see the first section of the documentation:
https://github.com/abarker/lyxNotebook/blob/master/lyxNotebookDocs.pdf


I looked at the README and I get it.  This is very much like the
weaver tool, that lets you compile statistics using R right in the LyX
document.  But yours is more generic.  The idea is very cool.  I
second the sentiment that this should be added to the tools wiki page.

Nico

PS: I have no use for this right now, but I'll keep it in mind.  One
use that comes to mind is using this approach to automatically test
code samples in a book, but that would need a way to request that code
be tested but output not included in the document.


The printing of cells of various types can be suppressed
by including a Latex command in the preamble or in an ERT.
To suppress printing of output cells for Python 2, for
example, you would add \lyxNotebookPrintOffOutputPythonTwo.
(The current implementation then uses \let to redefine
those cells to be Verbatim comment blocks.)





Re: program to use Lyx as a code-evaluating notebook

2012-05-30 Thread Allen Barker


I've set up a repo on github for the program.

The code:
https://github.com/abarker/lyxNotebook

For a quick overview, see the first section of the documentation:
https://github.com/abarker/lyxNotebook/blob/master/lyxNotebookDocs.pdf




Re: program to use Lyx as a code-evaluating notebook

2012-05-30 Thread Allen Barker

On 05/30/2012 04:06 PM, Pavel Sanda wrote:

Allen Barker wrote:


I've set up a repo on github for the program.


It maight be goo to add note to http://wiki.lyx.org/Tools/Tools
P


Thanks, I've added a note to that list.




Re: program to use Lyx as a code-evaluating notebook

2012-05-30 Thread Allen Barker

On 05/30/2012 05:32 PM, Nico Williams wrote:

On Wed, May 30, 2012 at 11:24 AM, Allen Barkerallen.l.bar...@gmail.com  wrote:

I've set up a repo on github for the program.

The code:
https://github.com/abarker/lyxNotebook

For a quick overview, see the first section of the documentation:
https://github.com/abarker/lyxNotebook/blob/master/lyxNotebookDocs.pdf


I looked at the README and I get it.  This is very much like the
weaver tool, that lets you compile statistics using R right in the LyX
document.  But yours is more generic.  The idea is very cool.  I
second the sentiment that this should be added to the tools wiki page.

Nico

PS: I have no use for this right now, but I'll keep it in mind.  One
use that comes to mind is using this approach to automatically test
code samples in a book, but that would need a way to request that code
be tested but output not included in the document.


The printing of cells of various types can be suppressed
by including a Latex command in the preamble or in an ERT.
To suppress printing of output cells for Python 2, for
example, you would add \lyxNotebookPrintOffOutputPythonTwo.
(The current implementation then uses \let to redefine
those cells to be Verbatim comment blocks.)





Re: program to use Lyx as a code-evaluating notebook

2012-05-30 Thread Allen Barker


I've set up a repo on github for the program.

The code:
https://github.com/abarker/lyxNotebook

For a quick overview, see the first section of the documentation:
https://github.com/abarker/lyxNotebook/blob/master/lyxNotebookDocs.pdf




Re: program to use Lyx as a code-evaluating notebook

2012-05-30 Thread Allen Barker

On 05/30/2012 04:06 PM, Pavel Sanda wrote:

Allen Barker wrote:


I've set up a repo on github for the program.


It maight be goo to add note to http://wiki.lyx.org/Tools/Tools
P


Thanks, I've added a note to that list.




Re: program to use Lyx as a code-evaluating notebook

2012-05-30 Thread Allen Barker

On 05/30/2012 05:32 PM, Nico Williams wrote:

On Wed, May 30, 2012 at 11:24 AM, Allen Barker<allen.l.bar...@gmail.com>  wrote:

I've set up a repo on github for the program.

The code:
https://github.com/abarker/lyxNotebook

For a quick overview, see the first section of the documentation:
https://github.com/abarker/lyxNotebook/blob/master/lyxNotebookDocs.pdf


I looked at the README and I get it.  This is very much like the
weaver tool, that lets you compile statistics using R right in the LyX
document.  But yours is more generic.  The idea is very cool.  I
second the sentiment that this should be added to the tools wiki page.

Nico

PS: I have no use for this right now, but I'll keep it in mind.  One
use that comes to mind is using this approach to automatically test
code samples in a book, but that would need a way to request that code
be tested but output not included in the document.


The printing of cells of various types can be suppressed
by including a Latex command in the preamble or in an ERT.
To suppress printing of output cells for Python 2, for
example, you would add \lyxNotebookPrintOffOutputPythonTwo.
(The current implementation then uses \let to redefine
those cells to be Verbatim comment blocks.)





Re: program to use Lyx as a code-evaluating notebook

2012-05-29 Thread Allen Barker

On 05/28/2012 09:34 AM, Richard Heck wrote:

On 05/27/2012 09:56 PM, Allen Barker wrote:


The program is currently ~800K tarred and zipped,
including documentation. If anyone here is interested
in trying it out I can send copies out by email (unless
someone suggests a better way to distribute copies at
this stage).


If you're at all serious about this program, then I'd suggest
you create a git repo for it somewhere like gitorious, and
then people can have easy access, as well as follow the
changes you're making. List it as pre-alpha or whatever,
and people know what they're getting.


OK, thanks.  I'll look into setting up a git repo somewhere
and re-post when I get things set up.





Re: program to use Lyx as a code-evaluating notebook

2012-05-29 Thread Allen Barker

On 05/29/2012 03:29 AM, Guenter Milde wrote:

On 2012-05-28, Allen Barker wrote:


I've written a Python program which I'm calling
Lyx Notebook.  It interacts with Lyx (via the Lyx
server) to allow it to be used as a code-evaluating
notebook (similar to Mathematica notebooks or the
Sage notebook).  It's still at an early stage, but
I already find it useful.


Sounds interesting.

I wonder whether the project might gain from the PyClient
Python package that provides a pythonic interface to LyX.
http://wiki.lyx.org/Tools/PyClient


That package might have been useful.  I think I came
across that page, but I wasn't sure if the package was
still operational since it hadn't been updated for a
few years.  Since I was playing around with the Lyx server
pipes anyway, I ended up just implementing things from
scratch.




Re: program to use Lyx as a code-evaluating notebook

2012-05-29 Thread Allen Barker

On 05/28/2012 09:34 AM, Richard Heck wrote:

On 05/27/2012 09:56 PM, Allen Barker wrote:


The program is currently ~800K tarred and zipped,
including documentation. If anyone here is interested
in trying it out I can send copies out by email (unless
someone suggests a better way to distribute copies at
this stage).


If you're at all serious about this program, then I'd suggest
you create a git repo for it somewhere like gitorious, and
then people can have easy access, as well as follow the
changes you're making. List it as pre-alpha or whatever,
and people know what they're getting.


OK, thanks.  I'll look into setting up a git repo somewhere
and re-post when I get things set up.





Re: program to use Lyx as a code-evaluating notebook

2012-05-29 Thread Allen Barker

On 05/29/2012 03:29 AM, Guenter Milde wrote:

On 2012-05-28, Allen Barker wrote:


I've written a Python program which I'm calling
Lyx Notebook.  It interacts with Lyx (via the Lyx
server) to allow it to be used as a code-evaluating
notebook (similar to Mathematica notebooks or the
Sage notebook).  It's still at an early stage, but
I already find it useful.


Sounds interesting.

I wonder whether the project might gain from the PyClient
Python package that provides a pythonic interface to LyX.
http://wiki.lyx.org/Tools/PyClient


That package might have been useful.  I think I came
across that page, but I wasn't sure if the package was
still operational since it hadn't been updated for a
few years.  Since I was playing around with the Lyx server
pipes anyway, I ended up just implementing things from
scratch.




Re: program to use Lyx as a code-evaluating notebook

2012-05-29 Thread Allen Barker

On 05/28/2012 09:34 AM, Richard Heck wrote:

On 05/27/2012 09:56 PM, Allen Barker wrote:


The program is currently ~800K tarred and zipped,
including documentation. If anyone here is interested
in trying it out I can send copies out by email (unless
someone suggests a better way to distribute copies at
this stage).


If you're at all serious about this program, then I'd suggest
you create a git repo for it somewhere like gitorious, and
then people can have easy access, as well as follow the
changes you're making. List it as pre-alpha or whatever,
and people know what they're getting.


OK, thanks.  I'll look into setting up a git repo somewhere
and re-post when I get things set up.





Re: program to use Lyx as a code-evaluating notebook

2012-05-29 Thread Allen Barker

On 05/29/2012 03:29 AM, Guenter Milde wrote:

On 2012-05-28, Allen Barker wrote:


I've written a Python program which I'm calling
Lyx Notebook.  It interacts with Lyx (via the Lyx
server) to allow it to be used as a code-evaluating
notebook (similar to Mathematica notebooks or the
Sage notebook).  It's still at an early stage, but
I already find it useful.


Sounds interesting.

I wonder whether the project might gain from the PyClient
Python package that provides a "pythonic" interface to LyX.
http://wiki.lyx.org/Tools/PyClient


That package might have been useful.  I think I came
across that page, but I wasn't sure if the package was
still operational since it hadn't been updated for a
few years.  Since I was playing around with the Lyx server
pipes anyway, I ended up just implementing things from
scratch.




program to use Lyx as a code-evaluating notebook

2012-05-27 Thread Allen Barker


I've written a Python program which I'm calling
Lyx Notebook.  It interacts with Lyx (via the Lyx
server) to allow it to be used as a code-evaluating
notebook (similar to Mathematica notebooks or the
Sage notebook).  It's still at an early stage, but
I already find it useful.

It only works with interactive, interpreted languages.
The currently-supported languages are Python 2,
Python 3, Sage, Scala, and R.  There are custom insets
for code cells and output cells.  When a cell is
evaluated the output is sent to the output cell.  The
program keeps interpreter processes running, maintaining
their state.  The Listings package is used to highlight
the code in the code cells in the Latex-formatted
printable output.

I still need to use the program myself for a while to
find more bugs, etc.  It only works on Linux systems,
and has only been tested on Fedora 15 with Lyx 2.0.3.
Most of the testing has been with Python 2 code cells.
There may well be portability problems, even to other
Linux distributions, but hopefully not serious ones.

At this point it is not ready for release to general
users.  Some more experienced users (like those on this
list) might, however, find it useful and/or want to try
it out.  Any comments, suggestions, or bug reports
would be helpful.  The program is licensed under the
same GPL as Lyx.

The program is currently ~800K tarred and zipped,
including documentation.  If anyone here is interested
in trying it out I can send copies out by email (unless
someone suggests a better way to distribute copies at
this stage).





program to use Lyx as a code-evaluating notebook

2012-05-27 Thread Allen Barker


I've written a Python program which I'm calling
Lyx Notebook.  It interacts with Lyx (via the Lyx
server) to allow it to be used as a code-evaluating
notebook (similar to Mathematica notebooks or the
Sage notebook).  It's still at an early stage, but
I already find it useful.

It only works with interactive, interpreted languages.
The currently-supported languages are Python 2,
Python 3, Sage, Scala, and R.  There are custom insets
for code cells and output cells.  When a cell is
evaluated the output is sent to the output cell.  The
program keeps interpreter processes running, maintaining
their state.  The Listings package is used to highlight
the code in the code cells in the Latex-formatted
printable output.

I still need to use the program myself for a while to
find more bugs, etc.  It only works on Linux systems,
and has only been tested on Fedora 15 with Lyx 2.0.3.
Most of the testing has been with Python 2 code cells.
There may well be portability problems, even to other
Linux distributions, but hopefully not serious ones.

At this point it is not ready for release to general
users.  Some more experienced users (like those on this
list) might, however, find it useful and/or want to try
it out.  Any comments, suggestions, or bug reports
would be helpful.  The program is licensed under the
same GPL as Lyx.

The program is currently ~800K tarred and zipped,
including documentation.  If anyone here is interested
in trying it out I can send copies out by email (unless
someone suggests a better way to distribute copies at
this stage).





program to use Lyx as a code-evaluating notebook

2012-05-27 Thread Allen Barker


I've written a Python program which I'm calling
Lyx Notebook.  It interacts with Lyx (via the Lyx
server) to allow it to be used as a code-evaluating
notebook (similar to Mathematica notebooks or the
Sage notebook).  It's still at an early stage, but
I already find it useful.

It only works with interactive, interpreted languages.
The currently-supported languages are Python 2,
Python 3, Sage, Scala, and R.  There are custom insets
for code cells and output cells.  When a cell is
evaluated the output is sent to the output cell.  The
program keeps interpreter processes running, maintaining
their state.  The Listings package is used to highlight
the code in the code cells in the Latex-formatted
printable output.

I still need to use the program myself for a while to
find more bugs, etc.  It only works on Linux systems,
and has only been tested on Fedora 15 with Lyx 2.0.3.
Most of the testing has been with Python 2 code cells.
There may well be portability problems, even to other
Linux distributions, but hopefully not serious ones.

At this point it is not ready for release to general
users.  Some more experienced users (like those on this
list) might, however, find it useful and/or want to try
it out.  Any comments, suggestions, or bug reports
would be helpful.  The program is licensed under the
same GPL as Lyx.

The program is currently ~800K tarred and zipped,
including documentation.  If anyone here is interested
in trying it out I can send copies out by email (unless
someone suggests a better way to distribute copies at
this stage).





Re: aspect ratio in figures

2012-05-10 Thread Allen Barker

On 05/10/2012 11:00 AM, Paul A. Rubin wrote:

Well, that took a bit of sorting.  Turns out it has nothing to do with either
LyX or LaTeX; it's something sneaky in your image.  Your screenshot is 296x296
pixels, which sounds (and looks on the desktop, or in an image viewer, or in the
LyX GUI) square.  The catch is that the resolution is (rounding a bit) 1024 ppi
(pixels per inch) horizontal v. 768 ppx vertical.  296 px at 768 ppi is more
inches than 296 px at 1024 ppi.  So the distorted PDF output is technically
correct.


Thanks for tracking that down.  It seems a bit strange
that GIMP would crop an image with respect to pixels
(displaying the result as square) and yet keep the same
resolution.  I had never noticed that it has a separate
Image  Print Size menu.  Changing that does fix the PDF.

The problem seems to have stemmed from using the option
   -density 1024x768
in the import program.  If I don't use that option the
.png image seems to display and print OK, even after
cropping.


You can, of course, set both the height and width to equal values in LyX and
force a square image.  I also converted your image (using GIMP, but other image
editors can probably do it too) to 296x296 px at 768x768 ppi, and included that
in the document while setting just the width.  That worked too.

Paul







Re: aspect ratio in figures

2012-05-10 Thread Allen Barker

On 05/10/2012 11:00 AM, Paul A. Rubin wrote:

Well, that took a bit of sorting.  Turns out it has nothing to do with either
LyX or LaTeX; it's something sneaky in your image.  Your screenshot is 296x296
pixels, which sounds (and looks on the desktop, or in an image viewer, or in the
LyX GUI) square.  The catch is that the resolution is (rounding a bit) 1024 ppi
(pixels per inch) horizontal v. 768 ppx vertical.  296 px at 768 ppi is more
inches than 296 px at 1024 ppi.  So the distorted PDF output is technically
correct.


Thanks for tracking that down.  It seems a bit strange
that GIMP would crop an image with respect to pixels
(displaying the result as square) and yet keep the same
resolution.  I had never noticed that it has a separate
Image  Print Size menu.  Changing that does fix the PDF.

The problem seems to have stemmed from using the option
   -density 1024x768
in the import program.  If I don't use that option the
.png image seems to display and print OK, even after
cropping.


You can, of course, set both the height and width to equal values in LyX and
force a square image.  I also converted your image (using GIMP, but other image
editors can probably do it too) to 296x296 px at 768x768 ppi, and included that
in the document while setting just the width.  That worked too.

Paul







Re: aspect ratio in figures

2012-05-10 Thread Allen Barker

On 05/10/2012 11:00 AM, Paul A. Rubin wrote:

Well, that took a bit of sorting.  Turns out it has nothing to do with either
LyX or LaTeX; it's something sneaky in your image.  Your screenshot is 296x296
pixels, which sounds (and looks on the desktop, or in an image viewer, or in the
LyX GUI) square.  The catch is that the resolution is (rounding a bit) 1024 ppi
(pixels per inch) horizontal v. 768 ppx vertical.  296 px at 768 ppi is more
inches than 296 px at 1024 ppi.  So the "distorted" PDF output is technically
correct.


Thanks for tracking that down.  It seems a bit strange
that GIMP would crop an image with respect to pixels
(displaying the result as square) and yet keep the same
resolution.  I had never noticed that it has a separate
Image > Print Size menu.  Changing that does fix the PDF.

The problem seems to have stemmed from using the option
   -density 1024x768
in the import program.  If I don't use that option the
.png image seems to display and print OK, even after
cropping.


You can, of course, set both the height and width to equal values in LyX and
force a square image.  I also converted your image (using GIMP, but other image
editors can probably do it too) to 296x296 px at 768x768 ppi, and included that
in the document while setting just the width.  That worked too.

Paul







Re: Coloring

2012-05-08 Thread Allen Barker

On 05/08/2012 02:37 AM, Merhebi, Bob wrote:

Hello Allen  Scott,

Allen; I can't see any ab botton; I had to use Edit  Text Style!


It should be near the end of the Extra toolbar,
when View  Toolbars  Extra is checked.


Thank you both for your replies. I appreciate it.

On Tue 08 May 2012 07:51:14 AM EEST, Scott Kostyshak wrote:

Allen Barker [allen.l.bar...@gmail.com]
Sent: Tuesday, May 08, 2012 12:30 AM


On Mon 07 May 2012 01:40:09 PM EEST, Merhebi, Bob wrote:

Hello,

I was wondering whether I could use coloring in equations? For example,
when using Mathematica or python (in IDE), brackets   the like get
colored; I've seen a pdf document recently which involved such coloring;
is that possible in LyX?



You can select any text in a math inset and change the color
via the Text Style dialog (the ab button).  I don't
know of any way highlight formulas automatically.



For highlighting program listings the listings insets do a
nice job, and can use colors.


You can create colored boxes and put equations in those, as explained in help  
Math  Section 9.3 Colored Boxes

Scott


--
Sincerely Yours,
-Merhebi, Bob

Thunderbird Signature







Re: aspect ratio in figures

2012-05-08 Thread Allen Barker

On 05/08/2012 06:09 PM, Paul A. Rubin wrote:

Allen BarkerAllen.L.Barkerat  gmail.com  writes:



On 05/03/2012 05:44 PM, Paul A. Rubin wrote:



Is your version of ImageMagick current?


It is Version: ImageMagick 6.6.5-10 2011-11-03 Q16





Perhaps you should post a minimal example (short LyX document plus image file).


OK, I've included the Lyx file and the .png image.  The
image is just a screenshot from the ImageMagick import
command, cropped in Gimp to be perfectly square.

The PDF and PS output is definitely not square on my
system: it is vertically stretched.




minimalExample.lyx
Description: application/lyx
attachment: screenshot.png

Re: Coloring

2012-05-08 Thread Allen Barker

On 05/08/2012 02:37 AM, Merhebi, Bob wrote:

Hello Allen  Scott,

Allen; I can't see any ab botton; I had to use Edit  Text Style!


It should be near the end of the Extra toolbar,
when View  Toolbars  Extra is checked.


Thank you both for your replies. I appreciate it.

On Tue 08 May 2012 07:51:14 AM EEST, Scott Kostyshak wrote:

Allen Barker [allen.l.bar...@gmail.com]
Sent: Tuesday, May 08, 2012 12:30 AM


On Mon 07 May 2012 01:40:09 PM EEST, Merhebi, Bob wrote:

Hello,

I was wondering whether I could use coloring in equations? For example,
when using Mathematica or python (in IDE), brackets   the like get
colored; I've seen a pdf document recently which involved such coloring;
is that possible in LyX?



You can select any text in a math inset and change the color
via the Text Style dialog (the ab button).  I don't
know of any way highlight formulas automatically.



For highlighting program listings the listings insets do a
nice job, and can use colors.


You can create colored boxes and put equations in those, as explained in help  
Math  Section 9.3 Colored Boxes

Scott


--
Sincerely Yours,
-Merhebi, Bob

Thunderbird Signature







Re: aspect ratio in figures

2012-05-08 Thread Allen Barker

On 05/08/2012 06:09 PM, Paul A. Rubin wrote:

Allen BarkerAllen.L.Barkerat  gmail.com  writes:



On 05/03/2012 05:44 PM, Paul A. Rubin wrote:



Is your version of ImageMagick current?


It is Version: ImageMagick 6.6.5-10 2011-11-03 Q16





Perhaps you should post a minimal example (short LyX document plus image file).


OK, I've included the Lyx file and the .png image.  The
image is just a screenshot from the ImageMagick import
command, cropped in Gimp to be perfectly square.

The PDF and PS output is definitely not square on my
system: it is vertically stretched.




minimalExample.lyx
Description: application/lyx
attachment: screenshot.png

Re: Coloring

2012-05-08 Thread Allen Barker

On 05/08/2012 02:37 AM, Merhebi, Bob wrote:

Hello Allen&  Scott,

Allen; I can't see any ab botton; I had to use Edit>  Text Style!


It should be near the end of the "Extra" toolbar,
when View > Toolbars > Extra is checked.


Thank you both for your replies. I appreciate it.

On Tue 08 May 2012 07:51:14 AM EEST, Scott Kostyshak wrote:

Allen Barker [allen.l.bar...@gmail.com]
Sent: Tuesday, May 08, 2012 12:30 AM


On Mon 07 May 2012 01:40:09 PM EEST, Merhebi, Bob wrote:

Hello,

I was wondering whether I could use coloring in equations? For example,
when using Mathematica or python (in IDE), brackets&   the like get
colored; I've seen a pdf document recently which involved such coloring;
is that possible in LyX?



You can select any text in a math inset and change the color
via the "Text Style" dialog (the "ab" button).  I don't
know of any way highlight formulas automatically.



For highlighting program listings the listings insets do a
nice job, and can use colors.


You can create colored boxes and put equations in those, as explained in help>  
Math>  Section 9.3 Colored Boxes

Scott


--
Sincerely Yours,
-Merhebi, Bob

Thunderbird Signature







Re: aspect ratio in figures

2012-05-08 Thread Allen Barker

On 05/08/2012 06:09 PM, Paul A. Rubin wrote:

Allen Barker<Allen.L.Barker  gmail.com>  writes:



On 05/03/2012 05:44 PM, Paul A. Rubin wrote:



Is your version of ImageMagick current?


It is Version: ImageMagick 6.6.5-10 2011-11-03 Q16





Perhaps you should post a minimal example (short LyX document plus image file).


OK, I've included the Lyx file and the .png image.  The
image is just a screenshot from the ImageMagick "import"
command, cropped in Gimp to be perfectly square.

The PDF and PS output is definitely not square on my
system: it is vertically stretched.




minimalExample.lyx
Description: application/lyx
<>

Re: aspect ratio in figures

2012-05-07 Thread Allen Barker

On 05/03/2012 05:44 PM, Paul A. Rubin wrote:

Sounds like something funny going on with ImageMagick, but it's hard to say.  Is
your version of ImageMagick current?


It is Version: ImageMagick 6.6.5-10 2011-11-03 Q16





Re: Coloring

2012-05-07 Thread Allen Barker

On 05/07/2012 01:23 PM, Merhebi, Bob wrote:

Just to clear it out; I meant highlighting by coloring  IDLE by
IDE.

Thanks

On Mon 07 May 2012 01:40:09 PM EEST, Merhebi, Bob wrote:

Hello,

I was wondering whether I could use coloring in equations? For example,
when using Mathematica or python (in IDE), brackets  the like get
colored; I've seen a pdf document recently which involved such coloring;
is that possible in LyX?

Thanks



--
Sincerely Yours,
-Merhebi, Bob


You can select any text in a math inset and change the color
via the Text Style dialog (the ab button).  I don't
know of any way highlight formulas automatically.

For highlighting program listings the listings insets do a
nice job, and can use colors.






Re: aspect ratio in figures

2012-05-07 Thread Allen Barker

On 05/03/2012 05:44 PM, Paul A. Rubin wrote:

Sounds like something funny going on with ImageMagick, but it's hard to say.  Is
your version of ImageMagick current?


It is Version: ImageMagick 6.6.5-10 2011-11-03 Q16





Re: Coloring

2012-05-07 Thread Allen Barker

On 05/07/2012 01:23 PM, Merhebi, Bob wrote:

Just to clear it out; I meant highlighting by coloring  IDLE by
IDE.

Thanks

On Mon 07 May 2012 01:40:09 PM EEST, Merhebi, Bob wrote:

Hello,

I was wondering whether I could use coloring in equations? For example,
when using Mathematica or python (in IDE), brackets  the like get
colored; I've seen a pdf document recently which involved such coloring;
is that possible in LyX?

Thanks



--
Sincerely Yours,
-Merhebi, Bob


You can select any text in a math inset and change the color
via the Text Style dialog (the ab button).  I don't
know of any way highlight formulas automatically.

For highlighting program listings the listings insets do a
nice job, and can use colors.






Re: aspect ratio in figures

2012-05-07 Thread Allen Barker

On 05/03/2012 05:44 PM, Paul A. Rubin wrote:

Sounds like something funny going on with ImageMagick, but it's hard to say.  Is
your version of ImageMagick current?


It is Version: ImageMagick 6.6.5-10 2011-11-03 Q16





Re: Coloring

2012-05-07 Thread Allen Barker

On 05/07/2012 01:23 PM, Merhebi, Bob wrote:

Just to clear it out; I meant "highlighting" by coloring&  "IDLE" by
IDE.

Thanks

On Mon 07 May 2012 01:40:09 PM EEST, Merhebi, Bob wrote:

Hello,

I was wondering whether I could use coloring in equations? For example,
when using Mathematica or python (in IDE), brackets&  the like get
colored; I've seen a pdf document recently which involved such coloring;
is that possible in LyX?

Thanks



--
Sincerely Yours,
-Merhebi, Bob


You can select any text in a math inset and change the color
via the "Text Style" dialog (the "ab" button).  I don't
know of any way highlight formulas automatically.

For highlighting program listings the listings insets do a
nice job, and can use colors.






Re: parameters of listings insets

2012-05-01 Thread Allen Barker

On 04/30/2012 09:18 PM, Richard Heck wrote:

On 04/30/2012 07:41 PM, Allen Barker wrote:

On 04/30/2012 07:20 PM, Allen Barker wrote:


The listings insets (at least in 2.0.3) always seem to
alphabetize their list of More Parameters. Is there
a way to avoid that? The Latex listings are sensitive to
the position of their parameters, so you can define, say,
a new language (from a base language) and then selectively
override certain parts. With alphabetization you can
only override settings earlier in the alphabet.

Making every language definition part of the official
list seems like overkill in simple cases. Even when a
language like Python is selected on the front settings
page menu, something like keywords={egg,salad} on the
More Parameters list still does not override the
keywords like it does when it occurs after the language
parameter in a Latex ERT such as:

\begin{lstlisting}[language=Python,keywords={egg,salad}]
print hello
if egg == salad:
pass
\end{lstlisting}

Also, when entering basicstyle in the parameter window
it validates it up to basicstyl and then, when the
word is completed, it says: Unknown listing parameter
name: basicstyle_ with an underscore. Is there some
reason for that?


I've narrowed this latter situation down. It does not
always do that, but it does seem to repeat it if the font
size is selected as small on the menu on the first
settings page and then basicstyle is entered into the
parameter window. It gives the Unknown message even in
a new buffer with nothing but a single listings inset in
it.


I'd suggest you report this as a bug on trac. The person who
wrote the listings inset isn't active anymore, so it may take some
time to get this fixed.


I found that the first problem, with sorting, has already been
reported as http://www.lyx.org/trac/ticket/5203

I've reported the second one as a new bug.






Re: parameters of listings insets

2012-05-01 Thread Allen Barker

On 04/30/2012 09:18 PM, Richard Heck wrote:

On 04/30/2012 07:41 PM, Allen Barker wrote:

On 04/30/2012 07:20 PM, Allen Barker wrote:


The listings insets (at least in 2.0.3) always seem to
alphabetize their list of More Parameters. Is there
a way to avoid that? The Latex listings are sensitive to
the position of their parameters, so you can define, say,
a new language (from a base language) and then selectively
override certain parts. With alphabetization you can
only override settings earlier in the alphabet.

Making every language definition part of the official
list seems like overkill in simple cases. Even when a
language like Python is selected on the front settings
page menu, something like keywords={egg,salad} on the
More Parameters list still does not override the
keywords like it does when it occurs after the language
parameter in a Latex ERT such as:

\begin{lstlisting}[language=Python,keywords={egg,salad}]
print hello
if egg == salad:
pass
\end{lstlisting}

Also, when entering basicstyle in the parameter window
it validates it up to basicstyl and then, when the
word is completed, it says: Unknown listing parameter
name: basicstyle_ with an underscore. Is there some
reason for that?


I've narrowed this latter situation down. It does not
always do that, but it does seem to repeat it if the font
size is selected as small on the menu on the first
settings page and then basicstyle is entered into the
parameter window. It gives the Unknown message even in
a new buffer with nothing but a single listings inset in
it.


I'd suggest you report this as a bug on trac. The person who
wrote the listings inset isn't active anymore, so it may take some
time to get this fixed.


I found that the first problem, with sorting, has already been
reported as http://www.lyx.org/trac/ticket/5203

I've reported the second one as a new bug.






Re: parameters of listings insets

2012-05-01 Thread Allen Barker

On 04/30/2012 09:18 PM, Richard Heck wrote:

On 04/30/2012 07:41 PM, Allen Barker wrote:

On 04/30/2012 07:20 PM, Allen Barker wrote:


The listings insets (at least in 2.0.3) always seem to
alphabetize their list of "More Parameters." Is there
a way to avoid that? The Latex listings are sensitive to
the position of their parameters, so you can define, say,
a new language (from a base language) and then selectively
override certain parts. With alphabetization you can
only override settings earlier in the alphabet.

Making every language definition part of the "official
list" seems like overkill in simple cases. Even when a
language like Python is selected on the front "settings"
page menu, something like keywords={egg,salad} on the
"More Parameters" list still does not override the
keywords like it does when it occurs after the language
parameter in a Latex ERT such as:

\begin{lstlisting}[language=Python,keywords={egg,salad}]
print "hello"
if egg == salad:
pass
\end{lstlisting}

Also, when entering "basicstyle" in the parameter window
it validates it up to "basicstyl" and then, when the
word is completed, it says: "Unknown listing parameter
name: basicstyle_" with an underscore. Is there some
reason for that?


I've narrowed this latter situation down. It does not
always do that, but it does seem to repeat it if the font
size is selected as "small" on the menu on the first
"settings" page and then "basicstyle" is entered into the
parameter window. It gives the "Unknown" message even in
a new buffer with nothing but a single listings inset in
it.


I'd suggest you report this as a bug on trac. The person who
wrote the listings inset isn't active anymore, so it may take some
time to get this fixed.


I found that the first problem, with sorting, has already been
reported as http://www.lyx.org/trac/ticket/5203

I've reported the second one as a new bug.






parameters of listings insets

2012-04-30 Thread Allen Barker


The listings insets (at least in 2.0.3) always seem to
alphabetize their list of More Parameters.  Is there
a way to avoid that?  The Latex listings are sensitive to
the position of their parameters, so you can define, say,
a new language (from a base language) and then selectively
override certain parts.  With alphabetization you can
only override settings earlier in the alphabet.

Making every language definition part of the official
list seems like overkill in simple cases.  Even when a
language like Python is selected on the front settings
page menu, something like keywords={egg,salad} on the
More Parameters list still does not override the
keywords like it does when it occurs after the language
parameter in a Latex ERT such as:

\begin{lstlisting}[language=Python,keywords={egg,salad}]
print hello
if egg == salad:
   pass
\end{lstlisting}

Also, when entering basicstyle in the parameter window
it validates it up to basicstyl and then, when the
word is completed, it says: Unknown listing parameter
name: basicstyle_ with an underscore.  Is there some
reason for that?







Re: parameters of listings insets

2012-04-30 Thread Allen Barker

On 04/30/2012 07:20 PM, Allen Barker wrote:


The listings insets (at least in 2.0.3) always seem to
alphabetize their list of More Parameters. Is there
a way to avoid that? The Latex listings are sensitive to
the position of their parameters, so you can define, say,
a new language (from a base language) and then selectively
override certain parts. With alphabetization you can
only override settings earlier in the alphabet.

Making every language definition part of the official
list seems like overkill in simple cases. Even when a
language like Python is selected on the front settings
page menu, something like keywords={egg,salad} on the
More Parameters list still does not override the
keywords like it does when it occurs after the language
parameter in a Latex ERT such as:

\begin{lstlisting}[language=Python,keywords={egg,salad}]
print hello
if egg == salad:
pass
\end{lstlisting}

Also, when entering basicstyle in the parameter window
it validates it up to basicstyl and then, when the
word is completed, it says: Unknown listing parameter
name: basicstyle_ with an underscore. Is there some
reason for that?


I've narrowed this latter situation down.  It does not
always do that, but it does seem to repeat it if the font
size is selected as small on the menu on the first
settings page and then basicstyle is entered into the
parameter window.  It gives the Unknown message even in
a new buffer with nothing but a single listings inset in
it.






parameters of listings insets

2012-04-30 Thread Allen Barker


The listings insets (at least in 2.0.3) always seem to
alphabetize their list of More Parameters.  Is there
a way to avoid that?  The Latex listings are sensitive to
the position of their parameters, so you can define, say,
a new language (from a base language) and then selectively
override certain parts.  With alphabetization you can
only override settings earlier in the alphabet.

Making every language definition part of the official
list seems like overkill in simple cases.  Even when a
language like Python is selected on the front settings
page menu, something like keywords={egg,salad} on the
More Parameters list still does not override the
keywords like it does when it occurs after the language
parameter in a Latex ERT such as:

\begin{lstlisting}[language=Python,keywords={egg,salad}]
print hello
if egg == salad:
   pass
\end{lstlisting}

Also, when entering basicstyle in the parameter window
it validates it up to basicstyl and then, when the
word is completed, it says: Unknown listing parameter
name: basicstyle_ with an underscore.  Is there some
reason for that?







Re: parameters of listings insets

2012-04-30 Thread Allen Barker

On 04/30/2012 07:20 PM, Allen Barker wrote:


The listings insets (at least in 2.0.3) always seem to
alphabetize their list of More Parameters. Is there
a way to avoid that? The Latex listings are sensitive to
the position of their parameters, so you can define, say,
a new language (from a base language) and then selectively
override certain parts. With alphabetization you can
only override settings earlier in the alphabet.

Making every language definition part of the official
list seems like overkill in simple cases. Even when a
language like Python is selected on the front settings
page menu, something like keywords={egg,salad} on the
More Parameters list still does not override the
keywords like it does when it occurs after the language
parameter in a Latex ERT such as:

\begin{lstlisting}[language=Python,keywords={egg,salad}]
print hello
if egg == salad:
pass
\end{lstlisting}

Also, when entering basicstyle in the parameter window
it validates it up to basicstyl and then, when the
word is completed, it says: Unknown listing parameter
name: basicstyle_ with an underscore. Is there some
reason for that?


I've narrowed this latter situation down.  It does not
always do that, but it does seem to repeat it if the font
size is selected as small on the menu on the first
settings page and then basicstyle is entered into the
parameter window.  It gives the Unknown message even in
a new buffer with nothing but a single listings inset in
it.






parameters of listings insets

2012-04-30 Thread Allen Barker


The listings insets (at least in 2.0.3) always seem to
alphabetize their list of "More Parameters."  Is there
a way to avoid that?  The Latex listings are sensitive to
the position of their parameters, so you can define, say,
a new language (from a base language) and then selectively
override certain parts.  With alphabetization you can
only override settings earlier in the alphabet.

Making every language definition part of the "official
list" seems like overkill in simple cases.  Even when a
language like Python is selected on the front "settings"
page menu, something like keywords={egg,salad} on the
"More Parameters" list still does not override the
keywords like it does when it occurs after the language
parameter in a Latex ERT such as:

\begin{lstlisting}[language=Python,keywords={egg,salad}]
print "hello"
if egg == salad:
   pass
\end{lstlisting}

Also, when entering "basicstyle" in the parameter window
it validates it up to "basicstyl" and then, when the
word is completed, it says: "Unknown listing parameter
name: basicstyle_" with an underscore.  Is there some
reason for that?







Re: parameters of listings insets

2012-04-30 Thread Allen Barker

On 04/30/2012 07:20 PM, Allen Barker wrote:


The listings insets (at least in 2.0.3) always seem to
alphabetize their list of "More Parameters." Is there
a way to avoid that? The Latex listings are sensitive to
the position of their parameters, so you can define, say,
a new language (from a base language) and then selectively
override certain parts. With alphabetization you can
only override settings earlier in the alphabet.

Making every language definition part of the "official
list" seems like overkill in simple cases. Even when a
language like Python is selected on the front "settings"
page menu, something like keywords={egg,salad} on the
"More Parameters" list still does not override the
keywords like it does when it occurs after the language
parameter in a Latex ERT such as:

\begin{lstlisting}[language=Python,keywords={egg,salad}]
print "hello"
if egg == salad:
pass
\end{lstlisting}

Also, when entering "basicstyle" in the parameter window
it validates it up to "basicstyl" and then, when the
word is completed, it says: "Unknown listing parameter
name: basicstyle_" with an underscore. Is there some
reason for that?


I've narrowed this latter situation down.  It does not
always do that, but it does seem to repeat it if the font
size is selected as "small" on the menu on the first
"settings" page and then "basicstyle" is entered into the
parameter window.  It gives the "Unknown" message even in
a new buffer with nothing but a single listings inset in
it.






Re: aspect ratio in figures

2012-04-25 Thread Allen Barker

On 04/23/2012 08:27 AM, Allen Barker wrote:


I'm having some problems with the aspect ratio of figures
which are inserted into Lyx. This is with version 2.0.3
on a Fedora 15 system.

I insert a .png screenshot with insert-graphics and set
the width to some value (with the maintain aspect ratio box
checked). The preview looks fine. But, when the file is
printed in PDF the aspect ratio is not preserved. For
example, a square image is stretched too much vertically
(by a very noticeable amount). Postscript is the same.

If I set both the width and the height then the PDF
comes out as it should. If I view as LyxHTML then the
size is also correct.

I'm just using the default article style, with no packages
inserted and an empty preamble.

Any ideas what's going on?


I still haven't figured out what was going on, but I did
discover that the problem does not occur with the .gif
format.  This works well enough for the screenshot I was
inserting.






Re: aspect ratio in figures

2012-04-25 Thread Allen Barker

On 04/23/2012 08:27 AM, Allen Barker wrote:


I'm having some problems with the aspect ratio of figures
which are inserted into Lyx. This is with version 2.0.3
on a Fedora 15 system.

I insert a .png screenshot with insert-graphics and set
the width to some value (with the maintain aspect ratio box
checked). The preview looks fine. But, when the file is
printed in PDF the aspect ratio is not preserved. For
example, a square image is stretched too much vertically
(by a very noticeable amount). Postscript is the same.

If I set both the width and the height then the PDF
comes out as it should. If I view as LyxHTML then the
size is also correct.

I'm just using the default article style, with no packages
inserted and an empty preamble.

Any ideas what's going on?


I still haven't figured out what was going on, but I did
discover that the problem does not occur with the .gif
format.  This works well enough for the screenshot I was
inserting.






Re: aspect ratio in figures

2012-04-25 Thread Allen Barker

On 04/23/2012 08:27 AM, Allen Barker wrote:


I'm having some problems with the aspect ratio of figures
which are inserted into Lyx. This is with version 2.0.3
on a Fedora 15 system.

I insert a .png screenshot with insert->graphics and set
the width to some value (with the maintain aspect ratio box
checked). The preview looks fine. But, when the file is
printed in PDF the aspect ratio is not preserved. For
example, a square image is stretched too much vertically
(by a very noticeable amount). Postscript is the same.

If I set both the width and the height then the PDF
comes out as it should. If I view as LyxHTML then the
size is also correct.

I'm just using the default article style, with no packages
inserted and an empty preamble.

Any ideas what's going on?


I still haven't figured out what was going on, but I did
discover that the problem does not occur with the .gif
format.  This works well enough for the screenshot I was
inserting.






aspect ratio in figures

2012-04-23 Thread Allen Barker


I'm having some problems with the aspect ratio of figures
which are inserted into Lyx.  This is with version 2.0.3
on a Fedora 15 system.

I insert a .png screenshot with insert-graphics and set
the width to some value (with the maintain aspect ratio box
checked).  The preview looks fine.  But, when the file is
printed in PDF the aspect ratio is not preserved.  For
example, a square image is stretched too much vertically
(by a very noticeable amount).  Postscript is the same.

If I set both the width and the height then the PDF
comes out as it should.  If I view as LyxHTML then the
size is also correct.

I'm just using the default article style, with no packages
inserted and an empty preamble.

Any ideas what's going on?






aspect ratio in figures

2012-04-23 Thread Allen Barker


I'm having some problems with the aspect ratio of figures
which are inserted into Lyx.  This is with version 2.0.3
on a Fedora 15 system.

I insert a .png screenshot with insert-graphics and set
the width to some value (with the maintain aspect ratio box
checked).  The preview looks fine.  But, when the file is
printed in PDF the aspect ratio is not preserved.  For
example, a square image is stretched too much vertically
(by a very noticeable amount).  Postscript is the same.

If I set both the width and the height then the PDF
comes out as it should.  If I view as LyxHTML then the
size is also correct.

I'm just using the default article style, with no packages
inserted and an empty preamble.

Any ideas what's going on?






aspect ratio in figures

2012-04-23 Thread Allen Barker


I'm having some problems with the aspect ratio of figures
which are inserted into Lyx.  This is with version 2.0.3
on a Fedora 15 system.

I insert a .png screenshot with insert->graphics and set
the width to some value (with the maintain aspect ratio box
checked).  The preview looks fine.  But, when the file is
printed in PDF the aspect ratio is not preserved.  For
example, a square image is stretched too much vertically
(by a very noticeable amount).  Postscript is the same.

If I set both the width and the height then the PDF
comes out as it should.  If I view as LyxHTML then the
size is also correct.

I'm just using the default article style, with no packages
inserted and an empty preamble.

Any ideas what's going on?






char-right via LyX server and math insets

2012-04-09 Thread Allen Barker


This occurs on a Fedora 15 system with LyX 2.0.3.

Create a new file with some random text and a math
inset with some random math in it.  Position the
cursor somewhere before the math inset.

Using the right-arrow key the cursor can be moved
into and then past the math inset.

Using char-right repeatedly from the command
minibuffer the cursor can similarly be moved into
and past the math inset.

Using the char-right command via the LyX server with
   echo 'LYXCMD:clientname:char-right:' ~/.lyx/lyxpipe.in
however, the cursor always stops at the left side
of the math inset.  It works fine on ordinary text, but
it cannot enter the math inset.  When the command is
run with the cursor already inside the math inset the
cursor-point just pops out to the left of the math inset.
The char-forward LFUN has the same behavior.  It makes
no difference if display mode for math is on or off.

I have an application where I'd like to be able to use
the LyX server to move the cursor inside a math inset
if one is there.  Any ideas what is happening and how to
work around it?




char-right via LyX server and math insets

2012-04-09 Thread Allen Barker


This occurs on a Fedora 15 system with LyX 2.0.3.

Create a new file with some random text and a math
inset with some random math in it.  Position the
cursor somewhere before the math inset.

Using the right-arrow key the cursor can be moved
into and then past the math inset.

Using char-right repeatedly from the command
minibuffer the cursor can similarly be moved into
and past the math inset.

Using the char-right command via the LyX server with
   echo 'LYXCMD:clientname:char-right:' ~/.lyx/lyxpipe.in
however, the cursor always stops at the left side
of the math inset.  It works fine on ordinary text, but
it cannot enter the math inset.  When the command is
run with the cursor already inside the math inset the
cursor-point just pops out to the left of the math inset.
The char-forward LFUN has the same behavior.  It makes
no difference if display mode for math is on or off.

I have an application where I'd like to be able to use
the LyX server to move the cursor inside a math inset
if one is there.  Any ideas what is happening and how to
work around it?




char-right via LyX server and math insets

2012-04-09 Thread Allen Barker


This occurs on a Fedora 15 system with LyX 2.0.3.

Create a new file with some random text and a math
inset with some random math in it.  Position the
cursor somewhere before the math inset.

Using the right-arrow key the cursor can be moved
into and then past the math inset.

Using char-right repeatedly from the command
minibuffer the cursor can similarly be moved into
and past the math inset.

Using the char-right command via the LyX server with
   echo 'LYXCMD:clientname:char-right:' >~/.lyx/lyxpipe.in
however, the cursor always stops at the left side
of the math inset.  It works fine on ordinary text, but
it cannot enter the math inset.  When the command is
run with the cursor already inside the math inset the
cursor-point just pops out to the left of the math inset.
The char-forward LFUN has the same behavior.  It makes
no difference if display mode for math is on or off.

I have an application where I'd like to be able to use
the LyX server to move the cursor inside a math inset
if one is there.  Any ideas what is happening and how to
work around it?