Re: Feature request (Grammarly support for LYX)

2022-09-27 Thread Jean-Marc Lasgouttes

Le 27/09/2022 à 16:47, John McCabe-Dansted a écrit :
On Thu, 22 Sept 2022 at 06:09, Jean-Marc Lasgouttes > wrote:


Another solution is LanguageTool.


And LyX-GC already supports LanguageTool


I am sorry to admit that I forgot about lyx-gc. I looked at it again, 
and am not sure what the lyx-gc script itself is good for. Isn't it 
possible to just change the name of the command one wants to use as checker?


I some the lyx-gc checker (whatever it is) was packaged separately, we 
could add ways to run it from LyX.


What do I miss?

JMarc

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature request (Grammarly support for LYX)

2022-09-27 Thread wael muhammed
Great, thanks!

On Tue, Sep 27, 2022, 5:47 PM John McCabe-Dansted  wrote:

> On Thu, 22 Sept 2022 at 06:09, Jean-Marc Lasgouttes 
> wrote:
>
>> Another solution is LanguageTool.
>>
>
> And LyX-GC already supports LanguageTool
>
> --
> John C. McCabe-Dansted
>
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature request (Grammarly support for LYX)

2022-09-27 Thread John McCabe-Dansted
On Thu, 22 Sept 2022 at 06:09, Jean-Marc Lasgouttes 
wrote:

> Another solution is LanguageTool.
>

And LyX-GC already supports LanguageTool

-- 
John C. McCabe-Dansted
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature request (Grammarly support for LYX)

2022-09-21 Thread Jean-Marc Lasgouttes

Le 21/09/2022 à 23:26, Thibaut Cuvelier a écrit :
For the same purpose, I have looked into Antidote, providing language 
services for French and English, but their desktop API is a mess to use 
(COM on Windows, D-BUS for Linux, and services for macOS — or JavaScript 
for Web browsers): 
https://www.antidote.info/en/antidote-11/documentation/developer-tools 
.


Another solution is LanguageTool.

JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature request (Grammarly support for LYX)

2022-09-21 Thread Thibaut Cuvelier
Hi Wail,

Unfortunately, I don't think it will be possible to have some kind of
integration with Grammarly: it only provides an API for the Web. It would
require some reverse-engineering to use it within a desktop application.
Apparently, you'd only have to understand how this works, exactly:

https://js.grammarly.com/grammarly-editor-sdk@2.0.1

And even so, I believe this use would be against Grammarly's terms of
services. Overall, I think it would be better to ask them to support
desktop applications (i.e. provide a true Web API).

For the same purpose, I have looked into Antidote, providing language
services for French and English, but their desktop API is a mess to use
(COM on Windows, D-BUS for Linux, and services for macOS — or JavaScript
for Web browsers):
https://www.antidote.info/en/antidote-11/documentation/developer-tools.

Thibaut Cuvelier


On Wed, 21 Sept 2022 at 21:02, wael muhammed 
wrote:

> Hello, LYX  is very powerful tools, I hope I can use Grammarly with it.
> for Grammarly SDK, you can see it here .
>  I am also web developer, you can give me some keys to make merge request.
> With a lot of thanks
> Wail Alasad
> --
> lyx-devel mailing list
> lyx-devel@lists.lyx.org
> http://lists.lyx.org/mailman/listinfo/lyx-devel
>
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Feature request (Grammarly support for LYX)

2022-09-21 Thread wael muhammed
Hello, LYX  is very powerful tools, I hope I can use Grammarly with it.
for Grammarly SDK, you can see it here .
 I am also web developer, you can give me some keys to make merge request.
With a lot of thanks
Wail Alasad
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request for tex2lyx

2021-02-22 Thread Dr Eberhard Lisse
I case someone (on the Mac) has similar issues

find ~ \
 -not \( -path ~/Library -prune \) \
 -not \( -path ~/Downloads -prune \) \
 -not \( -path ~/.lyx -prune \) \
 -name '*.lyx' \
 -exec perl -i -p -e 's/\\language american/\\language english/g' {} ';'

does the trick.

greetings, el

On 22/02/2021 10:41, Dr Eberhard Lisse wrote:
> Than you for unconfusing me :-)-O
> 
> Seems I have been using "English (US) unnecessarily for years :-)-O
> 
> el
> 
> On 21/02/2021 18:55, Jürgen Spitzmüller wrote:
>> Am Sonntag, dem 21.02.2021 um 18:42 +0200 schrieb Dr Eberhard W Lisse:
>>> Enclosed the input and output from
>>>
>>> tex2lyx -c scrartcl mwe.tex
>>>
>>> mwe.lyx shows language "English" which in Babel terms is "british"
>>> whereas I would rather be able to set it to produce "English (USA)"
>>> which in babel terms would be "american".
>>
>> No, LyX has language "English" which in babel terms is "english" which
>> equals "american", not "british".
>>
>> Jürgen
>>
>>
> 
> 
> 


-- 
To email me replace 'nospam' with 'el'



signature.asc
Description: OpenPGP digital signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request for tex2lyx

2021-02-22 Thread Dr Eberhard Lisse
Than you for unconfusing me :-)-O

Seems I have been using "English (US) unnecessarily for years :-)-O

el

On 21/02/2021 18:55, Jürgen Spitzmüller wrote:
> Am Sonntag, dem 21.02.2021 um 18:42 +0200 schrieb Dr Eberhard W Lisse:
>> Enclosed the input and output from
>>
>>  tex2lyx -c scrartcl mwe.tex
>>
>> mwe.lyx shows language "English" which in Babel terms is "british"
>> whereas I would rather be able to set it to produce "English (USA)"
>> which in babel terms would be "american".
> 
> No, LyX has language "English" which in babel terms is "english" which
> equals "american", not "british".
> 
> Jürgen
> 
> 


-- 
To email me replace 'nospam' with 'el'



signature.asc
Description: OpenPGP digital signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request for tex2lyx

2021-02-21 Thread Jürgen Spitzmüller
Am Sonntag, dem 21.02.2021 um 18:42 +0200 schrieb Dr Eberhard W Lisse:
> Enclosed the input and output from
> 
>   tex2lyx -c scrartcl mwe.tex
> 
> mwe.lyx shows language "English" which in Babel terms is "british"
> whereas I would rather be able to set it to produce "English (USA)"
> which in babel terms would be "american".

No, LyX has language "English" which in babel terms is "english" which
equals "american", not "british".

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request for tex2lyx

2021-02-21 Thread Dr Eberhard W Lisse
Enclosed the input and output from

tex2lyx -c scrartcl mwe.tex

mwe.lyx shows language "English" which in Babel terms is "british"
whereas I would rather be able to set it to produce "English (USA)"
which in babel terms would be "american".

Never mind the difference in terminology between LyX and Babel.

greetings, el


On 2021-02-20 18:23 , Jürgen Spitzmüller wrote:
> Am Samstag, dem 20.02.2021 um 18:16 +0200 schrieb Dr Eberhard W Lisse:
>> I do everything in US English, but even a MWE LaTeX will be in UK
>> English when tex2lyx is done with it.
> 
> Really, UK English (i.e., babel "british")?
> 
> Note that babel "english" is euqivalent to "american" (not "british").
> 
> Jürgen
> 
> 



mwe.tex
Description: TeX document
#LyX file created by tex2lyx 2.3
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin /Users/el/Desktop/
\textclass scrartcl
\begin_preamble



\end_preamble
\use_default_options false
\maintain_unincluded_children false
\language english
\language_package none
\inputencoding auto
\fontencoding default
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype true
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 0
\use_package cancel 0
\use_package esint 1
\use_package mathdots 0
\use_package mathtools 0
\use_package mhchem 0
\use_package stackrel 0
\use_package stmaryrd 0
\use_package undertilde 0
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Standard
This is an intro
\end_layout

\end_body
\end_document
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request for tex2lyx

2021-02-20 Thread Jürgen Spitzmüller
Am Samstag, dem 20.02.2021 um 18:16 +0200 schrieb Dr Eberhard W Lisse:
> I do everything in US English, but even a MWE LaTeX will be in UK
> English when tex2lyx is done with it.

Really, UK English (i.e., babel "british")?

Note that babel "english" is euqivalent to "american" (not "british").

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request for tex2lyx

2021-02-20 Thread Dr Eberhard W Lisse
I can deal with complications if and when they occur, but would rather
like the standard situation be standard :-)-O

I do everything in US English, but even a MWE LaTeX will be in UK
English when tex2lyx is done with it.

And that, I think is cumbersome. And amenable to a switch in tex2lyx,
not an automatism, though I have no idea how much work the
implementation will be.

Hence this thread.

greetings, el

On 2021-02-19 15:01 , Jürgen Spitzmüller wrote:
> Am Freitag, dem 19.02.2021 um 14:55 +0200 schrieb Dr Eberhard Lisse:
>> That I can do, but it adds additional steps (which are difficult for
>> some)
>
> The problem with automatism is: if you have multilingual documents,
> what should tex2lyx do if languages are switched? Replace the main
> language with the one specified by the option? But then, it makes
> sense to markup different language varieties (e.g., Britisch and
> American English) due to different spelling or even hyphenation
> conventions (think de-1901 vs. de-1996).
>
> Jürgen
>
>



-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request for tex2lyx

2021-02-19 Thread Jürgen Spitzmüller
Am Freitag, dem 19.02.2021 um 14:55 +0200 schrieb Dr Eberhard Lisse:
> That I can do, but it adds additional steps (which are difficult for
> some)

The problem with automatism is: if you have multilingual documents,
what should tex2lyx do if languages are switched? Replace the main
language with the one specified by the option? But then, it makes sense
to markup different language varieties (e.g., Britisch and American
English) due to different spelling or even hyphenation conventions
(think de-1901 vs. de-1996).

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request for tex2lyx

2021-02-19 Thread Dr Eberhard Lisse
That I can do, but it adds additional steps (which are difficult for
some)

el


On 19/02/2021 08:01, Jürgen Spitzmüller wrote:
> Am Donnerstag, dem 18.02.2021 um 22:30 +0200 schrieb Dr Eberhard W
> Lisse:
>> can we add an option to tex2lyx allowing to select the language?
>>
>> I use the writer2latex in LibreOffice a bit and can't export to
>> other than standard (English) whereas I use US English in Lyx/LaTeX.
>>
>> Would such a feature make sense/be helpful?
> 
> I think it is more apt to change the language in the tex file (which
> should be easy enough to do).
> 
> Jürgen
> 
> 


-- 
To email me replace 'nospam' with 'el'



signature.asc
Description: OpenPGP digital signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request for tex2lyx

2021-02-18 Thread Jürgen Spitzmüller
Am Donnerstag, dem 18.02.2021 um 22:30 +0200 schrieb Dr Eberhard W
Lisse:
> can we add an option to tex2lyx allowing to select the language?
> 
> I use the writer2latex in LibreOffice a bit and can't export to
> other than standard (English) whereas I use US English in Lyx/LaTeX.
> 
> Would such a feature make sense/be helpful?

I think it is more apt to change the language in the tex file (which
should be easy enough to do).

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Feature Request for tex2lyx

2021-02-18 Thread Dr Eberhard W Lisse
Hi,

can we add an option to tex2lyx allowing to select the language?

I use the writer2latex in LibreOffice a bit and can't export to
other than standard (English) whereas I use US English in Lyx/LaTeX.

Would such a feature make sense/be helpful?

greetings, el
-- 
Dr. Eberhard W. Lisse   \ /   Obstetrician & Gynaecologist
e...@lisse.na / *  |  Telephone: +264 81 124 6733 (cell)
PO Box 8421 Bachbrecht  \  /  If this email is signed with GPG/PGP
10007, Namibia   ;/ Sect 20 of Act No. 4 of 2019 may apply

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature request (show correct graphics page in multipage pdf)

2021-01-21 Thread Scott Kostyshak
On Thu, Jan 21, 2021 at 11:38:25AM -0500, Neal Becker wrote:
> In inserted graphics, we can select a page from a multi-page pdf using
> "latex and lyx options".  This will show the correct graphics in the
> pdf output.  But the preview always shows page 1.  Would be nice to
> implement something to fix the preview.

Agreed. This is annoying. It's reported here (by a younger Neal :):

  https://www.lyx.org/trac/ticket/9039

I think we need to make a new copier variable to fix it.

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Feature request (show correct graphics page in multipage pdf)

2021-01-21 Thread Neal Becker
In inserted graphics, we can select a page from a multi-page pdf using
"latex and lyx options".  This will show the correct graphics in the
pdf output.  But the preview always shows page 1.  Would be nice to
implement something to fix the preview.

-- 
Those who don't understand recursion are doomed to repeat it
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-19 Thread Doug Martin
Paul,

Thanks for the question/suggestion.

It turns out that I used to use the chunks option cache = T, which I
understood to result in R code not being run
again unless something is changed in the code.  But its behavior seemed to
be somewhat random, so I gave it
up for the book and always use cache = F, which means the code does run
every time.  One thing I really like about
this (assuming no long-running Monte Carlos are involved) is that the
Figures in a Figure float update automatically
when I tweak the code to improve the figure.

However, the following with respect to "cache = T"  is for what it's
worth.  I have been twice bitten by using that
choice, in two different contexts, one while writing another paper.
Suddenly, I my compile would crash with
a message error that it was trying to load an R package that I no longer
use for the paper, but had used in the
not so recent past.  And it was because somewhere the cache contained a
load instruction for that package.
The solution was simple - just empty the cache.

Your suggested fix could work, but we are hoping for a more efficient fix
that works like our current
use of kable/kableExtra works.  Just change the code some and recompile and
you get the new table.

Doug



On Tue, Jan 19, 2021 at 10:27 AM Paul A. Rubin  wrote:

> On 1/19/21 12:03 PM, Doug Martin wrote:
>
> Scott (and all),
>
> I have attached the LYX segment from one of our book chapters, along with
> a page from the compiled pdf file that contains
> the resulting Table TS-2.1.
>
> This tiny example illustrates how we currently make most of our tables
> using the kableExtra package (kable is included in knitr),
> and if we had an R script to produce an LYX Table with the data frame (or
> data.table) as input, we would surely use it.
>
> FYI, in case you want to compile the LYX file, you just need to strip out
> the Springer svmono (book templates) stuff, etc., in the
> LaTeX preamble, install knitr and kableExtra from CRAN, and install the
> optimalPsiRho package with:
>
> devtools::install_github("kjellpk/optimalRhoPsi").
>
> Just before sending this I noticed the several other emails on the topic,
> and will take a look at them.
>
> Thanks,
> Doug
>
> On Mon, Jan 18, 2021 at 11:27 AM Scott Kostyshak  wrote:
>
>> On Mon, Jan 18, 2021 at 11:03:49AM -0800, Doug Martin wrote:
>> > On Mon, Jan 18, 2021 at 10:41 AM Scott Kostyshak 
>> wrote:
>> >
>> > > On Mon, Jan 18, 2021 at 07:25:42PM +0100, Jean-Marc Lasgouttes wrote:
>> > > > Le 14/01/2021 à 05:34, Doug Martin a écrit :
>> > > > > JMarc and all,
>> > > > >
>> > > > > Tom and I use knitr extensively for R code chunks, and we mostly
>> use
>> > > > > kable with kableExtra to make tables.
>> > > > > The input to kable are R data frames, or data.tables, which are
>> the
>> > > > > result of model fitting and related calculations.
>> > > > > But we like to put mathematical expressions in selected cells of
>> > > tables,
>> > > > > which is so easy with LYX tables, and we currently
>> > > > > have to make the data entry into LYX by hand from data tables and
>> > > > > data.tables in order to make use of that feature.
>> > > > > So it would be great if we could import R data tables and
>> data.tables
>> > > > > into LYX tables, rather than using the kable/kableExtra
>> > > > > solution for our tables  (maybe I didn't make that clear in my
>> earlier
>> > > > > email).  Then we would probably would drop use of
>> > > > > kable/kableExtra.
>> > > >
>> > > > So you want to import as .tex the result of R processing. This can
>> be
>> > > done
>> > > > via "Paste from LaTeX". What would be missing for your intended
>> usage?
>> > >
>> > > From what I understand, they would like to import a .Rds file without
>> > > having to manually convert it to LaTeX.
>> > >
>> >
>> > Scott,
>> >
>> > Definitely correct on the "without" part.  But we want to directly
>> import
>> > an R object
>> > of class data.frame or data.table into an LYX table.
>> >
>> > If we have to export such an object first, we would typically export it
>> to
>> > an .Rda object.
>> > But it would be far more convenient to not have to do that.
>>
>> Thanks for the clarification, Doug. It might help us to have a complete,
>> simple, example to play with. Can you give us the .lyx file and R
>> code/file? To make things perfectly clear to us, it might help to give
>> us a "before" version of the .lyx file and an "after" version of the
>> .lyx file. To create the "after" version you would have to do the steps
>> manually, but by seeing it we could make sure we understand what you
>> want to automate and what you expect the result to be.
>>
>> Thanks for your patience,
>>
>> Scott
>>
>
>
> --
> R. Douglas Martin
> Professor Emeritus in Applied Mathematics and Statistics
> Founder and Former Director of MS-CFRM Program
> depts.washington.edu/compfin/
> University of Washington
>
> Doug,
>
> If I am understanding your example correctly, you actually redo the R
> calculations each time you 

Re: Feature Request from Doug Martin and Tom Philips

2021-01-19 Thread Paul A. Rubin

On 1/19/21 12:03 PM, Doug Martin wrote:

Scott (and all),

I have attached the LYX segment from one of our book chapters, along 
with a page from the compiled pdf file that contains

