Re: questions regarding the minted listings support

2017-07-27 Thread Richard Heck
On 07/27/2017 06:34 AM, Uwe Stöhr wrote:
>
>   Original Message  
> From: Richard Heck
> Sent: Donnerstag, 27. Juli 2017 03:28‎
>
>> Uwe, I think you must have missed the month-long discussion 
> Hi Richard,
>
> Yes because I was more or less completely off and on to real life ;-)
>
> However, the win installer for Lyx will noch add any option to the Tex 
> executables. All I implemented is to deliver the Python package pygments. 
>
> Concerning the docs, I prefer to move the minted description to the 
> additional manual because enabling minted is much too complicated for average 
> users in my opinion. 

That's fine with me. But probably, as I said, wait until something's
been decided.

Richard



Re: questions regarding the minted listings support

2017-07-27 Thread Uwe Stöhr


  Original Message  
From: Richard Heck
Sent: Donnerstag, 27. Juli 2017 03:28‎

> Uwe, I think you must have missed the month-long discussion 

Hi Richard,

Yes because I was more or less completely off and on to real life ;-)

However, the win installer for Lyx will noch add any option to the Tex 
executables. All I implemented is to deliver the Python package pygments. 

Concerning the docs, I prefer to move the minted description to the additional 
manual because enabling minted is much too complicated for average users in my 
opinion. 

> *especially* concerning
-shell-escape. We do NOT want to encourage people to add -shell-escape

I am glad to hear that I am not the only sceptic and that you already took care 
to find a safe solution. 

Regards Uwe 


Re: questions regarding the minted listings support

2017-07-26 Thread Richard Heck
On 07/26/2017 07:12 PM, Uwe Stöhr wrote:
> El 26.07.2017 a las 23:07, Uwe Stöhr escribió:
>
>> You added a feature but don't want to document properly how it can be
>> used?
>> With the link I understand now the -shell-escape option but the
>> Python part is still not clear to me.
>
> I got it now to work. I descried the shell option properly and I set
> up the LyX Windows installer to deliver automatically the pygments
> package of Python.

Uwe, I think you must have missed the month-long discussion we've been
having about exactly how the UI will work here, *especially* concerning
-shell-escape. We do NOT want to encourage people to add -shell-escape
to converters. It is a *huge* security risk. I've therefore put the
instructions you added about this into a Note, and added a comment
before it, for now.

It seems to me that we are close to reaching consensus on how to handle
this. Once that's done, we can update the docs as appropriate.

Richard



Re: questions regarding the minted listings support

2017-07-26 Thread Uwe Stöhr

El 26.07.2017 a las 23:07, Uwe Stöhr escribió:


You added a feature but don't want to document properly how it can be used?
With the link I understand now the -shell-escape option but the Python 
part is still not clear to me.


I got it now to work. I descried the shell option properly and I set up 
the LyX Windows installer to deliver automatically the pygments package 
of Python.


While doing this I found this bug:
http://www.lyx.org/trac/ticket/10732

Can you please have a look?

thanks and regards
Uwe


Re: questions regarding the minted listings support

2017-07-26 Thread Uwe Stöhr

El 26.07.2017 a las 14:16, Enrico Forestieri escribió:


So please tell me what you mean and how one can use -shell-escape so that I
can document it.


Sorry, I won't do it.
http://brosnanyuen.blogspot.it/2015/09/lxy-and-minted.html


You added a feature but don't want to document properly how it can be used?
With the link I understand now the -shell-escape option but the Python 
part is still not clear to me.


However, as the minted support requires a lot of background knowledge 
and fiddling around with command lines, could you live with it when I 
move the minted description to the Additional.lyx manual?


thanks and regards
Uwe


Re: questions regarding the minted listings support

2017-07-26 Thread Enrico Forestieri
On Wed, Jul 26, 2017 at 01:18:46PM +0200, "Uwe Stöhr" wrote:
>
> Sorry, is that your understanding of a documentation?: Go on and google
> around by yourself idiot!

Sorry that you interpreted it like that.

> So please tell me what you mean and how one can use -shell-escape so that I
> can document it.

Sorry, I won't do it.
http://brosnanyuen.blogspot.it/2015/09/lxy-and-minted.html

-- 
Enrico


Re: questions regarding the minted listings support

2017-07-26 Thread Uwe Stöhr
> One can use \usepackage{whatever} multiple times when no options are
specified. So, unless float was loaded as \usepackage[someoption]{float},
there should be no problem.