the resulting Table TS-2.1.

This tiny example illustrates how we currently make most of our tables 
using the kableExtra package (kable is included in knitr),
and if we had an R script to produce an LYX Table with the data frame 
(or data.table) as input, we would surely use it.


FYI, in case you want to compile the LYX file, you just need to strip 
out the Springer svmono (book templates) stuff, etc., in the
LaTeX preamble, install knitr and kableExtra from CRAN, and install 
the optimalPsiRho package with:


devtools::install_github("kjellpk/optimalRhoPsi").

Just before sending this I noticed the several other emails on the 
topic, and will take a look at them.


Thanks,
Doug

On Mon, Jan 18, 2021 at 11:27 AM Scott Kostyshak > wrote:


On Mon, Jan 18, 2021 at 11:03:49AM -0800, Doug Martin wrote:
> On Mon, Jan 18, 2021 at 10:41 AM Scott Kostyshak
mailto:skost...@lyx.org>> wrote:
>
> > On Mon, Jan 18, 2021 at 07:25:42PM +0100, Jean-Marc Lasgouttes
wrote:
> > > Le 14/01/2021 à 05:34, Doug Martin a écrit :
> > > > JMarc and all,
> > > >
> > > > Tom and I use knitr extensively for R code chunks, and we
mostly use
> > > > kable with kableExtra to make tables.
> > > > The input to kable are R data frames, or data.tables,
which are the
> > > > result of model fitting and related calculations.
> > > > But we like to put mathematical expressions in selected
cells of
> > tables,
> > > > which is so easy with LYX tables, and we currently
> > > > have to make the data entry into LYX by hand from data
tables and
> > > > data.tables in order to make use of that feature.
> > > > So it would be great if we could import R data tables and
data.tables
> > > > into LYX tables, rather than using the kable/kableExtra
> > > > solution for our tables  (maybe I didn't make that clear
in my earlier
> > > > email).  Then we would probably would drop use of
> > > > kable/kableExtra.
> > >
> > > So you want to import as .tex the result of R processing.
This can be
> > done
> > > via "Paste from LaTeX". What would be missing for your
intended usage?
> >
> > From what I understand, they would like to import a .Rds file
without
> > having to manually convert it to LaTeX.
> >
>
> Scott,
>
> Definitely correct on the "without" part.  But we want to
directly import
> an R object
> of class data.frame or data.table into an LYX table.
>
> If we have to export such an object first, we would typically
export it to
> an .Rda object.
> But it would be far more convenient to not have to do that.

Thanks for the clarification, Doug. It might help us to have a
complete,
simple, example to play with. Can you give us the .lyx file and R
code/file? To make things perfectly clear to us, it might help to give
us a "before" version of the .lyx file and an "after" version of the
.lyx file. To create the "after" version you would have to do the
steps
manually, but by seeing it we could make sure we understand what you
want to automate and what you expect the result to be.

Thanks for your patience,

Scott



--
R. Douglas Martin
Professor Emeritus in Applied Mathematics and Statistics
Founder and Former Director of MS-CFRM Program
depts.washington.edu/compfin/ 
University of Washington


Doug,

If I am understanding your example correctly, you actually redo the R 
calculations each time you compile the LyX document. Is that a desired 
feature, or would you be just as happy running the R code once and 
parking the generated table in the LyX document? I ask because elsewhere 
in the thread I pointed out (in a reply to Riki) that one can use a 
custom R function (which you could set up to load by default whenever 
you crank up R) to convert a data frame or table to LaTeX and copy the 
LaTeX code to the clipboard. After that, all you have to do is paste it 
into your open LyX document using the correct LyX command, and it goes 
in as a table.


Paul

--
Paul A. Rubin, Professor Emeritus
The Eli Broad College of Business
Michigan State University
Email: ru...@msu.edu 
Home page: https://rubin.msu.domains/
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-19 Thread Dr Eberhard Lisse
RiKi,

that is fortunately very easy to do on the Mac and Linux with the bang 
and Rscript:

 #!/usr/bin/env Rscript --vanilla
 local({
r <- getOption("repos")
 r["CRAN"] <- "https://cloud.r-project.org/;
options(repos = r)
 })
 update.packages()

I have no idea whether Rscript even exists on Windows and if so, how to 
call it.

greetings, el

On 19/01/2021 00:12, Richard Kimberly Heck wrote:
[...] 
> Presumably one could script the R session itself so that the needed
> object was exported?  I.e., can one do that from the command line?
> That's the kind of thing that an external template would do.
[...]

-- 
To email me replace 'nospam' with 'el'

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-18 Thread Paul A. Rubin

On 1/18/21 5:12 PM, Richard Kimberly Heck wrote:

On 1/18/21 2:49 PM, Paul A. Rubin wrote:

On 1/18/21 2:03 PM, Doug Martin wrote:



On Mon, Jan 18, 2021 at 10:41 AM Scott Kostyshak > wrote:


On Mon, Jan 18, 2021 at 07:25:42PM +0100, Jean-Marc Lasgouttes
wrote:
> Le 14/01/2021 à 05:34, Doug Martin a écrit :
> > JMarc and all,
> >
> > Tom and I use knitr extensively for R code chunks, and we
mostly use
> > kable with kableExtra to make tables.
> > The input to kable are R data frames, or data.tables, which
are the
> > result of model fitting and related calculations.
> > But we like to put mathematical expressions in selected
cells of tables,
> > which is so easy with LYX tables, and we currently
> > have to make the data entry into LYX by hand from data
tables and
> > data.tables in order to make use of that feature.
> > So it would be great if we could import R data tables and
data.tables
> > into LYX tables, rather than using the kable/kableExtra
> > solution for our tables  (maybe I didn't make that clear in
my earlier
> > email).  Then we would probably would drop use of
> > kable/kableExtra.
>
> So you want to import as .tex the result of R processing. This
can be done
> via "Paste from LaTeX". What would be missing for your
intended usage?

From what I understand, they would like to import a .Rds file
without
having to manually convert it to LaTeX.


Scott,

Definitely correct on the "without" part.  But we want to directly 
import an R object

of class data.frame or data.table into an LYX table.

If we have to export such an object first, we would typically export 
it to an .Rda object.

But it would be far more convenient to not have to do that.

Doug


Scott



--
R. Douglas Martin
Professor Emeritus in Applied Mathematics and Statistics
Founder and Former Director of MS-CFRM Program
depts.washington.edu/compfin/ 
University of Washington


Doug,

I'm not sure that what you want (direct import without first 
exporting) is possible. Keep in mind that the source data frames / 
tables live inside an R session, to which LyX probably does not have 
access. So I'm pretty sure you will need to manually export the R 
objects, either by saving to .Rda files (and then importing them into 
a LyX document using a converter) or by running an R function/script 
that converts them to LaTeX or LyX source (or something else LyX can 
ingest).


Presumably one could script the R session itself so that the needed 
object was exported? I.e., can one do that from the command line? 
That's the kind of thing that an external template would do.


Riki



Riki,

What do you have in mind by "external template"? Definitely you can 
export objects from within the R session, whether it is done by entering 
a line of code at the command line, or adding code to a script or 
notebook, or doing something interactive from within a Shiny web 
interface or an IDE. It seems they are currently doing that now (with 
kable()). What I don't think is possible is to have both LyX and an R 
session running, go to LyX, and run a command sequence or script that 
would say "go into my R session, grab the data frame named 'results', 
and import it as a LyX table". Specifically, I don't think the "go into 
my R session" part is doable.


With the right stuff installed, I think a viable option is to use the 
clipboard. I'll use the (in)famous iris data frame (which comes 
preinstalled in R) as an example. Assume that I have both R and LyX 
open, and the 'clipr' and 'xtable' R packages loaded. The command 
'write_clip(capture.output(xtable(iris)))' formats the iris data frame 
as a LaTeX table and crams it into the system clipboard. In the LyX 
document, Edit > Paste Special > Paste from LaTeX imports it as a table 
(in a float inset, which can be dissolved if not wanted). The R command 
can be made into a function that can be loaded automatically when an R 
session starts, and I'm pretty sure I could turn it into an add-in with 
a shortcut in RStudio. Note that this would not require any changes to LyX.


Paul

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-18 Thread Richard Kimberly Heck
On 1/18/21 2:49 PM, Paul A. Rubin wrote:
> On 1/18/21 2:03 PM, Doug Martin wrote:
>>
>>
>> On Mon, Jan 18, 2021 at 10:41 AM Scott Kostyshak > > wrote:
>>
>> On Mon, Jan 18, 2021 at 07:25:42PM +0100, Jean-Marc Lasgouttes wrote:
>> > Le 14/01/2021 à 05:34, Doug Martin a écrit :
>> > > JMarc and all,
>> > >
>> > > Tom and I use knitr extensively for R code chunks, and we
>> mostly use
>> > > kable with kableExtra to make tables.
>> > > The input to kable are R data frames, or data.tables, which
>> are the
>> > > result of model fitting and related calculations.
>> > > But we like to put mathematical expressions in selected cells
>> of tables,
>> > > which is so easy with LYX tables, and we currently
>> > > have to make the data entry into LYX by hand from data tables and
>> > > data.tables in order to make use of that feature.
>> > > So it would be great if we could import R data tables and
>> data.tables
>> > > into LYX tables, rather than using the kable/kableExtra
>> > > solution for our tables  (maybe I didn't make that clear in
>> my earlier
>> > > email).  Then we would probably would drop use of
>> > > kable/kableExtra.
>> >
>> > So you want to import as .tex the result of R processing. This
>> can be done
>> > via "Paste from LaTeX". What would be missing for your intended
>> usage?
>>
>> From what I understand, they would like to import a .Rds file without
>> having to manually convert it to LaTeX.
>>
>>
>> Scott,
>>
>> Definitely correct on the "without" part.  But we want to directly
>> import an R object
>> of class data.frame or data.table into an LYX table. 
>>
>> If we have to export such an object first, we would typically export
>> it to an .Rda object.
>> But it would be far more convenient to not have to do that.
>>
>> Doug
>>
>>
>> Scott
>>
>>
>>
>> -- 
>> R. Douglas Martin
>> Professor Emeritus in Applied Mathematics and Statistics
>> Founder and Former Director of MS-CFRM Program
>> depts.washington.edu/compfin/ 
>> University of Washington
>>
> Doug,
>
> I'm not sure that what you want (direct import without first
> exporting) is possible. Keep in mind that the source data frames /
> tables live inside an R session, to which LyX probably does not have
> access. So I'm pretty sure you will need to manually export the R
> objects, either by saving to .Rda files (and then importing them into
> a LyX document using a converter) or by running an R function/script
> that converts them to LaTeX or LyX source (or something else LyX can
> ingest).

Presumably one could script the R session itself so that the needed
object was exported? I.e., can one do that from the command line? That's
the kind of thing that an external template would do.

Riki


-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-18 Thread Paul A. Rubin

On 1/18/21 2:03 PM, Doug Martin wrote:



On Mon, Jan 18, 2021 at 10:41 AM Scott Kostyshak > wrote:


On Mon, Jan 18, 2021 at 07:25:42PM +0100, Jean-Marc Lasgouttes wrote:
> Le 14/01/2021 à 05:34, Doug Martin a écrit :
> > JMarc and all,
> >
> > Tom and I use knitr extensively for R code chunks, and we
mostly use
> > kable with kableExtra to make tables.
> > The input to kable are R data frames, or data.tables, which
are the
> > result of model fitting and related calculations.
> > But we like to put mathematical expressions in selected cells
of tables,
> > which is so easy with LYX tables, and we currently
> > have to make the data entry into LYX by hand from data tables and
> > data.tables in order to make use of that feature.
> > So it would be great if we could import R data tables and
data.tables
> > into LYX tables, rather than using the kable/kableExtra
> > solution for our tables  (maybe I didn't make that clear in my
earlier
> > email).  Then we would probably would drop use of
> > kable/kableExtra.
>
> So you want to import as .tex the result of R processing. This
can be done
> via "Paste from LaTeX". What would be missing for your intended
usage?

From what I understand, they would like to import a .Rds file without
having to manually convert it to LaTeX.


Scott,

Definitely correct on the "without" part.  But we want to directly 
import an R object

of class data.frame or data.table into an LYX table.

If we have to export such an object first, we would typically export 
it to an .Rda object.

But it would be far more convenient to not have to do that.

Doug


Scott



--
R. Douglas Martin
Professor Emeritus in Applied Mathematics and Statistics
Founder and Former Director of MS-CFRM Program
depts.washington.edu/compfin/ 
University of Washington


Doug,

I'm not sure that what you want (direct import without first exporting) 
is possible. Keep in mind that the source data frames / tables live 
inside an R session, to which LyX probably does not have access. So I'm 
pretty sure you will need to manually export the R objects, either by 
saving to .Rda files (and then importing them into a LyX document using 
a converter) or by running an R function/script that converts them to 
LaTeX or LyX source (or something else LyX can ingest).


Note that if you do your R work in an IDE, such as RStudio, you could 
probably set up an addin / plugin /  to do 
the export by invoking a shortcut.


Paul

--
Paul A. Rubin, Professor Emeritus
The Eli Broad College of Business
Michigan State University
Email: ru...@msu.edu 
Home page: https://rubin.msu.domains/
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-18 Thread Scott Kostyshak
On Mon, Jan 18, 2021 at 11:03:49AM -0800, Doug Martin wrote:
> On Mon, Jan 18, 2021 at 10:41 AM Scott Kostyshak  wrote:
> 
> > On Mon, Jan 18, 2021 at 07:25:42PM +0100, Jean-Marc Lasgouttes wrote:
> > > Le 14/01/2021 à 05:34, Doug Martin a écrit :
> > > > JMarc and all,
> > > >
> > > > Tom and I use knitr extensively for R code chunks, and we mostly use
> > > > kable with kableExtra to make tables.
> > > > The input to kable are R data frames, or data.tables, which are the
> > > > result of model fitting and related calculations.
> > > > But we like to put mathematical expressions in selected cells of
> > tables,
> > > > which is so easy with LYX tables, and we currently
> > > > have to make the data entry into LYX by hand from data tables and
> > > > data.tables in order to make use of that feature.
> > > > So it would be great if we could import R data tables and data.tables
> > > > into LYX tables, rather than using the kable/kableExtra
> > > > solution for our tables  (maybe I didn't make that clear in my earlier
> > > > email).  Then we would probably would drop use of
> > > > kable/kableExtra.
> > >
> > > So you want to import as .tex the result of R processing. This can be
> > done
> > > via "Paste from LaTeX". What would be missing for your intended usage?
> >
> > From what I understand, they would like to import a .Rds file without
> > having to manually convert it to LaTeX.
> >
> 
> Scott,
> 
> Definitely correct on the "without" part.  But we want to directly import
> an R object
> of class data.frame or data.table into an LYX table.
> 
> If we have to export such an object first, we would typically export it to
> an .Rda object.
> But it would be far more convenient to not have to do that.

Thanks for the clarification, Doug. It might help us to have a complete,
simple, example to play with. Can you give us the .lyx file and R
code/file? To make things perfectly clear to us, it might help to give
us a "before" version of the .lyx file and an "after" version of the
.lyx file. To create the "after" version you would have to do the steps
manually, but by seeing it we could make sure we understand what you
want to automate and what you expect the result to be.

Thanks for your patience,

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-18 Thread Jean-Marc Lasgouttes

Le 18/01/2021 à 20:03, Doug Martin a écrit :

 > So you want to import as .tex the result of R processing. This
can be done
 > via "Paste from LaTeX". What would be missing for your intended
usage?

 From what I understand, they would like to import a .Rds file without
having to manually convert it to LaTeX.

Definitely correct on the "without" part.  But we want to directly 
import an R object

of class data.frame or data.table into an LYX table.


But is there a univocal way of doing that that will please everyone? 
That seems difficult to me.


OTOH, it should not be that difficult to create a format for an R object 
and then a converter from there to .tex.


Then LyX will be able to import object in the way you want.

If we have to export such an object first, we would typically export it 
to an .Rda object.

But it would be far more convenient to not have to do that.


So you would like to take the object from R memory and make it appear 
magically in a LyX document? That looks a bit difficult to me.


Let's try something else (that I have no idea how to achieve, but at 
least which makes sense): we could want to transform a Chunk into its 
latex equivalent, that is run knitr/Sweave on this chunk only and then 
import the result in LyX. Is it what you have in mind?


At this point, an example file may be useful. One that does not depend 
on 45 nifty R modules, if possible ;)


JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-18 Thread Doug Martin
On Mon, Jan 18, 2021 at 10:41 AM Scott Kostyshak  wrote:

> On Mon, Jan 18, 2021 at 07:25:42PM +0100, Jean-Marc Lasgouttes wrote:
> > Le 14/01/2021 à 05:34, Doug Martin a écrit :
> > > JMarc and all,
> > >
> > > Tom and I use knitr extensively for R code chunks, and we mostly use
> > > kable with kableExtra to make tables.
> > > The input to kable are R data frames, or data.tables, which are the
> > > result of model fitting and related calculations.
> > > But we like to put mathematical expressions in selected cells of
> tables,
> > > which is so easy with LYX tables, and we currently
> > > have to make the data entry into LYX by hand from data tables and
> > > data.tables in order to make use of that feature.
> > > So it would be great if we could import R data tables and data.tables
> > > into LYX tables, rather than using the kable/kableExtra
> > > solution for our tables  (maybe I didn't make that clear in my earlier
> > > email).  Then we would probably would drop use of
> > > kable/kableExtra.
> >
> > So you want to import as .tex the result of R processing. This can be
> done
> > via "Paste from LaTeX". What would be missing for your intended usage?
>
> From what I understand, they would like to import a .Rds file without
> having to manually convert it to LaTeX.
>

Scott,

Definitely correct on the "without" part.  But we want to directly import
an R object
of class data.frame or data.table into an LYX table.

If we have to export such an object first, we would typically export it to
an .Rda object.
But it would be far more convenient to not have to do that.

Doug


> Scott
>


-- 
R. Douglas Martin
Professor Emeritus in Applied Mathematics and Statistics
Founder and Former Director of MS-CFRM Program
depts.washington.edu/compfin/
University of Washington
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-18 Thread Scott Kostyshak
On Mon, Jan 18, 2021 at 07:25:42PM +0100, Jean-Marc Lasgouttes wrote:
> Le 14/01/2021 à 05:34, Doug Martin a écrit :
> > JMarc and all,
> > 
> > Tom and I use knitr extensively for R code chunks, and we mostly use
> > kable with kableExtra to make tables.
> > The input to kable are R data frames, or data.tables, which are the
> > result of model fitting and related calculations.
> > But we like to put mathematical expressions in selected cells of tables,
> > which is so easy with LYX tables, and we currently
> > have to make the data entry into LYX by hand from data tables and
> > data.tables in order to make use of that feature.
> > So it would be great if we could import R data tables and data.tables
> > into LYX tables, rather than using the kable/kableExtra
> > solution for our tables  (maybe I didn't make that clear in my earlier
> > email).  Then we would probably would drop use of
> > kable/kableExtra.
> 
> So you want to import as .tex the result of R processing. This can be done
> via "Paste from LaTeX". What would be missing for your intended usage?

From what I understand, they would like to import a .Rds file without
having to manually convert it to LaTeX.

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-18 Thread Jean-Marc Lasgouttes

Le 14/01/2021 à 05:34, Doug Martin a écrit :

JMarc and all,

Tom and I use knitr extensively for R code chunks, and we mostly use 
kable with kableExtra to make tables.
The input to kable are R data frames, or data.tables, which are the 
result of model fitting and related calculations.
But we like to put mathematical expressions in selected cells of tables, 
which is so easy with LYX tables, and we currently
have to make the data entry into LYX by hand from data tables and 
data.tables in order to make use of that feature.
So it would be great if we could import R data tables and data.tables 
into LYX tables, rather than using the kable/kableExtra
solution for our tables  (maybe I didn't make that clear in my earlier 
email).  Then we would probably would drop use of

kable/kableExtra.


So you want to import as .tex the result of R processing. This can be 
done via "Paste from LaTeX". What would be missing for your intended usage?


JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-13 Thread Doug Martin
JMarc and all,

Tom and I use knitr extensively for R code chunks, and we mostly use kable
with kableExtra to make tables.
The input to kable are R data frames, or data.tables, which are the result
of model fitting and related calculations.
But we like to put mathematical expressions in selected cells of tables,
which is so easy with LYX tables, and we currently
have to make the data entry into LYX by hand from data tables and
data.tables in order to make use of that feature.
So it would be great if we could import R data tables and data.tables into
LYX tables, rather than using the kable/kableExtra
solution for our tables  (maybe I didn't make that clear in my earlier
email).  Then we would probably would drop use of
kable/kableExtra.

Thanks everyone for all the other comments.

Doug


On Wed, Jan 13, 2021 at 1:50 AM Jean-Marc Lasgouttes 
wrote:

> Le 13/01/2021 à 00:04, Doug Martin a écrit :
> > Tom and I are using various R packages for the book Portfolio
> > Construction and Risk Management that we are writing
> > using LYX.  A LYX feature that would help us in that effort a lot would
> > be the ability to import R data framesm and data.table
> > objects created using the excellent data.table package. Given the
> > thousands of R packages, and the popularity of the
> > data.table package, we guess that this import feature for LYX would
> > benefit a lot of people who use both R and LYX.
>
> Hi Doug,
>
> Did you consider using knitr or Sweave? They allow to insert raw R code
> in your document. I use that a lot and it is great.
>
> JMarc
>
> --
> lyx-devel mailing list
> lyx-devel@lists.lyx.org
> http://lists.lyx.org/mailman/listinfo/lyx-devel
>


-- 
R. Douglas Martin
Professor Emeritus in Applied Mathematics and Statistics
Founder and Former Director of MS-CFRM Program
depts.washington.edu/compfin/
University of Washington
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-13 Thread Doug Martin
Riki,

Thanks for the suggestion, which we will take a look at.

Doug

On Tue, Jan 12, 2021 at 4:39 PM Richard Kimberly Heck 
wrote:

> On 1/12/21 6:04 PM, Doug Martin wrote:
>
> Tom and I are using various R packages for the book Portfolio Construction
> and Risk Management that we are writing
> using LYX.  A LYX feature that would help us in that effort a lot would be
> the ability to import R data framesm and data.table
> objects created using the excellent data.table package. Given the
> thousands of R packages, and the popularity of the
> data.table package, we guess that this import feature for LYX would
> benefit a lot of people who use both R and LYX.
>
> Hi, Doug,
>
> Other people how use R (as I do not) will probably have more helpful
> things to say. But I suspect that this can be done using 'external
> templates'. Have a look at section 6 of the Customization manual and, more
> helpfully, the templates that already exist, which you will find in the
> xtemplates/ directory of you LyX system library directory (whose location
> is given in the About LyX dialog). If it looks like this might work, then
> there will be people here willing to help you write the template.
>
> Riki
>
> PS Glad you have found LyX so useful!
>
>
>

-- 
R. Douglas Martin
Professor Emeritus in Applied Mathematics and Statistics
Founder and Former Director of MS-CFRM Program
depts.washington.edu/compfin/
University of Washington
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-13 Thread Scott Kostyshak
On Wed, Jan 13, 2021 at 12:21:47PM -0500, Richard Kimberly Heck wrote:
> On 1/13/21 12:19 PM, Scott Kostyshak wrote:
> > Tom,
> >
> > No preferred Linux distribution and indeed we have users on the dev list 
> > and user list from several different ones.
> >
> > That said, I'm certain that such a command can be written for Windows, so 
> > don't switch just for that :). I just do not know how to write it on 
> > Windows. The main idea would be to use R to read the data.table and 
> > generate the LaTeX (e.g., using the xtable package or one of the many other 
> > packages to export LaTeX) and to then call the tex2lyx program that ships 
> > with LyX that imports LaTeX into LyX.
> 
> Scott, I don't know if you know this, or if it's relevant, but Windows
> 10 can be downloaded for free and installed into a virtual machine. That
> would give you a simple environment to test this.

That is good to know. I don't think I want to jump down that rabbit hole right 
now.

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-13 Thread Scott Kostyshak
On Wed, Jan 13, 2021 at 12:19:38PM -0500, Richard Kimberly Heck wrote:
> On 1/13/21 11:57 AM, Scott Kostyshak wrote:
> > On Wed, Jan 13, 2021 at 10:50:49AM +0100, Jean-Marc Lasgouttes wrote:
> >> Le 13/01/2021 à 00:04, Doug Martin a écrit :
> >>> Tom and I are using various R packages for the book Portfolio
> >>> Construction and Risk Management that we are writing
> >>> using LYX.  A LYX feature that would help us in that effort a lot would
> >>> be the ability to import R data framesm and data.table
> >>> objects created using the excellent data.table package. Given the
> >>> thousands of R packages, and the popularity of the
> >>> data.table package, we guess that this import feature for LYX would
> >>> benefit a lot of people who use both R and LYX.
> >> Hi Doug,
> >>
> >> Did you consider using knitr or Sweave? They allow to insert raw R code in
> >> your document. I use that a lot and it is great.
> > I also find knitr to be very helpful with tables.
> >
> > By the way, if you happen to be on Linux, I can write a simple command for 
> > you that does the conversion from a data.table to a .lyx file that has a 
> > table. I know you're proposing a feature that will benefit all LyX users, 
> > but I offer this nonetheless.
> 
> Can you write it in Python? Then it could function like other import
> scripts.

I could probably figure it out. But right now I don't have time. If Tom and 
Doug would find the command useful in a few months, I can work on it then.

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-13 Thread Richard Kimberly Heck
On 1/13/21 12:19 PM, Scott Kostyshak wrote:
> Tom,
>
> No preferred Linux distribution and indeed we have users on the dev list and 
> user list from several different ones.
>
> That said, I'm certain that such a command can be written for Windows, so 
> don't switch just for that :). I just do not know how to write it on Windows. 
> The main idea would be to use R to read the data.table and generate the LaTeX 
> (e.g., using the xtable package or one of the many other packages to export 
> LaTeX) and to then call the tex2lyx program that ships with LyX that imports 
> LaTeX into LyX.

Scott, I don't know if you know this, or if it's relevant, but Windows
10 can be downloaded for free and installed into a virtual machine. That
would give you a simple environment to test this.

Riki


> On Wed, Jan 13, 2021 at 05:15:21PM +, Thomas Philips wrote:
>> Scott,
>> Thanks for the gracious and generous offer,  but unfortunately we are on 
>> Windows,  not Linux. Out of curiosity,  is there a preferred Linux 
>> distribution for Lyx?
>>
>>
>> Tom
>>
>> Get Outlook for Android<https://aka.ms/ghei36>
>>
>> 
>> From: Scott Kostyshak 
>> Sent: Wednesday, January 13, 2021, 11:57 AM
>> To: Jean-Marc Lasgouttes
>> Cc: lyx-devel@lists.lyx.org; Doug Martin; Thomas Philips
>> Subject: Re: Feature Request from Doug Martin and Tom Philips
>>
>> On Wed, Jan 13, 2021 at 10:50:49AM +0100, Jean-Marc Lasgouttes wrote:
>>> Le 13/01/2021 à 00:04, Doug Martin a écrit :
>>>> Tom and I are using various R packages for the book Portfolio
>>>> Construction and Risk Management that we are writing
>>>> using LYX.  A LYX feature that would help us in that effort a lot would
>>>> be the ability to import R data framesm and data.table
>>>> objects created using the excellent data.table package. Given the
>>>> thousands of R packages, and the popularity of the
>>>> data.table package, we guess that this import feature for LYX would
>>>> benefit a lot of people who use both R and LYX.
>>> Hi Doug,
>>>
>>> Did you consider using knitr or Sweave? They allow to insert raw R code in
>>> your document. I use that a lot and it is great.
>> I also find knitr to be very helpful with tables.
>>
>> By the way, if you happen to be on Linux, I can write a simple command for 
>> you that does the conversion from a data.table to a .lyx file that has a 
>> table. I know you're proposing a feature that will benefit all LyX users, 
>> but I offer this nonetheless.
>>
>> Scott
>>
>>

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-13 Thread Richard Kimberly Heck
On 1/13/21 11:57 AM, Scott Kostyshak wrote:
> On Wed, Jan 13, 2021 at 10:50:49AM +0100, Jean-Marc Lasgouttes wrote:
>> Le 13/01/2021 à 00:04, Doug Martin a écrit :
>>> Tom and I are using various R packages for the book Portfolio
>>> Construction and Risk Management that we are writing
>>> using LYX.  A LYX feature that would help us in that effort a lot would
>>> be the ability to import R data framesm and data.table
>>> objects created using the excellent data.table package. Given the
>>> thousands of R packages, and the popularity of the
>>> data.table package, we guess that this import feature for LYX would
>>> benefit a lot of people who use both R and LYX.
>> Hi Doug,
>>
>> Did you consider using knitr or Sweave? They allow to insert raw R code in
>> your document. I use that a lot and it is great.
> I also find knitr to be very helpful with tables.
>
> By the way, if you happen to be on Linux, I can write a simple command for 
> you that does the conversion from a data.table to a .lyx file that has a 
> table. I know you're proposing a feature that will benefit all LyX users, but 
> I offer this nonetheless.

Can you write it in Python? Then it could function like other import
scripts.

Riki


-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-13 Thread Scott Kostyshak
Tom,

No preferred Linux distribution and indeed we have users on the dev list and 
user list from several different ones.

That said, I'm certain that such a command can be written for Windows, so don't 
switch just for that :). I just do not know how to write it on Windows. The 
main idea would be to use R to read the data.table and generate the LaTeX 
(e.g., using the xtable package or one of the many other packages to export 
LaTeX) and to then call the tex2lyx program that ships with LyX that imports 
LaTeX into LyX.

Best,
Scott


On Wed, Jan 13, 2021 at 05:15:21PM +, Thomas Philips wrote:
> Scott,
> Thanks for the gracious and generous offer,  but unfortunately we are on 
> Windows,  not Linux. Out of curiosity,  is there a preferred Linux 
> distribution for Lyx?
> 
> 
> Tom
> 
> Get Outlook for Android<https://aka.ms/ghei36>
> 
> 
> From: Scott Kostyshak 
> Sent: Wednesday, January 13, 2021, 11:57 AM
> To: Jean-Marc Lasgouttes
> Cc: lyx-devel@lists.lyx.org; Doug Martin; Thomas Philips
> Subject: Re: Feature Request from Doug Martin and Tom Philips
> 
> On Wed, Jan 13, 2021 at 10:50:49AM +0100, Jean-Marc Lasgouttes wrote:
> > Le 13/01/2021 à 00:04, Doug Martin a écrit :
> > > Tom and I are using various R packages for the book Portfolio
> > > Construction and Risk Management that we are writing
> > > using LYX.  A LYX feature that would help us in that effort a lot would
> > > be the ability to import R data framesm and data.table
> > > objects created using the excellent data.table package. Given the
> > > thousands of R packages, and the popularity of the
> > > data.table package, we guess that this import feature for LYX would
> > > benefit a lot of people who use both R and LYX.
> >
> > Hi Doug,
> >
> > Did you consider using knitr or Sweave? They allow to insert raw R code in
> > your document. I use that a lot and it is great.
> 
> I also find knitr to be very helpful with tables.
> 
> By the way, if you happen to be on Linux, I can write a simple command for 
> you that does the conversion from a data.table to a .lyx file that has a 
> table. I know you're proposing a feature that will benefit all LyX users, but 
> I offer this nonetheless.
> 
> Scott
> 


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-13 Thread Scott Kostyshak
On Wed, Jan 13, 2021 at 10:50:49AM +0100, Jean-Marc Lasgouttes wrote:
> Le 13/01/2021 à 00:04, Doug Martin a écrit :
> > Tom and I are using various R packages for the book Portfolio
> > Construction and Risk Management that we are writing
> > using LYX.  A LYX feature that would help us in that effort a lot would
> > be the ability to import R data framesm and data.table
> > objects created using the excellent data.table package. Given the
> > thousands of R packages, and the popularity of the
> > data.table package, we guess that this import feature for LYX would
> > benefit a lot of people who use both R and LYX.
> 
> Hi Doug,
> 
> Did you consider using knitr or Sweave? They allow to insert raw R code in
> your document. I use that a lot and it is great.

I also find knitr to be very helpful with tables.

By the way, if you happen to be on Linux, I can write a simple command for you 
that does the conversion from a data.table to a .lyx file that has a table. I 
know you're proposing a feature that will benefit all LyX users, but I offer 
this nonetheless.

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-13 Thread Jean-Marc Lasgouttes

Le 13/01/2021 à 00:04, Doug Martin a écrit :
Tom and I are using various R packages for the book Portfolio 
Construction and Risk Management that we are writing
using LYX.  A LYX feature that would help us in that effort a lot would 
be the ability to import R data framesm and data.table
objects created using the excellent data.table package. Given the 
thousands of R packages, and the popularity of the
data.table package, we guess that this import feature for LYX would 
benefit a lot of people who use both R and LYX.


Hi Doug,

Did you consider using knitr or Sweave? They allow to insert raw R code 
in your document. I use that a lot and it is great.


JMarc

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Feature Request from Doug Martin and Tom Philips

2021-01-12 Thread Richard Kimberly Heck
On 1/12/21 6:04 PM, Doug Martin wrote:
> Tom and I are using various R packages for the book Portfolio
> Construction and Risk Management that we are writing
> using LYX.  A LYX feature that would help us in that effort a lot
> would be the ability to import R data framesm and data.table
> objects created using the excellent data.table package. Given the
> thousands of R packages, and the popularity of the
> data.table package, we guess that this import feature for LYX would
> benefit a lot of people who use both R and LYX.

Hi, Doug,

Other people how use R (as I do not) will probably have more helpful
things to say. But I suspect that this can be done using 'external
templates'. Have a look at section 6 of the Customization manual and,
more helpfully, the templates that already exist, which you will find in
the xtemplates/ directory of you LyX system library directory (whose
location is given in the About LyX dialog). If it looks like this might
work, then there will be people here willing to help you write the template.

Riki

PS Glad you have found LyX so useful!


-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Feature Request from Doug Martin and Tom Philips

2021-01-12 Thread Doug Martin
Tom and I are using various R packages for the book Portfolio Construction
and Risk Management that we are writing
using LYX.  A LYX feature that would help us in that effort a lot would be
the ability to import R data framesm and data.table
objects created using the excellent data.table package. Given the thousands
of R packages, and the popularity of the
data.table package, we guess that this import feature for LYX would benefit
a lot of people who use both R and LYX.

Thanks in advance for considering this request.

Doug

-- 
R. Douglas Martin
Professor Emeritus in Applied Mathematics and Statistics
Founder and Former Director of MS-CFRM Program
depts.washington.edu/compfin/
University of Washington
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: #11953: Feature Request: Provide "table like" generation for figures

2020-08-31 Thread Jürgen Spitzmüller
Am Sonntag, den 30.08.2020, 11:49 -0500 schrieb Brian Davis:
> Dose attached Inkscape SVG help?