Yes, but this is my point. We don't know if it was already loaded with an 
option. Therefore we should only load the package was not already loaded. E.g. 
this way:

\@ifundefined{newfloat}
 {\usepackage{float}}{}

> Yes, this is a good idea and it fits well because minted is loaded after
the user preamble.

I'll do so.

>> "requires additional software (the pygments python module) and the
>> -shell-escape option for the LaTeX backend, which allows arbitrary code
>> execution."
>> What does that mean?

> I imagine you are asking while dressing your user hat...

What do you mean with that?

>> What is the pygments python module? and how do i
>> connect it with LyX?

> This is explained in the minted manual that also hints at how installing
it. I don't know how that works on Windows, but I imagine that should be
no problem...

I think you got my point already: You wrote something in the UserGuide that is 
mystery to most of the users. The UserGuide should explain how things work and 
not leave users alone being forced to google around.

Python appears nowhere in our docs so how should an average user know what that 
is? Even if a user have heard about Python it doesn't mean that he knows how it 
is structured, that it consists of modules, that then need to be loaded and how 
this can be done.

> as in the past you also installed other python modules. It might
boil down to simply issuing the command
> 
>  pip install Pygments

That doesn't work. On my PC at work where LyX 2.2.3 runs without problems I get:

C:\Users\ust>pip install Pygments
The command "pip" is either misspelled or could not be found

So users will be lost. Moreover to find out that one has to use a console and 
prepare at first the PATH variable of Windows to find Python is nothing for an 
average user. This required a lot of background knowledge and users who don't 
have admin privileges cannot change the PATH variable.

>> What is the LaTeX backend and how do I apply the option
>> -shell-escape to it?

> http://lmgtfy.com/?q=FIND%3A+latex+shell+escape

Sorry, is that your understanding of a documentation?: Go on and google around 
by yourself idiot!
This is a no-go! LyX users don't know what a LaTeX backend is as even I don't 
know. Is it the latex.exe or the pdflatex command or the pdftex.exe etc.? 
Google tells me nothing to answer this question:
https://www.google.de/search?hl=en&q=latex+backend&ie=utf-8&oe=utf-8&gws_rd=cr&ei=S3l4WeCaKsTEwQKDu7-IAw
(I get only results about biber.)

So please tell me what you mean and how one can use -shell-escape so that I can 
document it.

thanks and regards
Uwe


Re: questions regarding the minted listings support

2017-07-26 Thread Enrico Forestieri
On Wed, Jul 26, 2017 at 01:11:28AM +0200, Uwe Stöhr wrote:
> 
> 1. You write in the note that one should add these preamble lines:
> \usepackage{float}
> \floatstyle{plaintop}
> The package float is already loaded if the user uses a non-default float
> placement for the document. So shouldn't it be checked if this package is
> already loaded?.

One can use \usepackage{whatever} multiple times when no options are
specified. So, unless float was loaded as \usepackage[someoption]{float},
there should be no problem.

> Isn't \floatstyle dangerous because it will affect all following float
> definitions? I would therefore at leas add a hint to input these 2 lines as
> last thing of the preamble.

Yes, this is a good idea and it fits well because minted is loaded after
the user preamble.

> 2. You write that
> "requires additional software (the pygments python module) and the
> -shell-escape option for the LaTeX backend, which allows arbitrary code
> execution."
> What does that mean?

I imagine you are asking while dressing your user hat...

> What is the pygments python module? and how do i
> connect it with LyX?

This is explained in the minted manual that also hints at how installing
it. I don't know how that works on Windows, but I imagine that should be
no problem as in the past you also installed other python modules. It might
boil down to simply issuing the command

  pip install Pygments

from a command prompt.

> What is the LaTeX backend and how do I apply the option
> -shell-escape to it?

http://lmgtfy.com/?q=FIND%3A+latex+shell+escape

-- 
Enrico


Re: questions regarding the minted listings support

2017-07-25 Thread Scott Kostyshak
On Wed, Jul 26, 2017 at 01:11:28AM +0200, Uwe Stöhr wrote:

> 2. You write that
> "requires additional software (the pygments python module) and the
> -shell-escape option for the LaTeX backend, which allows arbitrary code
> execution."
> What does that mean? What is the pygments python module? and how do i
> connect it with LyX? What is the LaTeX backend and how do I apply the option
> -shell-escape to it?

You might want to test with the patch at

https://www.mail-archive.com/search?l=mid&q=20170725191615.GA11436%40GIOVE

Scott