I don't think we can do a three-step menu button.

Jürgen


signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: #11953: Feature Request: Provide "table like" generation for figures

2020-08-30 Thread Richard Kimberly Heck
On 8/30/20 3:53 AM, Jürgen Spitzmüller wrote:
> Am Samstag, den 29.08.2020, 19:52 -0400 schrieb Richard Kimberly Heck:
>> I think the idea is this. Suppose you want four figures in your
>>
>> document, laid out in a 2x2 grid, with each row of figures aligned at
>>
>> the bottom. Then this widget would produce that.
> With "figure" meaning "figure floats", right? So something like the
> table templates we have in LyX 2.4.
>
> I'd have a hard time to come up with a sane UI for this, though.

I almost never use figures, so I don't have any clear sense how to do
this kind of thing.

Riki


-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: #11953: Feature Request: Provide "table like" generation for figures

2020-08-30 Thread Jürgen Spitzmüller
Am Samstag, den 29.08.2020, 19:52 -0400 schrieb Richard Kimberly Heck:
> I think the idea is this. Suppose you want four figures in your
> 
> document, laid out in a 2x2 grid, with each row of figures aligned at
> 
> the bottom. Then this widget would produce that.

With "figure" meaning "figure floats", right? So something like the
table templates we have in LyX 2.4.

I'd have a hard time to come up with a sane UI for this, though.

Jürgen


signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Fwd: Re: #11953: Feature Request: Provide "table like" generation for figures

2020-08-29 Thread Jean-Marc Lasgouttes



I transfer this message from Brian. Brian, it would be better to 
follow-up in the ticket itself.


JMarc

 Message transféré 
Sujet : Re: #11953: Feature Request: Provide "table like" generation for 
figures

Date : Sat, 29 Aug 2020 17:56:51 -0500
De : Brian Davis 
Pour : lyx-devel-ow...@lists.lyx.org


Also there is this:

https://wiki.lyx.org/LyX/Figures#subfigures for the Fig 1a Fig 1b and 
Fig X (at bottom of figure group)


If your asking what the actual UI button would look like I am thinking 1 
button that expands out into multiple buttons showing the fig 1  and Fig 
1a and other options (figure layout options). Then that button is select 
by user and the user than get the row / column generator selector (like 
table generator) to specify how may of that type of figure layout to 
generate.  Is this what you were asking. If so and still not clear I 
could doctor something up in paint.


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: #11953: Feature Request: Provide "table like" generation for figures

2020-08-29 Thread Richard Kimberly Heck
On 8/29/20 5:18 AM, Jürgen Spitzmüller wrote:
> Am Freitag, den 28.08.2020, 19:41 -0500 schrieb Brian Davis:
>> Tables you can click the icon to drag select how may cells are
>> desired it would be great of a row or colimm or x by y number of
>> figures could be created using the lyx rules for multiple figure
>> layout.  Granted it would require tweaking but at least the template
>> would be auto generated.  This would create multiple figure layouts
>> without having to did through the help file for how to create them.
>>
>> Does that help?
> Not really. Could you please upload an example document that shows some
> example graphics that would be produced by such a feature?

I think the idea is this. Suppose you want four figures in your
document, laid out in a 2x2 grid, with each row of figures aligned at
the bottom. Then this widget would produce that.

Riki


-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: #11953: Feature Request: Provide "table like" generation for figures

2020-08-29 Thread Jürgen Spitzmüller
Am Freitag, den 28.08.2020, 19:41 -0500 schrieb Brian Davis:
> Tables you can click the icon to drag select how may cells are
> desired it would be great of a row or colimm or x by y number of
> figures could be created using the lyx rules for multiple figure
> layout.  Granted it would require tweaking but at least the template
> would be auto generated.  This would create multiple figure layouts
> without having to did through the help file for how to create them.
> 
> Does that help?

Not really. Could you please upload an example document that shows some
example graphics that would be produced by such a feature?

Jürgen

> 
> 
> Sent from my U.S. Cellular® Smartphone


signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: command line execute strings; feature request

2018-05-27 Thread Richard Kimberly Heck
On 05/27/2018 08:43 AM, Kornel Benko wrote:
>
> Normally it is possible to use more than one execute-string. I would
> expect
>
> that the following
>
> lyx -x 'command-sequence buffer-new;buffer-import latex
> ams-import.tex;buffer-write;buffer-export pdf2;lyx-quit'
>
> would be equivalent to
>
> lyx -x buffer-new -x 'buffer-import latex ams-import.tex' -x
> buffer-write -x 'buffer-export pdf2' -x lyx-quit
>
> But, the call never ends, because the function 'lyx-quit' is not
> executed due to buffer-export still being busy.
>
> Changing the last two commands into a command-sequence cures it.
>

This is because command-sequence now disables background export, i.e.,
cloning, so we do wait for the command to finish. We don't do that when
just given the simple command. A "buffer-wait" command after the
buffer-export command would therefore come too late. What would work
would be buffer-export-wait or, perhaps, some kind of global
"background-disable" command that would do precisely that.

Riki



command line execute strings; feature request

2018-05-27 Thread Kornel Benko
Normally it is possible to use more than one execute-string. I would expect
that the following
lyx -x 'command-sequence buffer-new;buffer-import latex 
ams-import.tex;buffer-write;buffer-export pdf2;lyx-quit'
would be equivalent to
lyx -x buffer-new -x 'buffer-import latex ams-import.tex' -x 
buffer-write -x 'buffer-export pdf2' -x lyx-quit
But, the call never ends, because the function 'lyx-quit' is not executed due 
to buffer-export still being busy.
Changing the last two commands into a command-sequence cures it.

In this scenario, it would be nice to have a lyx-function like 'buffer-wait'.

Also, for long command sequences, it would be handy to interpret commands from 
a file, not only from the command line.

Kornel


signature.asc
Description: This is a digitally signed message part.


Re: [Feature Request] python binding

2014-06-02 Thread Alex Vergara Gil
From: Richard Heck rgh...@lyx.org
Sent: Thursday, May 29, 2014 5:05 PM
 I might be *completely* off, but couldn't you achieve exactly this via
 defining converters? I have for example a converter defined, which
 converts plantuml source fields into uml graphs, i.e. it defines the
 call to compile them and return the graphs which are then inserted in
 the document?
 
 Yes, that's more or less what I was suggesting.
 
 rh
 

Let's see if I understand:
1. I wrote a python script that produces the graphic I want
2. I insert it in LyX somehow I don't know, perhaps defining a converter from 
.py to svg, but this needs to be inside a module or every python script in LyX 
will try to be converted into a svg!! So a module is also needed
3. LyX is the one who knows the correct size of the graphic so in principle if 
I produce a svg should be enough but in this way I need to produce a new svg 
every time the data change

Take this simple script as example

import numpy as np
from numpy.random import randn
import matplotlib as mpl
import matplotlib.pyplot as plt
np.random.seed(9221999)
data = randn(75)
plt.hist(data)

which produce a graphic like this in spyder



So basically I save this graphic to a svg and then I load it into LyX, but why 
not letting LyX doing this automatically if it already handles with python?? 
This is my question.

Regards

Alex

Re: [Feature Request] python binding

2014-06-02 Thread Rainer M Krug
Alex Vergara Gil a...@cphr.edu.cu writes:

 From: Richard Heck rgh...@lyx.org
 Sent: Thursday, May 29, 2014 5:05 PM
 I might be *completely* off, but couldn't you achieve exactly this via
 defining converters? I have for example a converter defined, which
 converts plantuml source fields into uml graphs, i.e. it defines the
 call to compile them and return the graphs which are then inserted in
 the document?
 
 Yes, that's more or less what I was suggesting.
 
 rh
 


I just add comments inline

 Let's see if I understand:

-1. You define a *file type* in LyX under 
  Preferences  File Handling  File Formats
for the file type .pygr in which Vector graphics format is ticked!

0. You define a converter under
  Preferences  File Handling  Converters
which calls a script which executed files with the extension .pygr and
generates, as you suggest below, an svg.

 1. I wrote a python script that produces the graphic I want

Exactly - and you give it a specific extension .pygr for python
script which generates a graphic which you defined above.

 2. I insert it in LyX somehow I don't know, perhaps defining a
 converter from .py to svg, but this needs to be inside a module or
 every python script in LyX will try to be converted into a svg!! So a
 module is also needed

Use insert graphic and select *your .pygr* file as graphic - and Lyx
will do the rest of the conversion - i.e. use your converter to convert
the .pygr to an svg and other existing converters to generate the png
for the preview and the pdf / eps / ... for the final copmpilation of
the document.

 3. LyX is the one who knows the correct size of the graphic so in
 principle if I produce a svg should be enough but in this way I need
 to produce a new svg every time the data change

Correct - if the input data changes, you have to generate the graph again
manually, or, if the Converter file cache is disabled, you just have
to close the document and open it again. 

Hope this helps,

Rainer


 Take this simple script as example

 import numpy as np
 from numpy.random import randn
 import matplotlib as mpl
 import matplotlib.pyplot as plt
 np.random.seed(9221999)
 data = randn(75)
 plt.hist(data)

 which produce a graphic like this in spyder



 So basically I save this graphic to a svg and then I load it into LyX,
 but why not letting LyX doing this automatically if it already handles
 with python?? This is my question.

 Regards

 Alex

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


pgp4Tu7FsXx7J.pgp
Description: PGP signature


Re: [Feature Request] python binding

2014-06-02 Thread Alex Vergara Gil
This might work!! Thanks for the suggestions, I will try it extensively and 
I will comments my experiences afterwards. It seems it also renders the 
graphic inside LyX itself! That's what I was talking about.


Regards
Alex

- Original Message - 
From: Rainer M Krug rai...@krugs.de

To: Alex Vergara Gil a...@cphr.edu.cu
Cc: Richard Heck rgh...@lyx.org; lyx-users Users 
lyx-us...@lists.lyx.org; lyx-devel@lists.lyx.org

Sent: Monday, June 02, 2014 8:31 AM
Subject: Re: [Feature Request] python binding

I just add comments inline


Let's see if I understand:


-1. You define a *file type* in LyX under
 Preferences  File Handling  File Formats
for the file type .pygr in which Vector graphics format is ticked!

0. You define a converter under
 Preferences  File Handling  Converters
which calls a script which executed files with the extension .pygr and
generates, as you suggest below, an svg.


1. I wrote a python script that produces the graphic I want


Exactly - and you give it a specific extension .pygr for python
script which generates a graphic which you defined above.


2. I insert it in LyX somehow I don't know, perhaps defining a
converter from .py to svg, but this needs to be inside a module or
every python script in LyX will try to be converted into a svg!! So a
module is also needed


Use insert graphic and select *your .pygr* file as graphic - and Lyx
will do the rest of the conversion - i.e. use your converter to convert
the .pygr to an svg and other existing converters to generate the png
for the preview and the pdf / eps / ... for the final copmpilation of
the document.


3. LyX is the one who knows the correct size of the graphic so in
principle if I produce a svg should be enough but in this way I need
to produce a new svg every time the data change


Correct - if the input data changes, you have to generate the graph again
manually, or, if the Converter file cache is disabled, you just have
to close the document and open it again.

Hope this helps,

Rainer



Re: [Feature Request] python binding

2014-06-02 Thread Alex Vergara Gil
From: "Richard Heck" 
Sent: Thursday, May 29, 2014 5:05 PM
>> I might be *completely* off, but couldn't you achieve exactly this via
>> defining converters? I have for example a converter defined, which
>> "converts" plantuml source fields into uml graphs, i.e. it defines the
>> call to compile them and return the graphs which are then inserted in
>> the document?
> 
> Yes, that's more or less what I was suggesting.
> 
> rh
> 

Let's see if I understand:
1. I wrote a python script that produces the graphic I want
2. I insert it in LyX somehow I don't know, perhaps defining a converter from 
.py to svg, but this needs to be inside a module or every python script in LyX 
will try to be converted into a svg!! So a module is also needed
3. LyX is the one who knows the correct size of the graphic so in principle if 
I produce a svg should be enough but in this way I need to produce a new svg 
every time the data change

Take this simple script as example

import numpy as np
from numpy.random import randn
import matplotlib as mpl
import matplotlib.pyplot as plt
np.random.seed(9221999)
data = randn(75)
plt.hist(data)

which produce a graphic like this in spyder



So basically I save this graphic to a svg and then I load it into LyX, but why 
not letting LyX doing this automatically if it already handles with python?? 
This is my question.

Regards

Alex

Re: [Feature Request] python binding

2014-06-02 Thread Rainer M Krug
"Alex Vergara Gil"  writes:

> From: "Richard Heck" 
> Sent: Thursday, May 29, 2014 5:05 PM
>>> I might be *completely* off, but couldn't you achieve exactly this via
>>> defining converters? I have for example a converter defined, which
>>> "converts" plantuml source fields into uml graphs, i.e. it defines the
>>> call to compile them and return the graphs which are then inserted in
>>> the document?
>> 
>> Yes, that's more or less what I was suggesting.
>> 
>> rh
>> 
>

I just add comments inline

> Let's see if I understand:

-1. You define a *file type* in LyX under 
  Preferences > File Handling > File Formats
for the file type .pygr in which "Vector graphics format" is ticked!

0. You define a converter under
  Preferences > File Handling > Converters
which calls a script which executed files with the extension .pygr and
generates, as you suggest below, an svg.

> 1. I wrote a python script that produces the graphic I want

Exactly - and you give it a specific extension .pygr for "python
script which generates a graphic" which you defined above.

> 2. I insert it in LyX somehow I don't know, perhaps defining a
> converter from .py to svg, but this needs to be inside a module or
> every python script in LyX will try to be converted into a svg!! So a
> module is also needed

Use insert graphic and select *your .pygr* file as graphic - and Lyx
will do the rest of the conversion - i.e. use your converter to convert
the .pygr to an svg and other existing converters to generate the png
for the preview and the pdf / eps / ... for the final copmpilation of
the document.

> 3. LyX is the one who knows the correct size of the graphic so in
> principle if I produce a svg should be enough but in this way I need
> to produce a new svg every time the data change

Correct - if the input data changes, you have to generate the graph again
manually, or, if the "Converter file cache" is disabled, you just have
to close the document and open it again. 

Hope this helps,

Rainer

>
> Take this simple script as example
>
> import numpy as np
> from numpy.random import randn
> import matplotlib as mpl
> import matplotlib.pyplot as plt
> np.random.seed(9221999)
> data = randn(75)
> plt.hist(data)
>
> which produce a graphic like this in spyder
>
>
>
> So basically I save this graphic to a svg and then I load it into LyX,
> but why not letting LyX doing this automatically if it already handles
> with python?? This is my question.
>
> Regards
>
> Alex

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


pgp4Tu7FsXx7J.pgp
Description: PGP signature


Re: [Feature Request] python binding

2014-06-02 Thread Alex Vergara Gil
This might work!! Thanks for the suggestions, I will try it extensively and 
I will comments my experiences afterwards. It seems it also renders the 
graphic inside LyX itself! That's what I was talking about.


Regards
Alex

- Original Message - 
From: "Rainer M Krug" <rai...@krugs.de>

To: "Alex Vergara Gil" <a...@cphr.edu.cu>
Cc: "Richard Heck" <rgh...@lyx.org>; "lyx-users Users" 
<lyx-us...@lists.lyx.org>; <lyx-devel@lists.lyx.org>

Sent: Monday, June 02, 2014 8:31 AM
Subject: Re: [Feature Request] python binding

I just add comments inline


Let's see if I understand:


-1. You define a *file type* in LyX under
 Preferences > File Handling > File Formats
for the file type .pygr in which "Vector graphics format" is ticked!

0. You define a converter under
 Preferences > File Handling > Converters
which calls a script which executed files with the extension .pygr and
generates, as you suggest below, an svg.


1. I wrote a python script that produces the graphic I want


Exactly - and you give it a specific extension .pygr for "python
script which generates a graphic" which you defined above.


2. I insert it in LyX somehow I don't know, perhaps defining a
converter from .py to svg, but this needs to be inside a module or
every python script in LyX will try to be converted into a svg!! So a
module is also needed


Use insert graphic and select *your .pygr* file as graphic - and Lyx
will do the rest of the conversion - i.e. use your converter to convert
the .pygr to an svg and other existing converters to generate the png
for the preview and the pdf / eps / ... for the final copmpilation of
the document.


3. LyX is the one who knows the correct size of the graphic so in
principle if I produce a svg should be enough but in this way I need
to produce a new svg every time the data change


Correct - if the input data changes, you have to generate the graph again
manually, or, if the "Converter file cache" is disabled, you just have
to close the document and open it again.

Hope this helps,

Rainer



Re: [Feature Request] quality ePub export: Was [Feature Request] python binding

2014-05-30 Thread stefano franchi
Hi Steve,

I am bringing this back to the lyx-devel list, where it belongs (I
responded privately by mistake)

On Thu, May 29, 2014 at 9:14 PM, Steve Litt sl...@troubleshooters.com
wrote:

 On Thu, 29 May 2014 14:55:02 -0500
 stefano franchi stefano.fran...@gmail.com wrote:

  On Thu, May 29, 2014 at 2:35 PM, Steve Litt
  sl...@troubleshooters.com wrote:
 
   On Thu, 29 May 2014 14:36:29 -0500
   Alex Vergara Gil a...@cphr.edu.cu wrote:
  
Hello Lyxers
   
I wonder why LyX is not available to process little pieces of
python code within its own framework, like ipython notebook for
instance?? This feature allows us to have beautiful graphics such
the one produced by matplotlib package. I know there already
exists a similar binding for R through knitr module, so why not a
binding for python too??
   
Is there a way, like modules or whatever, to achieve the same
functionality or at least some basic functionality of ipython
notebook within LyX??
  
   Oh, if we're going consider requests for difficult additions to
   handle a small subset of needs like beautiful graphics, how about
   filling the GAPING HOLE that there's no practical way to export to
   ePub, without massive human intervention and end-user programming?
   None of LyX's HTML and xHtml exports are remotely suitable for
   flowing-text eBook production, especially because different people
   have different ideas of how eBooks should be built.
  
   Personally, I think the easiest way forward on this is to take the
   current half XML half something else native format, and make it well
   formed XML. No doing favors of renaming graphics files with
   arbitrary numbers, no doing favors of making obvious hierarchy into
   div, just make the native format XML and let anyone with Python
   and lxml.etree have his way with the native LyX file.
  
   I know that two years ago I railed against XML native format, but
   parsers have gotten better, and right now we have the human
   unreadability of XML, combined with the unparsability of a more TeX
   like language. Well formed XML can only be an improvement.
  
   If well formed XML native format is not practical in the near
   future, perhaps somebody could make a program that exports the
   current native format into well-formed XML, once again without
   renumbering, throwing away structure, etc. Basically, just pass the
   environments through: No need to map Part to h1, once it's XML,
   we can trivially do that ourselves, the way we want to. Given that
   most eBooks don't do a lot of bibliography stuff, you could even
   have an initial version that has hooks for the bibliography stuff
   but doesn't actually do it. Put in the bibliographies next time. If
   it's not perfect with math, that's fine: I can't think of anything
   more frustrating than trying to read a math book on a small device.
  
   Because of LyX's inability to author flowing text eBooks in any
   reasonable way, I haven't used LyX in 9 months: I'm authoring with
   Bluefish now. Slow, difficult, crashy, but at least my source
   document can produce both print, PDF and ePub.
  
   Maybe it's just me, but if there's one feature LyX should really
   have in 2014, I think that one feature is a reasonable export
   mechanism to something that can be turned into ePub, without
   undoing all the BS the current LyX (x)Html converters throw into
   the export.
  
   Mark my words: Within two years, beautiful graphics won't matter one
   bit if the document can't be read on a small device.
  
  
 
  Steve,
 
  would the ODT converter that is the topic of one of our GSOC projects
  work for the task you are pushing for?
  After all, ODT *is* XML (for some reading of XML). I know too little
  about the XML and e-pub formats to answer that question, but perhaps
  you could take a look at the project description on the wiki [1] and
  let us know what you think?
  The project currently targets a subset of LyX's full functionalities
  (only one class, only a subset of graphic formats, etc.). I would be
  curious to know if these limitations prevent it to be used for epub
  conversion (direct or otherwise).
 

 Hi Stefano,

 Thanks for asking. I appreciate it.

 I'll give four answers to your question:
 * The precise answer
 * A speculative answer
 * What's really needed
 * Comments


 THE PRECISE ANSWER
 I don't know whether the exported ODT file will serve as a practical
 intermediate step for making an ePub. I won't know that until the
 software's been finished in August.


Fair enough.


 THE SPECULATIVE ANSWER
 I doubt the exported ODT file would be helpful in building ePubs. I've
 explored ODT, and although it's XML, its purpose is to work with
 LibreOffice, not to convey semantic information. If ODT were a
 database, it would be universally cursed as the most denormalized
 database ever. Change something one place, you need to change it in five
 more. And speaking of that, it's not even a single 

Re: [Feature Request] quality ePub export: Was [Feature Request] python binding

2014-05-30 Thread stefano franchi
Hi Steve,

I am bringing this back to the lyx-devel list, where it belongs (I
responded privately by mistake)

On Thu, May 29, 2014 at 9:14 PM, Steve Litt 
wrote:

> On Thu, 29 May 2014 14:55:02 -0500
> stefano franchi  wrote:
>
> > On Thu, May 29, 2014 at 2:35 PM, Steve Litt
> >  wrote:
> >
> > > On Thu, 29 May 2014 14:36:29 -0500
> > > "Alex Vergara Gil"  wrote:
> > >
> > > > Hello Lyxers
> > > >
> > > > I wonder why LyX is not available to process little pieces of
> > > > python code within its own framework, like ipython notebook for
> > > > instance?? This feature allows us to have beautiful graphics such
> > > > the one produced by matplotlib package. I know there already
> > > > exists a similar binding for R through knitr module, so why not a
> > > > binding for python too??
> > > >
> > > > Is there a way, like modules or whatever, to achieve the same
> > > > functionality or at least some basic functionality of ipython
> > > > notebook within LyX??
> > >
> > > Oh, if we're going consider requests for difficult additions to
> > > handle a small subset of needs like beautiful graphics, how about
> > > filling the GAPING HOLE that there's no practical way to export to
> > > ePub, without massive human intervention and end-user programming?
> > > None of LyX's HTML and xHtml exports are remotely suitable for
> > > flowing-text eBook production, especially because different people
> > > have different ideas of how eBooks should be built.
> > >
> > > Personally, I think the easiest way forward on this is to take the
> > > current half XML half something else native format, and make it well
> > > formed XML. No doing favors of renaming graphics files with
> > > arbitrary numbers, no doing favors of making obvious hierarchy into
> > > , just make the native format XML and let anyone with Python
> > > and lxml.etree have his way with the native LyX file.
> > >
> > > I know that two years ago I railed against XML native format, but
> > > parsers have gotten better, and right now we have the human
> > > unreadability of XML, combined with the unparsability of a more TeX
> > > like language. Well formed XML can only be an improvement.
> > >
> > > If well formed XML native format is not practical in the near
> > > future, perhaps somebody could make a program that exports the
> > > current native format into well-formed XML, once again without
> > > renumbering, throwing away structure, etc. Basically, just pass the
> > > environments through: No need to map Part to , once it's XML,
> > > we can trivially do that ourselves, the way we want to. Given that
> > > most eBooks don't do a lot of bibliography stuff, you could even
> > > have an initial version that has hooks for the bibliography stuff
> > > but doesn't actually do it. Put in the bibliographies next time. If
> > > it's not perfect with math, that's fine: I can't think of anything
> > > more frustrating than trying to read a math book on a small device.
> > >
> > > Because of LyX's inability to author flowing text eBooks in any
> > > reasonable way, I haven't used LyX in 9 months: I'm authoring with
> > > Bluefish now. Slow, difficult, crashy, but at least my source
> > > document can produce both print, PDF and ePub.
> > >
> > > Maybe it's just me, but if there's one feature LyX should really
> > > have in 2014, I think that one feature is a reasonable export
> > > mechanism to something that can be turned into ePub, without
> > > undoing all the BS the current LyX (x)Html converters throw into
> > > the export.
> > >
> > > Mark my words: Within two years, beautiful graphics won't matter one
> > > bit if the document can't be read on a small device.
> > >
> > >
> >
> > Steve,
> >
> > would the ODT converter that is the topic of one of our GSOC projects
> > work for the task you are pushing for?
> > After all, ODT *is* XML (for some reading of XML). I know too little
> > about the XML and e-pub formats to answer that question, but perhaps
> > you could take a look at the project description on the wiki [1] and
> > let us know what you think?
> > The project currently targets a subset of LyX's full functionalities
> > (only one class, only a subset of graphic formats, etc.). I would be
> > curious to know if these limitations prevent it to be used for epub
> > conversion (direct or otherwise).
> >
>
> Hi Stefano,
>
> Thanks for asking. I appreciate it.
>
> I'll give four answers to your question:
> * The precise answer
> * A speculative answer
> * What's really needed
> * Comments
>
>
> THE PRECISE ANSWER
> I don't know whether the exported ODT file will serve as a practical
> intermediate step for making an ePub. I won't know that until the
> software's been finished in August.
>
>
Fair enough.

>
> THE SPECULATIVE ANSWER
> I doubt the exported ODT file would be helpful in building ePubs. I've
> explored ODT, and although it's XML, its purpose is to work 

[Feature Request] python binding

2014-05-29 Thread Alex Vergara Gil
Hello Lyxers

I wonder why LyX is not available to process little pieces of python code 
within its own framework, like ipython notebook for instance??
This feature allows us to have beautiful graphics such the one produced by 
matplotlib package. I know there already exists a similar binding for R through 
knitr module, so why not a binding for python too??

Is there a way, like modules or whatever, to achieve the same functionality or 
at least some basic functionality of ipython notebook within LyX??

Regards
Alex Vergara
MSc Nuclear Physics
SSDL, CPHR, Havana, Cuba

Re: [Feature Request] python binding

2014-05-29 Thread Richard Heck

On 05/29/2014 03:36 PM, Alex Vergara Gil wrote:

Hello Lyxers
I wonder why LyX is not available to process little pieces of python 
code within its own framework, like ipython notebook for instance??


This feature allows us to have beautiful graphics such the one 
produced by matplotlib package. I know there already exists a similar 
binding for R through knitr module, so why not a binding for python too??
Is there a way, like modules or whatever, to achieve the same 
functionality or at least some basic functionality of ipython notebook 
within LyX??


Can you be more precise about what you want to do? I've never heard of 
ipython notebook.


Sweave works by our having an output format (sweave) for such 
documentsand then our declaring Rscript as a sweave -- LaTeX converter, 
so PDF export (say) goes via Rscript and pdflatex. There's a special 
script in lib/scripts/ that sets up some things for LyXfirst, or so it 
claims. It would be reasonably easy to do the same sort of thing for 
Python, if you wanted to do so. You'd just need to set up an appropriate 
format and then declare an appropriate script as a whatever - latex 
converter. Then LyX will run the script and do as you wish with the 
embedded python code.


Of course, as we've discussed on the list with respect to R, there are 
large security issues here, too.


Richard



Re: [Feature Request] python binding

2014-05-29 Thread Alex Vergara Gil

  From: Richard Heck 
  Sent: Thursday, May 29, 2014 3:26 PM


  On 05/29/2014 03:36 PM, Alex Vergara Gil wrote:

Hello Lyxers

I wonder why LyX is not available to process little pieces of python code 
within its own framework, like ipython notebook for instance??


This feature allows us to have beautiful graphics such the one produced by 
matplotlib package. I know there already exists a similar binding for R through 
knitr module, so why not a binding for python too??

Is there a way, like modules or whatever, to achieve the same functionality 
or at least some basic functionality of ipython notebook within LyX??
  Can you be more precise about what you want to do? I've never heard of 
ipython notebook.
sudo aptitude install ipython-notebook
ipython notebook

and there you can write even thesis in a web environment with python commands 
being executed inlined, exporting to pdf and latex too, it is a wonder of our 
times, so why not letting LyX do this miracle too??

  Sweave works by our having an output format (sweave) for such documents and 
then our declaring Rscript as a sweave -- LaTeX converter, so PDF export (say) 
goes via Rscript and pdflatex. There's a special script in lib/scripts/ that 
sets up some things for LyX first, or so it claims. It would be reasonably 
easy to do the same sort of thing for Python, if you wanted to do so. You'd 
just need to set up an appropriate format and then declare an appropriate 
script as a whatever - latex converter. Then LyX will run the script and do as 
you wish with the embedded python code.

  Of course, as we've discussed on the list with respect to R, there are large 
security issues here, too.

  Richard
you obviously miss the point here, or I was not very clear! it is not a 
different format, is a facility to have python scripts running within LyX 
framework, you have to see ipython notebook to understand what I mean, you will 
be surprised!!
Basically to build graphs, for instance (and only a piece of what can be done), 
you add the (let's call it) knitpy module and then place a knitpy insert, 
write some python code that produces a matplotlib graphic and then when lyx 
compiles the document, instead of the code it is shown the graph, it also can 
be done in the lyx editing window, but thats a more dificult request.

Regards
Alex

Re: [Feature Request] python binding

2014-05-29 Thread Rainer M Krug
Alex Vergara Gil a...@cphr.edu.cu writes:

   From: Richard Heck 
   Sent: Thursday, May 29, 2014 3:26 PM


   On 05/29/2014 03:36 PM, Alex Vergara Gil wrote:

 Hello Lyxers

 I wonder why LyX is not available to process little pieces of
 python code within its own framework, like ipython notebook for
 instance??


 This feature allows us to have beautiful graphics such the one
 produced by matplotlib package. I know there already exists a
 similar binding for R through knitr module, so why not a binding
 for python too??

 Is there a way, like modules or whatever, to achieve the same
 functionality or at least some basic functionality of ipython notebook
 within LyX??  Can you be more precise about what you want to do? I've
 never heard of ipython notebook.  sudo aptitude install
 ipython-notebook ipython notebook

 and there you can write even thesis in a web environment with python
 commands being executed inlined, exporting to pdf and latex too, it is
 a wonder of our times, so why not letting LyX do this miracle too??

   Sweave works by our having an output format (sweave) for such
   documents and then our declaring Rscript as a sweave -- LaTeX
   converter, so PDF export (say) goes via Rscript and
   pdflatex. There's a special script in lib/scripts/ that sets up
   some things for LyX first, or so it claims. It would be reasonably
   easy to do the same sort of thing for Python, if you wanted to do
   so. You'd just need to set up an appropriate format and then declare
   an appropriate script as a whatever - latex converter. Then LyX
   will run the script and do as you wish with the embedded python
   code.

   Of course, as we've discussed on the list with respect to R, there are 
 large security issues here, too.

   Richard you obviously miss the point here, or I was not very clear!
 it is not a different format, is a facility to have python scripts
 running within LyX framework, you have to see ipython notebook to
 understand what I mean, you will be surprised!!  Basically to build
 graphs, for instance (and only a piece of what can be done), you add
 the (let's call it) knitpy module and then place a knitpy insert,
 write some python code that produces a matplotlib graphic and then
 when lyx compiles the document, instead of the code it is shown the
 graph, it also can be done in the lyx editing window, but thats a more
 dificult request.

I might be *completely* off, but couldn't you achieve exactly this via
defining converters? I have for example a converter defined, which
converts plantuml source fields into uml graphs, i.e. it defines the
call to compile them and return the graphs which are then inserted in
the document?

I have never used python, but I guess a similar approach should be
possible here as well?

Cheers,

Rainer



 Regards
 Alex

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


pgpK0dzVm8JCx.pgp
Description: PGP signature


Re: [Feature Request] python binding

2014-05-29 Thread Richard Heck

On 05/29/2014 05:34 PM, Alex Vergara Gil wrote:


*From:* Richard Heck mailto:rgh...@lyx.org
*Sent:* Thursday, May 29, 2014 3:26 PM

On 05/29/2014 03:36 PM, Alex Vergara Gil wrote:

Hello Lyxers
I wonder why LyX is not available to process little pieces of
python code within its own framework, like ipython notebook for
instance??

This feature allows us to have beautiful graphics such the one
produced by matplotlib package. I know there already exists a
similar binding for R through knitr module, so why not a binding
for python too??
Is there a way, like modules or whatever, to achieve the same
functionality or at least some basic functionality of ipython
notebook within LyX??

Can you be more precise about what you want to do? I've never
heard of ipython notebook.

sudo aptitude install ipython-notebook
ipython notebook

and there you can write even thesis in a web environment with python 
commands being executed inlined, exporting to pdf and latex too, it is 
a wonder of our times, so why not letting LyX do this miracle too??


Sweave works by our having an output format (sweave) for such
documentsand then our declaring Rscript as a sweave -- LaTeX
converter, so PDF export (say) goes via Rscript and pdflatex.
There's a special script in lib/scripts/ that sets up some things
for LyXfirst, or so it claims. It would be reasonably easy to do
the same sort of thing for Python, if you wanted to do so. You'd
just need to set up an appropriate format and then declare an
appropriate script as a whatever - latex converter. Then LyX will
run the script and do as you wish with the embedded python code.

Of course, as we've discussed on the list with respect to R, there
are large security issues here, too.

Richard

you obviously miss the point here, or I was not very clear! it is not 
a different format, is a facility to have python scripts running 
within LyX framework, you have to see ipython notebook to understand 
what I mean, you will be surprised!!
Basically to build graphs, for instance (and only a piece of what can 
be done), you add the (let's call it) knitpy module and then place a 
knitpy insert, write some python code that produces a matplotlib 
graphic and then when lyx compiles the document, instead of the code 
it is shown the graph, it also can be done in the lyx editing window, 
but thats a more dificult request.


No, that's exactly what I had in mind: Python code inthe document that 
gets executed at compile timeto create graphsor tables---or delete all 
your files. ;-) Formats are a LyX-internal method for keeping track of 
such thingsas what stage of compilation a document is at. The file 
format wouldn't really be different.


Richard



Re: [Feature Request] python binding

2014-05-29 Thread Richard Heck

On 05/29/2014 04:57 PM, Rainer M Krug wrote:

Alex Vergara Gil a...@cphr.edu.cu writes:

   Richard you obviously miss the point here, or I was not very clear!
it is not a different format, is a facility to have python scripts
running within LyX framework, you have to see ipython notebook to
understand what I mean, you will be surprised!!  Basically to build
graphs, for instance (and only a piece of what can be done), you add
the (let's call it) knitpy module and then place a knitpy insert,
write some python code that produces a matplotlib graphic and then
when lyx compiles the document, instead of the code it is shown the
graph, it also can be done in the lyx editing window, but thats a more
dificult request.
I might be *completely* off, but couldn't you achieve exactly this via
defining converters? I have for example a converter defined, which
converts plantuml source fields into uml graphs, i.e. it defines the
call to compile them and return the graphs which are then inserted in
the document?


Yes, that's more or less what I was suggesting.

rh



Re: [Feature Request] python binding

2014-05-29 Thread Scott Kostyshak
On Thu, May 29, 2014 at 3:36 PM, Alex Vergara Gil a...@cphr.edu.cu wrote:
 Hello Lyxers

 I wonder why LyX is not available to process little pieces of python code
 within its own framework, like ipython notebook for instance??
 This feature allows us to have beautiful graphics such the one produced by
 matplotlib package. I know there already exists a similar binding for R
 through knitr module, so why not a binding for python too??

 Is there a way, like modules or whatever, to achieve the same functionality
 or at least some basic functionality of ipython notebook within LyX??

Hi Alex,

Have you tried using knitr for python? Attached is a simple example
and the output created. For more info, see
http://yihui.name/knitr/demo/engines/ . graphics and everything else
should also work, although you might need to add custom hooks (not as
hard as it sounds).

This might not be ideal because you have to have R installed (knitr is
still itself written in R). But I would be curious in your thoughts.

Scott


python_knitr.21.lyx
Description: application/lyx


python_knitr.21.pdf
Description: Adobe PDF document


[Feature Request] python binding

2014-05-29 Thread Alex Vergara Gil
Hello Lyxers

I wonder why LyX is not available to process little pieces of python code 
within its own framework, like ipython notebook for instance??
This feature allows us to have beautiful graphics such the one produced by 
matplotlib package. I know there already exists a similar binding for R through 
knitr module, so why not a binding for python too??

Is there a way, like modules or whatever, to achieve the same functionality or 
at least some basic functionality of ipython notebook within LyX??

Regards
Alex Vergara
MSc Nuclear Physics
SSDL, CPHR, Havana, Cuba

Re: [Feature Request] python binding

2014-05-29 Thread Richard Heck

On 05/29/2014 03:36 PM, Alex Vergara Gil wrote:

Hello Lyxers
I wonder why LyX is not available to process little pieces of python 
code within its own framework, like ipython notebook for instance??


This feature allows us to have beautiful graphics such the one 
produced by matplotlib package. I know there already exists a similar 
binding for R through knitr module, so why not a binding for python too??
Is there a way, like modules or whatever, to achieve the same 
functionality or at least some basic functionality of ipython notebook 
within LyX??


Can you be more precise about what you want to do? I've never heard of 
ipython notebook.


Sweave works by our having an output format (sweave) for such 
documentsand then our declaring Rscript as a sweave --> LaTeX converter, 
so PDF export (say) goes via Rscript and pdflatex. There's a special 
script in lib/scripts/ that "sets up some things for LyX"first, or so it 
claims. It would be reasonably easy to do the same sort of thing for 
Python, if you wanted to do so. You'd just need to set up an appropriate 
format and then declare an appropriate script as a whatever -> latex 
converter. Then LyX will run the script and do as you wish with the 
embedded python code.


Of course, as we've discussed on the list with respect to R, there are 
large security issues here, too.


Richard



Re: [Feature Request] python binding

2014-05-29 Thread Alex Vergara Gil

  From: Richard Heck 
  Sent: Thursday, May 29, 2014 3:26 PM


  On 05/29/2014 03:36 PM, Alex Vergara Gil wrote:

Hello Lyxers

I wonder why LyX is not available to process little pieces of python code 
within its own framework, like ipython notebook for instance??


This feature allows us to have beautiful graphics such the one produced by 
matplotlib package. I know there already exists a similar binding for R through 
knitr module, so why not a binding for python too??

Is there a way, like modules or whatever, to achieve the same functionality 
or at least some basic functionality of ipython notebook within LyX??
  Can you be more precise about what you want to do? I've never heard of 
ipython notebook.
sudo aptitude install ipython-notebook
ipython notebook

and there you can write even thesis in a web environment with python commands 
being executed inlined, exporting to pdf and latex too, it is a wonder of our 
times, so why not letting LyX do this miracle too??

  Sweave works by our having an output format (sweave) for such documents and 
then our declaring Rscript as a sweave --> LaTeX converter, so PDF export (say) 
goes via Rscript and pdflatex. There's a special script in lib/scripts/ that 
"sets up some things for LyX" first, or so it claims. It would be reasonably 
easy to do the same sort of thing for Python, if you wanted to do so. You'd 
just need to set up an appropriate format and then declare an appropriate 
script as a whatever -> latex converter. Then LyX will run the script and do as 
you wish with the embedded python code.

  Of course, as we've discussed on the list with respect to R, there are large 
security issues here, too.

  Richard
you obviously miss the point here, or I was not very clear! it is not a 
different format, is a facility to have python scripts running within LyX 
framework, you have to see ipython notebook to understand what I mean, you will 
be surprised!!
Basically to build graphs, for instance (and only a piece of what can be done), 
you add the (let's call it) "knitpy" module and then place a knitpy insert, 
write some python code that produces a matplotlib graphic and then when lyx 
compiles the document, instead of the code it is shown the graph, it also can 
be done in the lyx editing window, but thats a more dificult request.

Regards
Alex

Re: [Feature Request] python binding

2014-05-29 Thread Rainer M Krug
"Alex Vergara Gil"  writes:

>   From: Richard Heck 
>   Sent: Thursday, May 29, 2014 3:26 PM
>
>
>   On 05/29/2014 03:36 PM, Alex Vergara Gil wrote:
>
> Hello Lyxers
>
> I wonder why LyX is not available to process little pieces of
> python code within its own framework, like ipython notebook for
> instance??
>
>
> This feature allows us to have beautiful graphics such the one
> produced by matplotlib package. I know there already exists a
> similar binding for R through knitr module, so why not a binding
> for python too??
>
> Is there a way, like modules or whatever, to achieve the same
> functionality or at least some basic functionality of ipython notebook
> within LyX??  Can you be more precise about what you want to do? I've
> never heard of ipython notebook.  sudo aptitude install
> ipython-notebook ipython notebook
>
> and there you can write even thesis in a web environment with python
> commands being executed inlined, exporting to pdf and latex too, it is
> a wonder of our times, so why not letting LyX do this miracle too??
>
>   Sweave works by our having an output format (sweave) for such
>   documents and then our declaring Rscript as a sweave --> LaTeX
>   converter, so PDF export (say) goes via Rscript and
>   pdflatex. There's a special script in lib/scripts/ that "sets up
>   some things for LyX" first, or so it claims. It would be reasonably
>   easy to do the same sort of thing for Python, if you wanted to do
>   so. You'd just need to set up an appropriate format and then declare
>   an appropriate script as a whatever -> latex converter. Then LyX
>   will run the script and do as you wish with the embedded python
>   code.
>
>   Of course, as we've discussed on the list with respect to R, there are 
> large security issues here, too.
>
>   Richard you obviously miss the point here, or I was not very clear!
> it is not a different format, is a facility to have python scripts
> running within LyX framework, you have to see ipython notebook to
> understand what I mean, you will be surprised!!  Basically to build
> graphs, for instance (and only a piece of what can be done), you add
> the (let's call it) "knitpy" module and then place a knitpy insert,
> write some python code that produces a matplotlib graphic and then
> when lyx compiles the document, instead of the code it is shown the
> graph, it also can be done in the lyx editing window, but thats a more
> dificult request.

I might be *completely* off, but couldn't you achieve exactly this via
defining converters? I have for example a converter defined, which
"converts" plantuml source fields into uml graphs, i.e. it defines the
call to compile them and return the graphs which are then inserted in
the document?

I have never used python, but I guess a similar approach should be
possible here as well?

Cheers,

Rainer


>
> Regards
> Alex

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


pgpK0dzVm8JCx.pgp
Description: PGP signature


Re: [Feature Request] python binding

2014-05-29 Thread Richard Heck

On 05/29/2014 05:34 PM, Alex Vergara Gil wrote:


*From:* Richard Heck 
*Sent:* Thursday, May 29, 2014 3:26 PM

On 05/29/2014 03:36 PM, Alex Vergara Gil wrote:

Hello Lyxers
I wonder why LyX is not available to process little pieces of
python code within its own framework, like ipython notebook for
instance??

This feature allows us to have beautiful graphics such the one
produced by matplotlib package. I know there already exists a
similar binding for R through knitr module, so why not a binding
for python too??
Is there a way, like modules or whatever, to achieve the same
functionality or at least some basic functionality of ipython
notebook within LyX??

Can you be more precise about what you want to do? I've never
heard of ipython notebook.

sudo aptitude install ipython-notebook
ipython notebook

and there you can write even thesis in a web environment with python 
commands being executed inlined, exporting to pdf and latex too, it is 
a wonder of our times, so why not letting LyX do this miracle too??


Sweave works by our having an output format (sweave) for such
documentsand then our declaring Rscript as a sweave --> LaTeX
converter, so PDF export (say) goes via Rscript and pdflatex.
There's a special script in lib/scripts/ that "sets up some things
for LyX"first, or so it claims. It would be reasonably easy to do
the same sort of thing for Python, if you wanted to do so. You'd
just need to set up an appropriate format and then declare an
appropriate script as a whatever -> latex converter. Then LyX will
run the script and do as you wish with the embedded python code.

Of course, as we've discussed on the list with respect to R, there
are large security issues here, too.

Richard

you obviously miss the point here, or I was not very clear! it is not 
a different format, is a facility to have python scripts running 
within LyX framework, you have to see ipython notebook to understand 
what I mean, you will be surprised!!
Basically to build graphs, for instance (and only a piece of what can 
be done), you add the (let's call it) "knitpy" module and then place a 
knitpy insert, write some python code that produces a matplotlib 
graphic and then when lyx compiles the document, instead of the code 
it is shown the graph, it also can be done in the lyx editing window, 
but thats a more dificult request.


No, that's exactly what I had in mind: Python code inthe document that 
gets executed at compile timeto create graphsor tables---or delete all 
your files. ;-) Formats are a LyX-internal method for keeping track of 
such thingsas what stage of compilation a document is at. The file 
format wouldn't really be different.


Richard



Re: [Feature Request] python binding

2014-05-29 Thread Richard Heck

On 05/29/2014 04:57 PM, Rainer M Krug wrote:

"Alex Vergara Gil"  writes:

   Richard you obviously miss the point here, or I was not very clear!
it is not a different format, is a facility to have python scripts
running within LyX framework, you have to see ipython notebook to
understand what I mean, you will be surprised!!  Basically to build
graphs, for instance (and only a piece of what can be done), you add
the (let's call it) "knitpy" module and then place a knitpy insert,
write some python code that produces a matplotlib graphic and then
when lyx compiles the document, instead of the code it is shown the
graph, it also can be done in the lyx editing window, but thats a more
dificult request.
I might be *completely* off, but couldn't you achieve exactly this via
defining converters? I have for example a converter defined, which
"converts" plantuml source fields into uml graphs, i.e. it defines the
call to compile them and return the graphs which are then inserted in
the document?


Yes, that's more or less what I was suggesting.

rh



Re: [Feature Request] python binding

2014-05-29 Thread Scott Kostyshak
On Thu, May 29, 2014 at 3:36 PM, Alex Vergara Gil  wrote:
> Hello Lyxers
>
> I wonder why LyX is not available to process little pieces of python code
> within its own framework, like ipython notebook for instance??
> This feature allows us to have beautiful graphics such the one produced by
> matplotlib package. I know there already exists a similar binding for R
> through knitr module, so why not a binding for python too??
>
> Is there a way, like modules or whatever, to achieve the same functionality
> or at least some basic functionality of ipython notebook within LyX??

Hi Alex,

Have you tried using knitr for python? Attached is a simple example
and the output created. For more info, see
http://yihui.name/knitr/demo/engines/ . graphics and everything else
should also work, although you might need to add custom hooks (not as
hard as it sounds).

This might not be ideal because you have to have R installed (knitr is
still itself written in R). But I would be curious in your thoughts.

Scott


python_knitr.21.lyx
Description: application/lyx


python_knitr.21.pdf
Description: Adobe PDF document


Re: Feature request

2014-04-29 Thread Richard Heck

On 04/28/2014 06:10 PM, stefano franchi wrote:




On Mon, Apr 28, 2014 at 4:14 PM, Tommaso Cucinotta tomm...@lyx.org 
mailto:tomm...@lyx.org wrote:


On 28/04/14 19:37, Patrick O'Keeffe wrote:

I don't personally see any advantage to composing emails in Lyx.
OP suggested it because of the beautiful formatting provided by
LaTeX but HTML isn't capable of such beauty. If you need the
aesthetics, you're stuck emailing it as an attachment anyway.


Forget about beauty, this is about functionality and convenience:
copying from LyX (trunk), I can send you this (I hope you can
display it correctly, at least it shows up OK while I'm composing it):

  * For each hosts pair ( j 1 , j 2 ) ? H × H , a set P j 1 , j 2
of interconnection paths may be available and usable, where
each path p ? P j 1 , j 2 is associated with the sequence P j
1 , j 2 ,p of its L j 1 , j 2 ,p links P j 1 , j 2 ,p ={ ( a j
1 , j 2 ,p,1 , b j 1 , j 2 ,p,1 ), ... ,( a j 1 , j 2 ,p, L j
1 , j 2 ,p , b j 1 , j 2 ,p, L j 1 , j 2 ,p ) } ? L .


Leaving the meaning aside, my question is: how can I write this in
Thunderbird? The only way is to attach the .lyx document, or an
export of it, and it takes just more time to do that, rather than
copy/paste.


Tommaso,

I don't know what you see in Thunderbird, but I can assure you that in 
gmail your formula is barely legible. Wouldn't it be easier to 
typeset it in ascii?


FWIW, it is perfect here in Thunderbird.

Richard



Re: Feature request

2014-04-29 Thread stefano franchi
On Tue, Apr 29, 2014 at 11:20 AM, Richard Heck rgh...@lyx.org wrote:

  On 04/28/2014 06:10 PM, stefano franchi wrote:




 On Mon, Apr 28, 2014 at 4:14 PM, Tommaso Cucinotta tomm...@lyx.orgwrote:

  On 28/04/14 19:37, Patrick O'Keeffe wrote:

 I don't personally see any advantage to composing emails in Lyx. OP
 suggested it because of the beautiful formatting provided by LaTeX but HTML
 isn't capable of such beauty. If you need the aesthetics, you're stuck
 emailing it as an attachment anyway.


  Forget about beauty, this is about functionality and convenience:
 copying from LyX (trunk), I can send you this (I hope you can display it
 correctly, at least it shows up OK while I'm composing it):

 - For each hosts pair ( j 1 , j 2 ) ∈ H × H , a set P j 1 , j 2 of
interconnection paths may be available and usable, where each path p ∈ P j
1 , j 2 is associated with the sequence P j 1 , j 2 ,p of its L j 1 , j 2
,p links P j 1 , j 2 ,p ={ ( a j 1 , j 2 ,p,1 , b j 1 , j 2 ,p,1 ), … ,( a
j 1 , j 2 ,p, L j 1 , j 2 ,p , b j 1 , j 2 ,p, L j 1 , j 2 ,p ) } ⊂ L .


 Leaving the meaning aside, my question is: how can I write this in
 Thunderbird? The only way is to attach the .lyx document, or an export of
 it, and it takes just more time to do that, rather than copy/paste.


  Tommaso,

 I don't know what you see in Thunderbird, but I can assure you that in
 gmail your formula is barely legible. Wouldn't it be easier to typeset it
 in ascii?


 FWIW, it is perfect here in Thunderbird.


Too bad for gmail then. I wonder if other webmail clients behave as
horribly.


S.


-- 
__
Stefano Franchi
Associate Research Professor
Department of Hispanic Studies Ph:   +1 (979) 845-2125
Texas AM University  Fax:  +1 (979) 845-6421
College Station, Texas, USA

stef...@tamu.edu
http://stefano.cleinias.org


Re: Feature request

2014-04-29 Thread Stephan Witt
Am 29.04.2014 um 18:20 schrieb Richard Heck rgh...@lyx.org:

 On 04/28/2014 06:10 PM, stefano franchi wrote:
 
 
 
 On Mon, Apr 28, 2014 at 4:14 PM, Tommaso Cucinotta tomm...@lyx.org wrote:
 On 28/04/14 19:37, Patrick O'Keeffe wrote:
 I don't personally see any advantage to composing emails in Lyx. OP 
 suggested it because of the beautiful formatting provided by LaTeX but HTML 
 isn't capable of such beauty. If you need the aesthetics, you're stuck 
 emailing it as an attachment anyway. 
 
 Forget about beauty, this is about functionality and convenience: copying 
 from LyX (trunk), I can send you this (I hope you can display it correctly, 
 at least it shows up OK while I'm composing it):
  • For each hosts pair ( j 1 , j 2 ) ∈ H × H , a set P j 1 , j 2 of 
 interconnection paths may be available and usable, where each path p ∈ P j 1 
 , j 2 is associated with the sequence P j 1 , j 2 ,p of its L j 1 , j 2 ,p 
 links P j 1 , j 2 ,p ={ ( a j 1 , j 2 ,p,1 , b j 1 , j 2 ,p,1 ), … ,( a j 1 
 , j 2 ,p, L j 1 , j 2 ,p , b j 1 , j 2 ,p, L j 1 , j 2 ,p ) } ⊂ L .
 
 Leaving the meaning aside, my question is: how can I write this in 
 Thunderbird? The only way is to attach the .lyx document, or an export of 
 it, and it takes just more time to do that, rather than copy/paste.
 
 
 Tommaso,
 
 I don't know what you see in Thunderbird, but I can assure you that in gmail 
 your formula is barely legible. Wouldn't it be easier to typeset it in 
 ascii?
 
 FWIW, it is perfect here in Thunderbird.

The same with Apple-Mail.

Stephan

Re: Feature request

2014-04-29 Thread Abdelrazak Younes

On 29/04/2014 18:20, Richard Heck wrote:

On 04/28/2014 06:10 PM, stefano franchi wrote:




On Mon, Apr 28, 2014 at 4:14 PM, Tommaso Cucinotta tomm...@lyx.org 
mailto:tomm...@lyx.org wrote:


On 28/04/14 19:37, Patrick O'Keeffe wrote:

I don't personally see any advantage to composing emails in Lyx.
OP suggested it because of the beautiful formatting provided by
LaTeX but HTML isn't capable of such beauty. If you need the
aesthetics, you're stuck emailing it as an attachment anyway.


Forget about beauty, this is about functionality and convenience:
copying from LyX (trunk), I can send you this (I hope you can
display it correctly, at least it shows up OK while I'm composing
it):

  * For each hosts pair ( j 1 , j 2 ) ? H × H , a set P j 1 , j 2
of interconnection paths may be available and usable, where
each path p ? P j 1 , j 2 is associated with the sequence P j
1 , j 2 ,p of its L j 1 , j 2 ,p links P j 1 , j 2 ,p ={ ( a
j 1 , j 2 ,p,1 , b j 1 , j 2 ,p,1 ), ... ,( a j 1 , j 2 ,p, L
j 1 , j 2 ,p , b j 1 , j 2 ,p, L j 1 , j 2 ,p ) } ? L .


Leaving the meaning aside, my question is: how can I write this
in Thunderbird? The only way is to attach the .lyx document, or
an export of it, and it takes just more time to do that, rather
than copy/paste.


Tommaso,

I don't know what you see in Thunderbird, but I can assure you that 
in gmail your formula is barely legible. Wouldn't it be easier to 
typeset it in ascii?


FWIW, it is perfect here in Thunderbird.


Indeed, perfect on both Windows and Linux. This is a killer feature for 
scientist collaboration :-)


Abdel.






Re: Feature request

2014-04-29 Thread Tommaso Cucinotta
On 29/04/14 17:59, Abdelrazak Younes wrote:
  FWIW, it is perfect here in Thunderbird.

 Indeed, perfect on both Windows and Linux. This is a killer feature for 
 scientist collaboration :-)

So, this capability of copying and pasting into HTML e-mails should be 
advertised loudly IMHO, in case it's not been done yet.

T.



Re: Feature request

2014-04-29 Thread Richard Heck

On 04/28/2014 06:10 PM, stefano franchi wrote:




On Mon, Apr 28, 2014 at 4:14 PM, Tommaso Cucinotta > wrote:


On 28/04/14 19:37, Patrick O'Keeffe wrote:

I don't personally see any advantage to composing emails in Lyx.
OP suggested it because of the beautiful formatting provided by
LaTeX but HTML isn't capable of such beauty. If you need the
aesthetics, you're stuck emailing it as an attachment anyway.


Forget about beauty, this is about functionality and convenience:
copying from LyX (trunk), I can send you this (I hope you can
display it correctly, at least it shows up OK while I'm composing it):

  * For each hosts pair ( j 1 , j 2 ) ? H × H , a set P j 1 , j 2
of interconnection paths may be available and usable, where
each path p ? P j 1 , j 2 is associated with the sequence P j
1 , j 2 ,p of its L j 1 , j 2 ,p links P j 1 , j 2 ,p ={ ( a j
1 , j 2 ,p,1 , b j 1 , j 2 ,p,1 ), ... ,( a j 1 , j 2 ,p, L j
1 , j 2 ,p , b j 1 , j 2 ,p, L j 1 , j 2 ,p ) } ? L .


Leaving the meaning aside, my question is: how can I write this in
Thunderbird? The only way is to attach the .lyx document, or an
export of it, and it takes just more time to do that, rather than
copy/paste.


Tommaso,

I don't know what you see in Thunderbird, but I can assure you that in 
gmail your formula is barely legible. Wouldn't it be easier to 
"typeset" it in ascii?


FWIW, it is perfect here in Thunderbird.

Richard



Re: Feature request

2014-04-29 Thread stefano franchi
On Tue, Apr 29, 2014 at 11:20 AM, Richard Heck  wrote:

>  On 04/28/2014 06:10 PM, stefano franchi wrote:
>
>
>
>
> On Mon, Apr 28, 2014 at 4:14 PM, Tommaso Cucinotta wrote:
>
>>  On 28/04/14 19:37, Patrick O'Keeffe wrote:
>>
>> I don't personally see any advantage to composing emails in Lyx. OP
>> suggested it because of the beautiful formatting provided by LaTeX but HTML
>> isn't capable of such beauty. If you need the aesthetics, you're stuck
>> emailing it as an attachment anyway.
>>
>>
>>  Forget about beauty, this is about functionality and convenience:
>> copying from LyX (trunk), I can send you this (I hope you can display it
>> correctly, at least it shows up OK while I'm composing it):
>>
>> - For each hosts pair ( j 1 , j 2 ) ∈ H × H , a set P j 1 , j 2 of
>>interconnection paths may be available and usable, where each path p ∈ P j
>>1 , j 2 is associated with the sequence P j 1 , j 2 ,p of its L j 1 , j 2
>>,p links P j 1 , j 2 ,p ={ ( a j 1 , j 2 ,p,1 , b j 1 , j 2 ,p,1 ), … ,( a
>>j 1 , j 2 ,p, L j 1 , j 2 ,p , b j 1 , j 2 ,p, L j 1 , j 2 ,p ) } ⊂ L .
>>
>>
>> Leaving the meaning aside, my question is: how can I write this in
>> Thunderbird? The only way is to attach the .lyx document, or an export of
>> it, and it takes just more time to do that, rather than copy/paste.
>>
>>
>  Tommaso,
>
> I don't know what you see in Thunderbird, but I can assure you that in
> gmail your formula is barely legible. Wouldn't it be easier to "typeset" it
> in ascii?
>
>
> FWIW, it is perfect here in Thunderbird.
>

Too bad for gmail then. I wonder if other webmail clients behave as
horribly.


S.


-- 
__
Stefano Franchi
Associate Research Professor
Department of Hispanic Studies Ph:   +1 (979) 845-2125
Texas A University  Fax:  +1 (979) 845-6421
College Station, Texas, USA

stef...@tamu.edu
http://stefano.cleinias.org


Re: Feature request

2014-04-29 Thread Stephan Witt
Am 29.04.2014 um 18:20 schrieb Richard Heck :

> On 04/28/2014 06:10 PM, stefano franchi wrote:
>> 
>> 
>> 
>> On Mon, Apr 28, 2014 at 4:14 PM, Tommaso Cucinotta  wrote:
>> On 28/04/14 19:37, Patrick O'Keeffe wrote:
>>> I don't personally see any advantage to composing emails in Lyx. OP 
>>> suggested it because of the beautiful formatting provided by LaTeX but HTML 
>>> isn't capable of such beauty. If you need the aesthetics, you're stuck 
>>> emailing it as an attachment anyway. 
>> 
>> Forget about beauty, this is about functionality and convenience: copying 
>> from LyX (trunk), I can send you this (I hope you can display it correctly, 
>> at least it shows up OK while I'm composing it):
>>  • For each hosts pair ( j 1 , j 2 ) ∈ H × H , a set P j 1 , j 2 of 
>> interconnection paths may be available and usable, where each path p ∈ P j 1 
>> , j 2 is associated with the sequence P j 1 , j 2 ,p of its L j 1 , j 2 ,p 
>> links P j 1 , j 2 ,p ={ ( a j 1 , j 2 ,p,1 , b j 1 , j 2 ,p,1 ), … ,( a j 1 
>> , j 2 ,p, L j 1 , j 2 ,p , b j 1 , j 2 ,p, L j 1 , j 2 ,p ) } ⊂ L .
>> 
>> Leaving the meaning aside, my question is: how can I write this in 
>> Thunderbird? The only way is to attach the .lyx document, or an export of 
>> it, and it takes just more time to do that, rather than copy/paste.
>> 
>> 
>> Tommaso,
>> 
>> I don't know what you see in Thunderbird, but I can assure you that in gmail 
>> your formula is barely legible. Wouldn't it be easier to "typeset" it in 
>> ascii?
> 
> FWIW, it is perfect here in Thunderbird.

The same with Apple-Mail.

Stephan

Re: Feature request

2014-04-29 Thread Abdelrazak Younes

On 29/04/2014 18:20, Richard Heck wrote:

On 04/28/2014 06:10 PM, stefano franchi wrote:




On Mon, Apr 28, 2014 at 4:14 PM, Tommaso Cucinotta > wrote:


On 28/04/14 19:37, Patrick O'Keeffe wrote:

I don't personally see any advantage to composing emails in Lyx.
OP suggested it because of the beautiful formatting provided by
LaTeX but HTML isn't capable of such beauty. If you need the
aesthetics, you're stuck emailing it as an attachment anyway.


Forget about beauty, this is about functionality and convenience:
copying from LyX (trunk), I can send you this (I hope you can
display it correctly, at least it shows up OK while I'm composing
it):

  * For each hosts pair ( j 1 , j 2 ) ? H × H , a set P j 1 , j 2
of interconnection paths may be available and usable, where
each path p ? P j 1 , j 2 is associated with the sequence P j
1 , j 2 ,p of its L j 1 , j 2 ,p links P j 1 , j 2 ,p ={ ( a
j 1 , j 2 ,p,1 , b j 1 , j 2 ,p,1 ), ... ,( a j 1 , j 2 ,p, L
j 1 , j 2 ,p , b j 1 , j 2 ,p, L j 1 , j 2 ,p ) } ? L .


Leaving the meaning aside, my question is: how can I write this
in Thunderbird? The only way is to attach the .lyx document, or
an export of it, and it takes just more time to do that, rather
than copy/paste.


Tommaso,

I don't know what you see in Thunderbird, but I can assure you that 
in gmail your formula is barely legible. Wouldn't it be easier to 
"typeset" it in ascii?


FWIW, it is perfect here in Thunderbird.


Indeed, perfect on both Windows and Linux. This is a killer feature for 
scientist collaboration :-)


Abdel.






Re: Feature request

2014-04-29 Thread Tommaso Cucinotta
On 29/04/14 17:59, Abdelrazak Younes wrote:
> > FWIW, it is perfect here in Thunderbird.
>
> Indeed, perfect on both Windows and Linux. This is a killer feature for 
> scientist collaboration :-)

So, this capability of copying and pasting into HTML e-mails should be 
advertised loudly IMHO, in case it's not been done yet.

T.



Re: Feature request

2014-04-28 Thread Patrick O'Keeffe
Perhaps even simpler is to add new converter definitions so the user can 
use the standard FileExport route.


Three new ones:
- Email (plain text)
- Email (HTML)
- Email (PDF attachment) -- using whatever engine is default

As far as passing it to mail clients... It's a real cringeworthy idea 
but don't mailto: links support `?subject=` and `?body=` arguments? At 
least for plain-text and HTML, one could use the system default for 
mailto: links and pass one giant, *ugly string. Not that I would condone it.


I don't personally see any advantage to composing emails in Lyx. OP 
suggested it because of the beautiful formatting provided by LaTeX but 
HTML isn't capable of such beauty. If you need the aesthetics, you're 
stuck emailing it as an attachment anyway.


Patrick


On 2014-04-27 7:23, Tommaso Cucinotta wrote:

On 24/04/14 14:18, Kornel Benko wrote:

Not really. Still it looks for  me as a valid feature request. Even if I was

 
  not planing to use it.
 

Probably the user is free to create a Send by e-mail... menu entry
that simply spawns the preferred e-mail client on the machine, adding
the LyX file currently being edited as attachment, for e-mail clients
that would support that from the command-line.

Would something like this be possible ?

 T.




Re: Feature request

2014-04-28 Thread Tommaso Cucinotta
On 28/04/14 19:37, Patrick O'Keeffe wrote:
 I don't personally see any advantage to composing emails in Lyx. OP suggested 
 it because of the beautiful formatting provided by LaTeX but HTML isn't 
 capable of such beauty. If you need the aesthetics, you're stuck emailing it 
 as an attachment anyway.

Forget about beauty, this is about functionality and convenience: copying from 
LyX (trunk), I can send you this (I hope you can display it correctly, at least 
it shows up OK while I'm composing it):

  * For each hosts pair ( j 1 ,j 2 )∈ H × H , a set P j 1 ,j 2 of 
interconnection paths may be available and usable, where each path p∈ P j 1 ,j 
2 is associated with the sequence P j 1 ,j 2 ,p of its L j 1 ,j 2 ,p links P j 
1 ,j 2 ,p ={ ( a j 1 ,j 2 ,p,1 ,b j 1 ,j 2 ,p,1 ),… ,( a j 1 ,j 2 ,p,L j 1 ,j 2 
,p ,b j 1 ,j 2 ,p,L j 1 ,j 2 ,p ) }⊂ L .

LyX Document
Leaving the meaning aside, my question is: how can I write this in Thunderbird? 
The only way is to attach the .lyx document, or an export of it, and it takes 
just more time to do that, rather than copy/paste.

If I could install a LyX plug-in in Thunderbird allowing me to natively write 
e-mails in LyX, I would probably use that!

My2c,

T.



Re: Feature request

2014-04-28 Thread stefano franchi
On Mon, Apr 28, 2014 at 4:14 PM, Tommaso Cucinotta tomm...@lyx.org wrote:

  On 28/04/14 19:37, Patrick O'Keeffe wrote:

 I don't personally see any advantage to composing emails in Lyx. OP
 suggested it because of the beautiful formatting provided by LaTeX but HTML
 isn't capable of such beauty. If you need the aesthetics, you're stuck
 emailing it as an attachment anyway.


 Forget about beauty, this is about functionality and convenience: copying
 from LyX (trunk), I can send you this (I hope you can display it correctly,
 at least it shows up OK while I'm composing it):

 - For each hosts pair   (   j  1  ,  j  2   ) ∈  H  ×  H ,   a set
P  j  1  ,  j  2   of interconnection paths may be available
and usable, where each path   p ∈P  j  1  ,  j  2is
associated with the sequence P  j  1  ,  j  2  ,p of its
L j  1  ,  j  2  ,p links  P  j  1  ,  j  2  ,p   ={ (
a j  1  ,  j  2  ,p,1   ,  b j  1  ,  j  2  ,p,1), … ,(   a
j  1  ,  j  2  ,p,  L j  1  ,  j  2  ,p  ,  b j  1  ,  j  2
,p,  L j  1  ,  j  2  ,p   ) } ⊂  L .


 Leaving the meaning aside, my question is: how can I write this in
 Thunderbird? The only way is to attach the .lyx document, or an export of
 it, and it takes just more time to do that, rather than copy/paste.


Tommaso,

I don't know what you see in Thunderbird, but I can assure you that in
gmail your formula is barely legible. Wouldn't it be easier to typeset it
in ascii?


Cheers,

Stefano

-- 
__
Stefano Franchi
Associate Research Professor
Department of Hispanic Studies Ph:   +1 (979) 845-2125
Texas AM University  Fax:  +1 (979) 845-6421
College Station, Texas, USA

stef...@tamu.edu
http://stefano.cleinias.org


Re: Feature request

2014-04-28 Thread aparsloe


On 29/04/2014 10:10 a.m., stefano franchi wrote:




On Mon, Apr 28, 2014 at 4:14 PM, Tommaso Cucinotta tomm...@lyx.org 
mailto:tomm...@lyx.org wrote:


On 28/04/14 19:37, Patrick O'Keeffe wrote:

I don't personally see any advantage to composing emails in Lyx.
OP suggested it because of the beautiful formatting provided by
LaTeX but HTML isn't capable of such beauty. If you need the
aesthetics, you're stuck emailing it as an attachment anyway.


Forget about beauty, this is about functionality and convenience:
copying from LyX (trunk), I can send you this (I hope you can
display it correctly, at least it shows up OK while I'm composing it):

  * For each hosts pair ( j 1 , j 2 ) ∈ H × H , a set P j 1 , j 2
of interconnection paths may be available and usable, where
each path p ∈ P j 1 , j 2 is associated with the sequence P j
1 , j 2 ,p of its L j 1 , j 2 ,p links P j 1 , j 2 ,p ={ ( a j
1 , j 2 ,p,1 , b j 1 , j 2 ,p,1 ), … ,( a j 1 , j 2 ,p, L j 1
, j 2 ,p , b j 1 , j 2 ,p, L j 1 , j 2 ,p ) } ⊂ L .


Leaving the meaning aside, my question is: how can I write this in
Thunderbird? The only way is to attach the .lyx document, or an
export of it, and it takes just more time to do that, rather than
copy/paste.


Tommaso,

I don't know what you see in Thunderbird, but I can assure you that in 
gmail your formula is barely legible. Wouldn't it be easier to 
typeset it in ascii?



Cheers,

Stefano

I'm using Thunderbird (on Windows) and the formulas display nicely.

Andrew


Re: Feature request

2014-04-28 Thread Patrick O'Keeffe

On 2014-04-28 15:42, aparsloe wrote:


On 29/04/2014 10:10 a.m., stefano franchi wrote:




On Mon, Apr 28, 2014 at 4:14 PM, Tommaso Cucinotta tomm...@lyx.org
mailto:tomm...@lyx.org wrote:

Leaving the meaning aside, my question is: how can I write this in
Thunderbird? The only way is to attach the .lyx document, or an
export of it, and it takes just more time to do that, rather than
copy/paste.

Tommaso,

I don't know what you see in Thunderbird, but I can assure you that in
gmail your formula is barely legible. Wouldn't it be easier to
typeset it in ascii?

Cheers,

Stefano

I'm using Thunderbird (on Windows) and the formulas display nicely.

Andrew


Seamonkey 2.25 on Windows displays the element and multiply characters 
but no subscripting occurs (I assume 'j1/j2' should be subscript).


Thankfully, an integrated LaTex-to-MathML input box will arrive for 
Thunderbird in v31 and Seamonkey in v2.28 [1]. Grab a nightly build if 
you want to test-drive.


Tommaso, you may be interested right now in the TB addons 'MathML-fonts' 
or 'Equations'. The description for Equations is: An extension that 
allows you to type in complex equations into your e-mail and have the 
text converted into LaTeX-rendered graphics. Enclose all equations in $$ 
and then click the convert button! (E.g. $$Area = \pi * r^2$$) You 
might also search for 'MathBird' or 'TexZilla'.


[1] 
https://developer.mozilla.org/en-US/docs/Web/MathML/Authoring#MathML_in_email_and_instant_messaging_clients


P.S. There are anecdotal reports web clients like Gmail and Zimbra 
filter MathML, thus rendering formulas incorrectly.


Patrick


Re: Feature request

2014-04-28 Thread Patrick O'Keeffe
Perhaps even simpler is to add new converter definitions so the user can 
use the standard File>Export> route.


Three new ones:
- Email (plain text)
- Email (HTML)
- Email (PDF attachment) <-- using whatever engine is default

As far as passing it to mail clients... It's a real cringeworthy idea 
but don't mailto: links support `?subject=` and `?body=` arguments? At 
least for plain-text and HTML, one could use the system default for 
mailto: links and pass one giant, *ugly string. Not that I would condone it.


I don't personally see any advantage to composing emails in Lyx. OP 
suggested it because of the beautiful formatting provided by LaTeX but 
HTML isn't capable of such beauty. If you need the aesthetics, you're 
stuck emailing it as an attachment anyway.


Patrick


On 2014-04-27 7:23, Tommaso Cucinotta wrote:

On 24/04/14 14:18, Kornel Benko wrote:

Not really. Still it looks for  me as a valid feature request. Even if I was

 >
 > not planing to use it.
 >

Probably the user is free to create a "Send by e-mail..." menu entry
that simply spawns the preferred e-mail client on the machine, adding
the LyX file currently being edited as attachment, for e-mail clients
that would support that from the command-line.

Would something like this be possible ?

 T.




Re: Feature request

2014-04-28 Thread Tommaso Cucinotta
On 28/04/14 19:37, Patrick O'Keeffe wrote:
> I don't personally see any advantage to composing emails in Lyx. OP suggested 
> it because of the beautiful formatting provided by LaTeX but HTML isn't 
> capable of such beauty. If you need the aesthetics, you're stuck emailing it 
> as an attachment anyway.

Forget about beauty, this is about functionality and convenience: copying from 
LyX (trunk), I can send you this (I hope you can display it correctly, at least 
it shows up OK while I'm composing it):

  * For each hosts pair ( j 1 ,j 2 )∈ H × H , a set P j 1 ,j 2 of 
interconnection paths may be available and usable, where each path p∈ P j 1 ,j 
2 is associated with the sequence P j 1 ,j 2 ,p of its L j 1 ,j 2 ,p links P j 
1 ,j 2 ,p ={ ( a j 1 ,j 2 ,p,1 ,b j 1 ,j 2 ,p,1 ),… ,( a j 1 ,j 2 ,p,L j 1 ,j 2 
,p ,b j 1 ,j 2 ,p,L j 1 ,j 2 ,p ) }⊂ L .

LyX Document
Leaving the meaning aside, my question is: how can I write this in Thunderbird? 
The only way is to attach the .lyx document, or an export of it, and it takes 
just more time to do that, rather than copy/paste.

If I could install a LyX plug-in in Thunderbird allowing me to natively write 
e-mails in LyX, I would probably use that!

My2c,

T.



Re: Feature request

2014-04-28 Thread stefano franchi
On Mon, Apr 28, 2014 at 4:14 PM, Tommaso Cucinotta  wrote:

>  On 28/04/14 19:37, Patrick O'Keeffe wrote:
>
> I don't personally see any advantage to composing emails in Lyx. OP
> suggested it because of the beautiful formatting provided by LaTeX but HTML
> isn't capable of such beauty. If you need the aesthetics, you're stuck
> emailing it as an attachment anyway.
>
>
> Forget about beauty, this is about functionality and convenience: copying
> from LyX (trunk), I can send you this (I hope you can display it correctly,
> at least it shows up OK while I'm composing it):
>
> - For each hosts pair   (   j  1  ,  j  2   ) ∈  H  ×  H ,   a set
>P  j  1  ,  j  2   of interconnection paths may be available
>and usable, where each path   p ∈P  j  1  ,  j  2is
>associated with the sequence P  j  1  ,  j  2  ,p of its
>L j  1  ,  j  2  ,p links  P  j  1  ,  j  2  ,p   ={ (
>a j  1  ,  j  2  ,p,1   ,  b j  1  ,  j  2  ,p,1), … ,(   a
>j  1  ,  j  2  ,p,  L j  1  ,  j  2  ,p  ,  b j  1  ,  j  2
>,p,  L j  1  ,  j  2  ,p   ) } ⊂  L .
>
>
> Leaving the meaning aside, my question is: how can I write this in
> Thunderbird? The only way is to attach the .lyx document, or an export of
> it, and it takes just more time to do that, rather than copy/paste.
>
>
Tommaso,

I don't know what you see in Thunderbird, but I can assure you that in
gmail your formula is barely legible. Wouldn't it be easier to "typeset" it
in ascii?


Cheers,

Stefano

-- 
__
Stefano Franchi
Associate Research Professor
Department of Hispanic Studies Ph:   +1 (979) 845-2125
Texas A University  Fax:  +1 (979) 845-6421
College Station, Texas, USA

stef...@tamu.edu
http://stefano.cleinias.org


Re: Feature request

2014-04-28 Thread aparsloe


On 29/04/2014 10:10 a.m., stefano franchi wrote:




On Mon, Apr 28, 2014 at 4:14 PM, Tommaso Cucinotta > wrote:


On 28/04/14 19:37, Patrick O'Keeffe wrote:

I don't personally see any advantage to composing emails in Lyx.
OP suggested it because of the beautiful formatting provided by
LaTeX but HTML isn't capable of such beauty. If you need the
aesthetics, you're stuck emailing it as an attachment anyway.


Forget about beauty, this is about functionality and convenience:
copying from LyX (trunk), I can send you this (I hope you can
display it correctly, at least it shows up OK while I'm composing it):

  * For each hosts pair ( j 1 , j 2 ) ∈ H × H , a set P j 1 , j 2
of interconnection paths may be available and usable, where
each path p ∈ P j 1 , j 2 is associated with the sequence P j
1 , j 2 ,p of its L j 1 , j 2 ,p links P j 1 , j 2 ,p ={ ( a j
1 , j 2 ,p,1 , b j 1 , j 2 ,p,1 ), … ,( a j 1 , j 2 ,p, L j 1
, j 2 ,p , b j 1 , j 2 ,p, L j 1 , j 2 ,p ) } ⊂ L .


Leaving the meaning aside, my question is: how can I write this in
Thunderbird? The only way is to attach the .lyx document, or an
export of it, and it takes just more time to do that, rather than
copy/paste.


Tommaso,

I don't know what you see in Thunderbird, but I can assure you that in 
gmail your formula is barely legible. Wouldn't it be easier to 
"typeset" it in ascii?



Cheers,

Stefano

I'm using Thunderbird (on Windows) and the formulas display nicely.

Andrew


Re: Feature request

2014-04-28 Thread Patrick O'Keeffe

On 2014-04-28 15:42, aparsloe wrote:


On 29/04/2014 10:10 a.m., stefano franchi wrote:




On Mon, Apr 28, 2014 at 4:14 PM, Tommaso Cucinotta > wrote:

Leaving the meaning aside, my question is: how can I write this in
Thunderbird? The only way is to attach the .lyx document, or an
export of it, and it takes just more time to do that, rather than
copy/paste.

Tommaso,

I don't know what you see in Thunderbird, but I can assure you that in
gmail your formula is barely legible. Wouldn't it be easier to
"typeset" it in ascii?

Cheers,

Stefano

I'm using Thunderbird (on Windows) and the formulas display nicely.

Andrew


Seamonkey 2.25 on Windows displays the element and multiply characters 
but no subscripting occurs (I assume 'j1/j2' should be subscript).


Thankfully, an integrated LaTex-to-MathML input box will arrive for 
Thunderbird in v31 and Seamonkey in v2.28 [1]. Grab a nightly build if 
you want to test-drive.


Tommaso, you may be interested right now in the TB addons 'MathML-fonts' 
or 'Equations'. The description for Equations is: "An extension that 
allows you to type in complex equations into your e-mail and have the 
text converted into LaTeX-rendered graphics. Enclose all equations in $$ 
and then click the convert button! (E.g. $$Area = \pi * r^2$$)" You 
might also search for 'MathBird' or 'TexZilla'.


[1] 
https://developer.mozilla.org/en-US/docs/Web/MathML/Authoring#MathML_in_email_and_instant_messaging_clients


P.S. There are anecdotal reports web clients like Gmail and Zimbra 
filter MathML, thus rendering formulas incorrectly.


Patrick


Re: Feature request

2014-04-27 Thread Abdelrazak Younes

On 24/04/2014 17:02, Kornel Benko wrote:

Am Donnerstag, 24. April 2014 um 17:00:16, schrieb Kornel Benko kor...@lyx.org

Am Donnerstag, 24. April 2014 um 07:49:02, schrieb Pavel Sanda sa...@lyx.org

Kornel Benko wrote:

Html is inappropriate for email
http://www.avernus.com/~gadams/essays/20020418-html-mail.html


This is convincing. So the format for email (if ever implemented by lyx) may be 
Enriched text.

Hehe, so time to drop html part of your emails to this list ;)
P

I was not even aware of the html part. Cannot see, how to disable it from 
inside kmail.

Kornel

I think, I found it. Test only.


Waoouh! It's a relief Kornel!

:-)

Abdel.



Re: Feature request

2014-04-27 Thread Abdelrazak Younes

On 24/04/2014 15:08, Jean-Marc Lasgouttes wrote:

24/04/2014 15:02, Kornel Benko:
  What is so beautiful about the typography of the .html files we 
export,

  though?

C'mon, its not so bad. For a mail it should be OK.


Do you see an added value wrt whatever html one can produce with 
thunderbird or whatever mail client?


Disclaimer: I do only text messages, so I am not really competent :)


I used to be the same but now I use more and more formatting under 
Thunderbird instead of just writing documents. This is because people I 
work with just don't read attachments, they don't have time.
I don't care about html or enriched text but I do care about 
interoperability with other mail programs so html is the only choice here.


So my feature request would be able:
1) write in LyX
2) select and copy
3) paste as html in Thunderbird.

Maybe this is already possible.

Abdel.



Copying and pasting to other apps (was: Re: Feature request)

2014-04-27 Thread Tommaso Cucinotta
On 27/04/14 10:18, Abdelrazak Younes wrote:
 So my feature request would be able:
 1) write in LyX
 2) select and copy
 3) paste as html in Thunderbird.

 Maybe this is already possible.

It is indeed, but with a few hiccups:

1) boldface and emphasized font variations do not get copied at all (text gets 
copied as normal plain text only)
2) bullet points and numbered lists *seem* to be copied correctly, but soon you 
realize that the bullet point is actually a bullet char, and the numbers in the 
numbered list are actually numbers in the text, namely, thunderbird doesn't 
understand it's actually editing lists in those cases
3) I get an extra carriage-return between any paragraphs, causing an extra 
empty line being inserted between any two LyX paragraphs -- is that only me ?

And the same exact thing happens if I paste into LibreOffice.

So, a couple of extra questions:
a) when you copy LyX text, is there any way to get (also?) the exported HTML 
into the clipboard ?
b) would we need a special copy as HTML for that?

I personally understand the value of being able to seamlessly copy and paste 
between LyX, Thunderbird and LibreOffice, at least for basic rich text 
capabilities.

Thanks,

T.



Re: Feature request

2014-04-27 Thread Tommaso Cucinotta
On 24/04/14 14:18, Kornel Benko wrote:
 Not really. Still it looks for me as a valid feature request. Even if I was

 not planing to use it.


Probably the user is free to create a Send by e-mail... menu entry
that simply spawns the preferred e-mail client on the machine, adding
the LyX file currently being edited as attachment, for e-mail clients
that would support that from the command-line.

Would something like this be possible ?

T.




Re: Copying and pasting to other apps (was: Re: Feature request)

2014-04-27 Thread Georg Baum
Tommaso Cucinotta wrote:

 So, a couple of extra questions:
 a) when you copy LyX text, is there any way to get (also?) the exported
 HTML into the clipboard ? b) would we need a special copy as HTML for
 that?

If you copy something, it is put onto the clipboard in three formats: plain 
text, HTML (using the HTML export) and LyX since version 2.1. The pasting 
application is then supposed to select the most appropriate format. In your 
case something goes wrong either on LyX side or on the other side. If you 
start LyX with -dbg action it should tell you what it does.

 I personally understand the value of being able to seamlessly copy and
 paste between LyX, Thunderbird and LibreOffice, at least for basic rich
 text capabilities.

Indeed. Therefore I worked on that last year.


Georg



Re: Feature request

2014-04-27 Thread Abdelrazak Younes

On 24/04/2014 17:02, Kornel Benko wrote:

Am Donnerstag, 24. April 2014 um 17:00:16, schrieb Kornel Benko 

Am Donnerstag, 24. April 2014 um 07:49:02, schrieb Pavel Sanda 

Kornel Benko wrote:

Html is inappropriate for email
http://www.avernus.com/~gadams/essays/20020418-html-mail.html


This is convincing. So the format for email (if ever implemented by lyx) may be 
Enriched text.

Hehe, so time to drop html part of your emails to this list ;)
P

I was not even aware of the html part. Cannot see, how to disable it from 
inside kmail.

Kornel

I think, I found it. Test only.


Waoouh! It's a relief Kornel!

:-)

Abdel.



Re: Feature request

2014-04-27 Thread Abdelrazak Younes

On 24/04/2014 15:08, Jean-Marc Lasgouttes wrote:

24/04/2014 15:02, Kornel Benko:
 > What is so beautiful about the typography of the .html files we 
export,

 > though?

C'mon, its not so bad. For a mail it should be OK.


Do you see an added value wrt whatever html one can produce with 
thunderbird or whatever mail client?


Disclaimer: I do only text messages, so I am not really competent :)


I used to be the same but now I use more and more formatting under 
Thunderbird instead of just writing documents. This is because people I 
work with just don't read attachments, they don't have time.
I don't care about html or enriched text but I do care about 
interoperability with other mail programs so html is the only choice here.


So my feature request would be able:
1) write in LyX
2) select and copy
3) paste as html in Thunderbird.

Maybe this is already possible.

Abdel.



Copying and pasting to other apps (was: Re: Feature request)

2014-04-27 Thread Tommaso Cucinotta
On 27/04/14 10:18, Abdelrazak Younes wrote:
> So my feature request would be able:
> 1) write in LyX
> 2) select and copy
> 3) paste as html in Thunderbird.
>
> Maybe this is already possible.

It is indeed, but with a few hiccups:

1) boldface and emphasized font variations do not get copied at all (text gets 
copied as normal plain text only)
2) bullet points and numbered lists *seem* to be copied correctly, but soon you 
realize that the bullet point is actually a bullet char, and the numbers in the 
numbered list are actually numbers in the text, namely, thunderbird doesn't 
understand it's actually editing lists in those cases
3) I get an extra carriage-return between any paragraphs, causing an extra 
empty line being inserted between any two LyX paragraphs -- is that only me ?

And the same exact thing happens if I paste into LibreOffice.

So, a couple of extra questions:
a) when you copy LyX text, is there any way to get (also?) the exported HTML 
into the clipboard ?
b) would we need a special "copy as HTML" for that?

I personally understand the value of being able to seamlessly copy and paste 
between LyX, Thunderbird and LibreOffice, at least for basic rich text 
capabilities.

Thanks,

T.



Re: Feature request

2014-04-27 Thread Tommaso Cucinotta
On 24/04/14 14:18, Kornel Benko wrote:
> Not really. Still it looks for me as a valid feature request. Even if I was
>
> not planing to use it.
>

Probably the user is free to create a "Send by e-mail..." menu entry
that simply spawns the preferred e-mail client on the machine, adding
the LyX file currently being edited as attachment, for e-mail clients
that would support that from the command-line.

Would something like this be possible ?

T.




Re: Copying and pasting to other apps (was: Re: Feature request)

2014-04-27 Thread Georg Baum
Tommaso Cucinotta wrote:

> So, a couple of extra questions:
> a) when you copy LyX text, is there any way to get (also?) the exported
> HTML into the clipboard ? b) would we need a special "copy as HTML" for
> that?

If you copy something, it is put onto the clipboard in three formats: plain 
text, HTML (using the HTML export) and LyX since version 2.1. The pasting 
application is then supposed to select the most appropriate format. In your 
case something goes wrong either on LyX side or on the other side. If you 
start LyX with -dbg action it should tell you what it does.

> I personally understand the value of being able to seamlessly copy and
> paste between LyX, Thunderbird and LibreOffice, at least for basic rich
> text capabilities.

Indeed. Therefore I worked on that last year.


Georg



  1   2   3   4   5   6   7   8   9   10   >