Re: git.lyx.org - developers! your ssh public key please

2017-02-19 Thread Yihui Xie
e if we needed them, but it
>   would be nice not to have to depend on them. Nothing has really
>   broken, and whatever setup we're using feels robust to me, but it
>   still makes me a little worried.
>
> Despite the benefits I list above, I'm not interested in helping with
> the transition. I don't have much time now, I don't know much about how
> to do the transition, and I prefer to focus on other things.
>
> Thank you for this discussion, Yihui. I always take your opinions very
> seriously.
>
> Scott
>
>
> On Fri, Feb 17, 2017 at 11:26:14AM -0600, Yihui Xie wrote:
>> Bumping a thread five years later... and just FYI, Python has moved to
>> Github: https://github.com/python/cpython The story behind the move:
>> https://snarky.ca/the-history-behind-the-decision-to-move-python-to-github/
>>
>> I'm not sure if the LyX team knows more about Github or has more
>> interest now, but I still believe Github is a better choice than
>> maintaining everything (GIT, Wiki, Trac, and so on) by yourselves, and
>> you are more likely to attract talents who are willing to contribute
>> to this project in the future. That said, I'm not as eager as I was
>> five years ago to convince you guys, since I rarely use LyX or LaTeX
>> directly now (but LyX is still *the* best frontend for LaTeX in my
>> mind). If there is an intention to move, great, and let me know if
>> there is anything I can help, otherwise it is totally fine, too.
>> Disclaimer: I'm not affiliated with Github in any sense. I'm just an
>> ordinary user who happens to have benefited a lot from it when
>> developing open source software.
>>
>> Regards,
>> Yihui
>> --
>> https://yihui.name
>>
>>
>> On Fri, Mar 2, 2012 at 9:25 PM, Yihui Xie <x...@yihui.name> wrote:
>> > Well, I think I understand some of the advantages of GIT like easy
>> > branching. I do not even bother to compare it to SVN because GIT is so
>> > much better.
>> >
>> > I mean GitHub makes GIT even better; there are too many advantages and
>> > I just list a few of them here:
>> >
>> > 1. developers manage their own SSH keys on GitHub and you do not need
>> > to ask them to submit their public keys to you;
>> >
>> > 2. people who are not in the developer team can fork the project with
>> > one-click to their own repositories, change the code and send pull
>> > request online (instead of emailing patches) so that you can review
>> > the patch online; a very critical feature here is you can _discuss_
>> > the code line by line with the one who submit this patch -- comments
>> > can be made in-between the code lines; if you are not satisfactory
>> > with the patch, you can require one to revise the code and resubmit;
>> > this process can go on and on until you are satisfied and accept the
>> > patch; see here for an example of my own:
>> > https://github.com/ramnathv/knitr/commit/33a75f4029
>> >
>> > Personally I believe it is very inefficient to email patches and it is
>> > so inconvenient to discuss code in emails. If people send me pull
>> > requests on GitHub, I may merge them in a few minutes, but patches in
>> > email often lay in my inbox for months.
>> >
>> > 3. you can either discuss on GitHub pages, or directly reply the email
>> > notifications from GitHub about the discussions; the email will go to
>> > GitHub. This is unlike trac, you have to go to the web page to discuss
>> > (maybe there are configurations that enable trac to manage emails, but
>> > I did not see this happen in LyX SVN ages).
>> >
>> > 4. bugs tracker; they call "issues", which are also closely tied to
>> > code; you can write a commit message like "fixed #43" to fix the issue
>> > 43 (the issue will be closed and there will be a reference to the
>> > commit in the issue page); it is also more convenient to manage bug
>> > reports: one thing I do not like trac is I'm unable to change the
>> > report after I submit it (e.g. I want to add more code examples, or
>> > fix typos).
>> >
>> > 5. wiki support: you can manage wiki pages by GIT, or edit them
>> > online; the default aesthetics looks good (e.g.
>> > https://github.com/yihui/formatR/wiki)
>> >
>> > 6. GitHub pages: you can even manage your website on GitHub by
>> > creating a branch named "gh-pages" and use the Jekyll engine to
>> > compile markdown files to HTML (this is automatic on GitHub so you
>> > only ma

Re: git.lyx.org - developers! your ssh public key please

2017-02-17 Thread Yihui Xie
Bumping a thread five years later... and just FYI, Python has moved to
Github: https://github.com/python/cpython The story behind the move:
https://snarky.ca/the-history-behind-the-decision-to-move-python-to-github/

I'm not sure if the LyX team knows more about Github or has more
interest now, but I still believe Github is a better choice than
maintaining everything (GIT, Wiki, Trac, and so on) by yourselves, and
you are more likely to attract talents who are willing to contribute
to this project in the future. That said, I'm not as eager as I was
five years ago to convince you guys, since I rarely use LyX or LaTeX
directly now (but LyX is still *the* best frontend for LaTeX in my
mind). If there is an intention to move, great, and let me know if
there is anything I can help, otherwise it is totally fine, too.
Disclaimer: I'm not affiliated with Github in any sense. I'm just an
ordinary user who happens to have benefited a lot from it when
developing open source software.

Regards,
Yihui
--
https://yihui.name


On Fri, Mar 2, 2012 at 9:25 PM, Yihui Xie <x...@yihui.name> wrote:
> Well, I think I understand some of the advantages of GIT like easy
> branching. I do not even bother to compare it to SVN because GIT is so
> much better.
>
> I mean GitHub makes GIT even better; there are too many advantages and
> I just list a few of them here:
>
> 1. developers manage their own SSH keys on GitHub and you do not need
> to ask them to submit their public keys to you;
>
> 2. people who are not in the developer team can fork the project with
> one-click to their own repositories, change the code and send pull
> request online (instead of emailing patches) so that you can review
> the patch online; a very critical feature here is you can _discuss_
> the code line by line with the one who submit this patch -- comments
> can be made in-between the code lines; if you are not satisfactory
> with the patch, you can require one to revise the code and resubmit;
> this process can go on and on until you are satisfied and accept the
> patch; see here for an example of my own:
> https://github.com/ramnathv/knitr/commit/33a75f4029
>
> Personally I believe it is very inefficient to email patches and it is
> so inconvenient to discuss code in emails. If people send me pull
> requests on GitHub, I may merge them in a few minutes, but patches in
> email often lay in my inbox for months.
>
> 3. you can either discuss on GitHub pages, or directly reply the email
> notifications from GitHub about the discussions; the email will go to
> GitHub. This is unlike trac, you have to go to the web page to discuss
> (maybe there are configurations that enable trac to manage emails, but
> I did not see this happen in LyX SVN ages).
>
> 4. bugs tracker; they call "issues", which are also closely tied to
> code; you can write a commit message like "fixed #43" to fix the issue
> 43 (the issue will be closed and there will be a reference to the
> commit in the issue page); it is also more convenient to manage bug
> reports: one thing I do not like trac is I'm unable to change the
> report after I submit it (e.g. I want to add more code examples, or
> fix typos).
>
> 5. wiki support: you can manage wiki pages by GIT, or edit them
> online; the default aesthetics looks good (e.g.
> https://github.com/yihui/formatR/wiki)
>
> 6. GitHub pages: you can even manage your website on GitHub by
> creating a branch named "gh-pages" and use the Jekyll engine to
> compile markdown files to HTML (this is automatic on GitHub so you
> only maintain lightweight markdown files); it is easy to setup and
> after that, you can manage the website by GIT (see, everything on
> GitHub can go to GIT); sorry to use my own projects as examples again,
> but you can see the source
> https://github.com/yihui/knitr/tree/gh-pages of the site
> http://yihui.name/knitr/ for example
>
> Here is a recent article "Lord of the Files: How GitHub Tamed Free
> Software (And More)":
> http://www.wired.com/wiredenterprise/2012/02/github/all/1
>
> In short, this is approximately true for me: GitHub = GIT + Trac +
> Wiki + Web and all are based on GIT. Anyway, this is just my 2 cents
> when I saw the transition from SVN to GIT, and of course you are free
> to invest time and efforts in setting up your own server.
>
> Regards,
> Yihui
> --
> Yihui Xie <xieyi...@gmail.com>
> Phone: 515-294-2465 Web: http://yihui.name
> Department of Statistics, Iowa State University
> 2215 Snedecor Hall, Ames, IA
>
>
>
> On Fri, Mar 2, 2012 at 4:01 AM, Vincent van Ravesteijn <v...@lyx.org> wrote:
>> Op 2-3-2012 7:35, Yihui Xie schreef:
>>>
>>> I was actually wondering why not move to GitHub directly since

Re: Word wrapping problem

2015-07-24 Thread Yihui Xie
Yes, I just tested it, and it is much much better now! Thanks so much,
JMarc! Also thanks Scott for the convenient PPA.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Web: http://yihui.name


On Wed, Jul 22, 2015 at 11:45 AM, Scott Kostyshak skost...@lyx.org wrote:
 On Mon, Jul 20, 2015 at 8:18 PM, Scott Kostyshak skost...@lyx.org wrote:
 On Mon, Jul 20, 2015 at 5:10 PM, Yihui Xie x...@yihui.name wrote:
 Thanks! I'm interested in testing this, but I have not built LyX from
 source for a couple of years... I'd love to test it after it is
 available in a future release.

 When it makes its way into our main development branch (master), you
 can test using the LyX PPA:
 https://launchpad.net/~lyx-devel/+archive/ubuntu/daily

 You do not need to be worried that using the LyX PPA will override
 your current LyX setup because the PPA installs the command lyx2.2
 (and uses as a user directory ~/.lyx2.2) so nothing is overwritten.

 Yihui, are you able to test? JMarc's fixes should now be in the daily
 Ubuntu PPA, described above.

 Scott


Re: Word wrapping problem

2015-07-24 Thread Yihui Xie
Yes, I just tested it, and it is much much better now! Thanks so much,
JMarc! Also thanks Scott for the convenient PPA.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Web: http://yihui.name


On Wed, Jul 22, 2015 at 11:45 AM, Scott Kostyshak <skost...@lyx.org> wrote:
> On Mon, Jul 20, 2015 at 8:18 PM, Scott Kostyshak <skost...@lyx.org> wrote:
>> On Mon, Jul 20, 2015 at 5:10 PM, Yihui Xie <x...@yihui.name> wrote:
>>> Thanks! I'm interested in testing this, but I have not built LyX from
>>> source for a couple of years... I'd love to test it after it is
>>> available in a future release.
>>
>> When it makes its way into our main development branch (master), you
>> can test using the LyX PPA:
>> https://launchpad.net/~lyx-devel/+archive/ubuntu/daily
>>
>> You do not need to be worried that using the LyX PPA will override
>> your current LyX setup because the PPA installs the command lyx2.2
>> (and uses as a user directory ~/.lyx2.2) so nothing is overwritten.
>
> Yihui, are you able to test? JMarc's fixes should now be in the daily
> Ubuntu PPA, described above.
>
> Scott


Re: Word wrapping problem

2015-07-20 Thread Yihui Xie
Thanks! I'm interested in testing this, but I have not built LyX from
source for a couple of years... I'd love to test it after it is
available in a future release.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Web: http://yihui.name


On Mon, Jul 20, 2015 at 2:40 PM, Jean-Marc Lasgouttes
lasgout...@lyx.org wrote:
 Le 24/07/2013 10:03, Cyrille Artho a écrit :

 Hi Jean-Marc,
 The good news is: You don't need to recognize word boundaries in
 Japanese (and I think also in Chinese) text. Just break the text
 whenever you are at the end of a line.

 So typically text will appear as a rectangular block with some more text
 on the final line:


 Two years later... ;)

 The interesting stuff happens in the features/rowpainter2 branch.

 I'd be interested to get feedback from Chinese language users about the new
 row breaking code. As far I know, since I have delegated the work to Qt,
 line breaking should be OK for Chinese characters.

 Comments welcome.

 JMarc


Re: Word wrapping problem

2015-07-20 Thread Yihui Xie
Thanks! I'm interested in testing this, but I have not built LyX from
source for a couple of years... I'd love to test it after it is
available in a future release.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Web: http://yihui.name


On Mon, Jul 20, 2015 at 2:40 PM, Jean-Marc Lasgouttes
<lasgout...@lyx.org> wrote:
> Le 24/07/2013 10:03, Cyrille Artho a écrit :
>>
>> Hi Jean-Marc,
>> The good news is: You don't need to recognize word boundaries in
>> Japanese (and I think also in Chinese) text. Just break the text
>> whenever you are at the end of a line.
>>
>> So typically text will appear as a rectangular block with some more text
>> on the final line:
>
>
> Two years later... ;)
>
> The interesting stuff happens in the features/rowpainter2 branch.
>
> I'd be interested to get feedback from Chinese language users about the new
> row breaking code. As far I know, since I have delegated the work to Qt,
> line breaking should be OK for Chinese characters.
>
> Comments welcome.
>
> JMarc


Re: LyX twitter account ?

2013-10-24 Thread Yihui Xie
I think this is a good idea, but perhaps most LyX developers may not
want to waste much time on SNS like the our generation :) LyX does
have a Google+ page:
https://plus.google.com/u/0/110001097193208807095/about but as you can
see, it is not actively maintained, and I have no idea who is behind
that account.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Thu, Oct 24, 2013 at 7:38 PM, Scott Kostyshak skost...@lyx.org wrote:
 Any interest in having a LyX twitter account? I would like to set one
 up but would only do so if others would find it interesting.

 Potential advantages:
 -- get news out (e.g. GSOC, 2.1 beta)
 -- occasionally show off a new feature (Tomasso want to share your LyX
 chat idea?)
 -- ask for feedback (I imagine there are people who do not want to
 subscribe to the lyx-users list but would be happy to give feedback on
 something if they are following LyX)
 -- retweet some things. This would give people a way of following LyX
 tweets that don't have to do with luxury (this is what lyx means in
 Swedish and is the most common use of the hashtag).

 Here are some selected relevant tweets with #lyx:

 https://twitter.com/u203d/status/392915523870019584
 It feels good to finally be free from the tyranny of #PowerPoint (and
 clones) now that I create my slides with #Lyx and the beamer class.

 https://twitter.com/hawaii_666/status/391210995789471744
 Just showed #lyx to a colleague and realized again how awesome LaTeX
 is! #documents #latex #canbesoeasyandnice http://www.lyx.org/

 https://twitter.com/stevepowell99/status/390915966340583424
 Why does #MSWord corrupt docs when it crashes? #libreoffice and #lyx
 don't. Just happened again #groan

 https://twitter.com/schestowitz/status/369143689341194241
 Create #LaTeX documents graphically with #LyX
 http://www.ibm.com/developerworks/linux/library/os-lyx/index.html?ca=drs
 …- been using it for over a decade, it's still improving.

 I didn't find any previous discussion about a LyX twitter account.

 Scott


Re: LyX twitter account ?

2013-10-24 Thread Yihui Xie
I think this is a good idea, but perhaps most LyX developers may not
want to waste much time on SNS like the our generation :) LyX does
have a Google+ page:
https://plus.google.com/u/0/110001097193208807095/about but as you can
see, it is not actively maintained, and I have no idea who is behind
that account.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Thu, Oct 24, 2013 at 7:38 PM, Scott Kostyshak <skost...@lyx.org> wrote:
> Any interest in having a LyX twitter account? I would like to set one
> up but would only do so if others would find it interesting.
>
> Potential advantages:
> -- get news out (e.g. GSOC, 2.1 beta)
> -- occasionally show off a new feature (Tomasso want to share your LyX
> chat idea?)
> -- ask for feedback (I imagine there are people who do not want to
> subscribe to the lyx-users list but would be happy to give feedback on
> something if they are following LyX)
> -- retweet some things. This would give people a way of following LyX
> tweets that don't have to do with luxury (this is what "lyx" means in
> Swedish and is the most common use of the hashtag).
>
> Here are some selected relevant tweets with #lyx:
>
> https://twitter.com/u203d/status/392915523870019584
> It feels good to finally be free from the tyranny of #PowerPoint (and
> clones) now that I create my slides with #Lyx and the beamer class.
>
> https://twitter.com/hawaii_666/status/391210995789471744
> Just showed #lyx to a colleague and realized again how awesome LaTeX
> is! #documents #latex #canbesoeasyandnice http://www.lyx.org/
>
> https://twitter.com/stevepowell99/status/390915966340583424
> Why does #MSWord corrupt docs when it crashes? #libreoffice and #lyx
> don't. Just happened again #groan
>
> https://twitter.com/schestowitz/status/369143689341194241
> Create #LaTeX documents graphically with #LyX
> http://www.ibm.com/developerworks/linux/library/os-lyx/index.html?ca=drs
> …- been using it for over a decade, it's still improving.
>
> I didn't find any previous discussion about a LyX twitter account.
>
> Scott


Re: Word wrapping problem

2013-07-24 Thread Yihui Xie
As far as I know, there are no kernings and ligatures in Chinese. All
Chinese characters are independent and of exactly the same width, so
it is OK to calculate the string length by simply counting the number
of characters.

This post might help for the Unicode ranges:
http://stackoverflow.com/questions/1366068/whats-the-complete-range-for-chinese-characters-in-unicode

One issue to keep in mind is that when you deal with a mixture of
Chinese and ASCII characters, different rules should be applied
depending on which characters are on the margin, e.g. suppose
你好hello reaches the margin, and you can break the Chinese phrase:

[...]你
好hello[...]

or break between Chinese and English:

[...]你好
hello[...]

or break after English:

[...]你好hello
[...]

but you cannot break the English word like

[...]你好he
llo[...]


Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 206-667-4385 Web: http://yihui.name
Fred Hutchinson Cancer Research Center, Seattle


On Wed, Jul 24, 2013 at 6:33 AM, Jean-Marc Lasgouttes
lasgout...@lyx.org wrote:
 24/07/2013 09:39, Lin Wei:

 Sorry for late reply. I've been volunteer teaching in undeveloped areas
 where I can only check my email remittently.
 Not really more progress. I asked further question and got no
 replySo I kind of give up..


 Dear Lin Wei,

 I am sorry that I have not been as responsive as necessary. Actually, at the
 time I was still trying to understand how the row breaking algorithm works.
 Now I have partly rewritten is in branch features/str-metrics (method is now
 named breakRow), with the goal of computing metrics on who;e strings to
 avoid problems related to ligatures and kerning.

 If we forget about insets, the algorithm is just to collect characters until
 a space is found and possibly break the row at this point. If I understand
 correctly, for Japanese or Chinese one could just break the row as soon as a
 character goes beyond the margin. I am wary of computing width of strings in
 an iterative way (a, then ab, then abc, then abcd...). Is it OK in Chinese
 and Japanese to compute the string length as sum of character lengths? (that
 is, are there kernings and ligatures in these languages?)

 Another question is: how do we recognize Chinese and Japanese characters? I
 guess they live in particular Unicode ranges.

 If things are really complicated, we could choose to rely on Qt's
 QTextBoundaryFinder, although this might be more complicated.

 Hope this helps.

 JMarc



Re: Word wrapping problem

2013-07-24 Thread Yihui Xie
In Chinese typesetting, we do not care if two characters are from the
same word. We break the words whenever they reach the page margin. So
yes, we can break in the middle of a word.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 206-667-4385 Web: http://yihui.name
Fred Hutchinson Cancer Research Center, Seattle


On Wed, Jul 24, 2013 at 12:24 PM, Vincent van Ravesteijn v...@lyx.org wrote:
 Op 24-7-2013 20:55, Yihui Xie schreef:
 As far as I know, there are no kernings and ligatures in Chinese. All
 Chinese characters are independent and of exactly the same width, so
 it is OK to calculate the string length by simply counting the number
 of characters.

 This post might help for the Unicode ranges:
 http://stackoverflow.com/questions/1366068/whats-the-complete-range-for-chinese-characters-in-unicode

 One issue to keep in mind is that when you deal with a mixture of
 Chinese and ASCII characters, different rules should be applied
 depending on which characters are on the margin, e.g. suppose
 你好hello reaches the margin, and you can break the Chinese phrase:

 [...]你
 好hello[...]

 In this case, the two chinese characters are two separate words. If the
 two characters form a single word, can you then also break in the middle
 of the word, i.e. between the two characters ?

 Vincent




Re: Word wrapping problem

2013-07-24 Thread Yihui Xie
In summary, you can break the line in these places:

1. in the middle of any Chinese characters;
2. at the word boundaries of other languages (e.g. spaces in English);

If you mark hello as Chinese, is it possible not to break in the
middle of hello?

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 206-667-4385 Web: http://yihui.name
Fred Hutchinson Cancer Research Center, Seattle


On Wed, Jul 24, 2013 at 12:26 PM, Jean-Marc Lasgouttes
lasgout...@lyx.org wrote:
 Le 24/07/2013 20:55, Yihui Xie a écrit :

 One issue to keep in mind is that when you deal with a mixture of
 Chinese and ASCII characters, different rules should be applied
 depending on which characters are on the margin, e.g. suppose
 你好hello reaches the margin, and you can break the Chinese phrase:


 Thanks. Do I have to care about unicode ranges or can I look at the
 language only? THat is, does it make sense to write 你好hello, with
 hello marked as chinese?

 JMarc




Re: Word wrapping problem

2013-07-24 Thread Yihui Xie
On Wed, Jul 24, 2013 at 1:49 PM, Jean-Marc Lasgouttes
lasgout...@lyx.org wrote:
 Le 24/07/2013 21:49, Yihui Xie a écrit :

 In summary, you can break the line in these places:

 1. in the middle of any Chinese characters;
 2. at the word boundaries of other languages (e.g. spaces in English);


 And between English and Chinese enven without separator, right?

 I will try to push some experimental code tonight.


That is right.


Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 206-667-4385 Web: http://yihui.name
Fred Hutchinson Cancer Research Center, Seattle


Re: Word wrapping problem

2013-07-24 Thread Yihui Xie
As far as I know, there are no kernings and ligatures in Chinese. All
Chinese characters are "independent" and of exactly the same width, so
it is OK to calculate the string length by simply counting the number
of characters.

This post might help for the Unicode ranges:
http://stackoverflow.com/questions/1366068/whats-the-complete-range-for-chinese-characters-in-unicode

One issue to keep in mind is that when you deal with a mixture of
Chinese and ASCII characters, different rules should be applied
depending on which characters are on the margin, e.g. suppose
"你好hello" reaches the margin, and you can break the Chinese phrase:

[...]你
好hello[...]

or break between Chinese and English:

[...]你好
hello[...]

or break after English:

[...]你好hello
[...]

but you cannot break the English word like

[...]你好he
llo[...]


Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 206-667-4385 Web: http://yihui.name
Fred Hutchinson Cancer Research Center, Seattle


On Wed, Jul 24, 2013 at 6:33 AM, Jean-Marc Lasgouttes
<lasgout...@lyx.org> wrote:
> 24/07/2013 09:39, Lin Wei:
>
>> Sorry for late reply. I've been volunteer teaching in undeveloped areas
>> where I can only check my email remittently.
>> Not really more progress. I asked further question and got no
>> replySo I kind of give up..
>
>
> Dear Lin Wei,
>
> I am sorry that I have not been as responsive as necessary. Actually, at the
> time I was still trying to understand how the row breaking algorithm works.
> Now I have partly rewritten is in branch features/str-metrics (method is now
> named breakRow), with the goal of computing metrics on who;e strings to
> avoid problems related to ligatures and kerning.
>
> If we forget about insets, the algorithm is just to collect characters until
> a space is found and possibly break the row at this point. If I understand
> correctly, for Japanese or Chinese one could just break the row as soon as a
> character goes beyond the margin. I am wary of computing width of strings in
> an iterative way (a, then ab, then abc, then abcd...). Is it OK in Chinese
> and Japanese to compute the string length as sum of character lengths? (that
> is, are there kernings and ligatures in these languages?)
>
> Another question is: how do we recognize Chinese and Japanese characters? I
> guess they live in particular Unicode ranges.
>
> If things are really complicated, we could choose to rely on Qt's
> QTextBoundaryFinder, although this might be more complicated.
>
> Hope this helps.
>
> JMarc
>


Re: Word wrapping problem

2013-07-24 Thread Yihui Xie
In Chinese typesetting, we do not care if two characters are from the
same word. We break the words whenever they reach the page margin. So
yes, we can break in the middle of a word.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 206-667-4385 Web: http://yihui.name
Fred Hutchinson Cancer Research Center, Seattle


On Wed, Jul 24, 2013 at 12:24 PM, Vincent van Ravesteijn <v...@lyx.org> wrote:
> Op 24-7-2013 20:55, Yihui Xie schreef:
>> As far as I know, there are no kernings and ligatures in Chinese. All
>> Chinese characters are "independent" and of exactly the same width, so
>> it is OK to calculate the string length by simply counting the number
>> of characters.
>>
>> This post might help for the Unicode ranges:
>> http://stackoverflow.com/questions/1366068/whats-the-complete-range-for-chinese-characters-in-unicode
>>
>> One issue to keep in mind is that when you deal with a mixture of
>> Chinese and ASCII characters, different rules should be applied
>> depending on which characters are on the margin, e.g. suppose
>> "你好hello" reaches the margin, and you can break the Chinese phrase:
>>
>> [...]你
>> 好hello[...]
>
> In this case, the two chinese characters are two separate words. If the
> two characters form a single word, can you then also break in the middle
> of the word, i.e. between the two characters ?
>
> Vincent
>
>


Re: Word wrapping problem

2013-07-24 Thread Yihui Xie
In summary, you can break the line in these places:

1. in the middle of any Chinese characters;
2. at the word boundaries of other languages (e.g. spaces in English);

If you mark "hello" as Chinese, is it possible not to break in the
middle of "hello"?

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 206-667-4385 Web: http://yihui.name
Fred Hutchinson Cancer Research Center, Seattle


On Wed, Jul 24, 2013 at 12:26 PM, Jean-Marc Lasgouttes
<lasgout...@lyx.org> wrote:
> Le 24/07/2013 20:55, Yihui Xie a écrit :
>
>> One issue to keep in mind is that when you deal with a mixture of
>> Chinese and ASCII characters, different rules should be applied
>> depending on which characters are on the margin, e.g. suppose
>> "你好hello" reaches the margin, and you can break the Chinese phrase:
>
>
> Thanks. Do I have to care about unicode ranges or can I look at the
> language only? THat is, does it make sense to write 你好hello, with
> hello marked as chinese?
>
> JMarc
>
>


Re: Word wrapping problem

2013-07-24 Thread Yihui Xie
On Wed, Jul 24, 2013 at 1:49 PM, Jean-Marc Lasgouttes
<lasgout...@lyx.org> wrote:
> Le 24/07/2013 21:49, Yihui Xie a écrit :
>
>> In summary, you can break the line in these places:
>>
>> 1. in the middle of any Chinese characters;
>> 2. at the word boundaries of other languages (e.g. spaces in English);
>
>
> And between English and Chinese enven without separator, right?
>
> I will try to push some experimental code tonight.
>

That is right.


Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 206-667-4385 Web: http://yihui.name
Fred Hutchinson Cancer Research Center, Seattle


Re: LyX 2.1 -- master closed

2013-06-03 Thread Yihui Xie
Liviu is correct. And in knitr, I really do not want to support `=
xx` either, although for now, xx is ignored.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Mon, Jun 3, 2013 at 4:07 AM, Liviu Andronic landronim...@gmail.com wrote:
 On Mon, Jun 3, 2013 at 12:43 PM, Jean-Marc Lasgouttes
 lasgout...@lyx.org wrote:
 03/06/2013 12:21, Vincent van Ravesteijn:


 - tex2lyx part for the new chunk inset,


 This is in now. Please test with your favorite files!

 One thing that is not clear to me is the usefulness of supporting cases like

 aaa= xx
  code here
 @ yyy

 where if I understand correctly xx and yy are ignored. Liviu, Yihui,
 could you comment (in the case of sweave, knitr)? Are they correct? Useful?

 I don't think they're useful, nor valid Sweave/knitr code. Sweave
 simply ignores the xx and yy. While, knitr ignores xx but chokes
 on yy.

 Regards,
 Liviu


Re: LyX 2.1 -- master closed

2013-06-03 Thread Yihui Xie
Liviu is correct. And in knitr, I really do not want to support `<<>>=
xx` either, although for now, xx is ignored.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Mon, Jun 3, 2013 at 4:07 AM, Liviu Andronic <landronim...@gmail.com> wrote:
> On Mon, Jun 3, 2013 at 12:43 PM, Jean-Marc Lasgouttes
> <lasgout...@lyx.org> wrote:
>> 03/06/2013 12:21, Vincent van Ravesteijn:
>>
>>>
>>> - tex2lyx part for the new chunk inset,
>>
>>
>> This is in now. Please test with your favorite files!
>>
>> One thing that is not clear to me is the usefulness of supporting cases like
>>
>> <= xx
>>  code here
>> @ yyy
>>
>> where if I understand correctly "xx" and "yy" are ignored. Liviu, Yihui,
>> could you comment (in the case of sweave, knitr)? Are they correct? Useful?
>>
> I don't think they're useful, nor valid Sweave/knitr code. Sweave
> simply ignores the "xx" and "yy". While, knitr ignores "xx" but chokes
> on "yy".
>
> Regards,
> Liviu


Re: Recommended robust configuration for Chinese support

2013-04-03 Thread Yihui Xie
I submitted a template to LyX for ctex (in 2011?) and you should be
able to see it from File=New From Template, then ctex.lyx

You did not tell us your OS; anyway, you can install the ctex package
from either MikTeX under Windows, or Synaptic under Ubuntu. I think
the only tricky part is the font configuration. It is easier with
Windows. Otherwise you either have to install Adobe Chinese fonts, or
use XeLaTeX.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Wed, Apr 3, 2013 at 7:32 AM, Guenter Milde mi...@users.sf.net wrote:
 On 2013-04-03, Hörmetjan Yiltiz wrote:

 Dear Hörmetjan Yiltiz,

 I found LyX very pleasing software, and used it myself for quite a long
 time, but still its support for writing Chinese is too frustrating,
 encountering some unknown bugs or failing to compile the pdf while directly
 calling pdflatex from the shell could just do the work.

 It would help to track down the problems, if you could provide a minimal
 working example, i.e. a file with just as little content as is required to
 show the problem.

 In this case, we would be glad to see a *.tex file that compiles fine from
 the shell (plus the shell command issued and the OS and the version of the
 TeX installation) as well as a small LyX file that fails.

 Does it work to export the LyX file to a LaTeX file and compile it from the
 shell?

 Günter



Re: Recommended robust configuration for Chinese support

2013-04-03 Thread Yihui Xie
As I said, the key is the font, so

1. The example ctex.lyx uses the adobefonts option (see
Document=Settings), which means you have to install Adobe
Fangsong/Heiti/Kaiti/Song Std; note they are not free fonts. To use
free fonts, you need to change this option to nofonts, use non-TeX
fonts and compile with XeLaTeX. There are not many choices and the
best known fonts are WenQuanYi fonts, which I believe are available
under Debian.

2. Chinese fonts; see 1.

3. I do not see why not, but I'm not 100% sure (have never tried).
Please try it by yourself and ask after you run into real problems.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Wed, Apr 3, 2013 at 12:46 PM, Hörmetjan Yiltiz hyil...@gmail.com wrote:
 Thanks for your kind reply!
 Currently I am using Debian Wheezy, and should not I write some
 predefinitions in the documents configuration? Or choose some utf-8 stuff?

 1. What else do I have to do apart from choosing ctex.lyx in order to get it
 run as fluent of possible?
 2. Which packages should I install apart from those that rdepends on LyX
 (see below)
 3. Does the APA style is compatible with ctex? How to use APA style within
 ctex?

 LyX dependencies in Debian Wheezy 7.0 (Testing) :
 lyx
   Depends: libboost-regex1.49.0
   Depends: libboost-signals1.49.0
   Depends: libc6
   Depends: libenchant1c2a
   Depends: libgcc1
   Depends: libmythes-1.2-0
   Depends: libqtcore4
   Depends: libqtgui4
   Depends: libstdc++6
   Depends: zlib1g
   Depends: lyx-common
   Depends: xdg-utils
   Suggests: rcs
   Suggests: dvipost
   Suggests: groff
   Suggests: libtiff-tools
   Suggests: gnuhtml2latex
   Suggests: wv
   Suggests: chktex
   Suggests: noweb
   Suggests: sgmltools-lite
   Suggests: linuxdoc-tools
   Suggests: writer2latex
   Suggests: latex2rtf
  |Suggests: librsvg2-bin
   Suggests: inkscape
   Suggests: texlive-xetex
   Suggests: etoolbox
   Suggests: lyx-dbg
   Recommends: texlive-latex-recommended
   Recommends: texlive-latex-extra
   Recommends: texlive-science
   Recommends: texlive-generic-recommended
   Recommends: texlive-generic-extra
   Recommends: texlive-fonts-recommended
   Recommends: preview-latex-style
   Recommends: dvipng
   Recommends: imagemagick
 graphicsmagick-imagemagick-compat
   Recommends: psutils
   Recommends: ghostscript
   Recommends: poppler-utils
   Recommends: fonts-lyx
  |Recommends: evince-gtk
   Recommends: pdf-viewer
 epdfview
 evince
 evince-gtk
 gv
 okular
 viewpdf.app
 xpdf
 zathura
  |Recommends: elyxer
  |Recommends: tex4ht
  |Recommends: hevea
  |Recommends: tth
   Recommends: latex2html


 祝好,
 
 He who is worthy to receive his days and nights is worthy to receive all
 else from you (and me).
  The Prophet, Gibran Kahlil
 Gibran


Re: Recommended robust configuration for Chinese support

2013-04-03 Thread Yihui Xie
I submitted a template to LyX for ctex (in 2011?) and you should be
able to see it from File=>New From Template, then ctex.lyx

You did not tell us your OS; anyway, you can install the ctex package
from either MikTeX under Windows, or Synaptic under Ubuntu. I think
the only tricky part is the font configuration. It is easier with
Windows. Otherwise you either have to install Adobe Chinese fonts, or
use XeLaTeX.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Wed, Apr 3, 2013 at 7:32 AM, Guenter Milde <mi...@users.sf.net> wrote:
> On 2013-04-03, Hörmetjan Yiltiz wrote:
>
> Dear Hörmetjan Yiltiz,
>
>> I found LyX very pleasing software, and used it myself for quite a long
>> time, but still its support for writing Chinese is too frustrating,
>> encountering some unknown bugs or failing to compile the pdf while directly
>> calling pdflatex from the shell could just do the work.
>
> It would help to track down the problems, if you could provide a "minimal
> working example", i.e. a file with just as little content as is required to
> show the problem.
>
> In this case, we would be glad to see a *.tex file that compiles fine from
> the shell (plus the shell command issued and the OS and the version of the
> TeX installation) as well as a small LyX file that fails.
>
> Does it work to export the LyX file to a LaTeX file and compile it from the
> shell?
>
> Günter
>


Re: Recommended robust configuration for Chinese support

2013-04-03 Thread Yihui Xie
As I said, the key is the font, so

1. The example ctex.lyx uses the "adobefonts" option (see
Document=>Settings), which means you have to install Adobe
Fangsong/Heiti/Kaiti/Song Std; note they are not free fonts. To use
free fonts, you need to change this option to "nofonts", use non-TeX
fonts and compile with XeLaTeX. There are not many choices and the
best known fonts are WenQuanYi fonts, which I believe are available
under Debian.

2. Chinese fonts; see 1.

3. I do not see why not, but I'm not 100% sure (have never tried).
Please try it by yourself and ask after you run into real problems.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Wed, Apr 3, 2013 at 12:46 PM, Hörmetjan Yiltiz <hyil...@gmail.com> wrote:
> Thanks for your kind reply!
> Currently I am using Debian Wheezy, and should not I write some
> predefinitions in the documents configuration? Or choose some utf-8 stuff?
>
> 1. What else do I have to do apart from choosing ctex.lyx in order to get it
> run as fluent of possible?
> 2. Which packages should I install apart from those that rdepends on LyX
> (see below)
> 3. Does the APA style is compatible with ctex? How to use APA style within
> ctex?
>
> LyX dependencies in Debian Wheezy 7.0 (Testing) :
> lyx
>   Depends: libboost-regex1.49.0
>   Depends: libboost-signals1.49.0
>   Depends: libc6
>   Depends: libenchant1c2a
>   Depends: libgcc1
>   Depends: libmythes-1.2-0
>   Depends: libqtcore4
>   Depends: libqtgui4
>   Depends: libstdc++6
>   Depends: zlib1g
>   Depends: lyx-common
>   Depends: xdg-utils
>   Suggests: rcs
>   Suggests: dvipost
>   Suggests: groff
>   Suggests: libtiff-tools
>   Suggests: gnuhtml2latex
>   Suggests: wv
>   Suggests: chktex
>   Suggests: noweb
>   Suggests: sgmltools-lite
>   Suggests: linuxdoc-tools
>   Suggests: writer2latex
>   Suggests: latex2rtf
>  |Suggests: librsvg2-bin
>   Suggests: inkscape
>   Suggests: texlive-xetex
>   Suggests: etoolbox
>   Suggests: lyx-dbg
>   Recommends: texlive-latex-recommended
>   Recommends: texlive-latex-extra
>   Recommends: texlive-science
>   Recommends: texlive-generic-recommended
>   Recommends: texlive-generic-extra
>   Recommends: texlive-fonts-recommended
>   Recommends: preview-latex-style
>   Recommends: dvipng
>   Recommends: imagemagick
> graphicsmagick-imagemagick-compat
>   Recommends: psutils
>   Recommends: ghostscript
>   Recommends: poppler-utils
>   Recommends: fonts-lyx
>  |Recommends: evince-gtk
>   Recommends: 
> epdfview
> evince
> evince-gtk
> gv
> okular
> viewpdf.app
> xpdf
> zathura
>  |Recommends: elyxer
>  |Recommends: tex4ht
>  |Recommends: hevea
>  |Recommends: tth
>   Recommends: latex2html
>
>
> 祝好,
> 
> He who is worthy to receive his days and nights is worthy to receive all
> else from you (and me).
>  The Prophet, Gibran Kahlil
> Gibran


Re: make initial configure part of install (esp. Windows) ?

2013-01-19 Thread Yihui Xie
I second this proposal. It is indeed very confusing the first time we
open LyX under Windows, especially because it often takes a while to
finish configuration. Even I know what it is doing in the background,
sometimes I have to open the task manager to make sure the LyX process
is really there.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sat, Jan 19, 2013 at 11:28 PM, Scott Kostyshak skost...@lyx.org wrote:
 Has there been discussion on the possibility of configuring LyX as
 part of the install process rather than after the install when LyX is
 first opened?

 I'm thinking mainly of Windows, where currently there are reports of
 the users being confused by opening LyX the first time and not seeing
 any indication that LyX is running correctly and they restart their
 computer after a minute assuming something is wrong.

 Are there disadvantages that I'm not seeing here?

 Scott


Re: make initial configure part of install (esp. Windows) ?

2013-01-19 Thread Yihui Xie
I second this proposal. It is indeed very confusing the first time we
open LyX under Windows, especially because it often takes a while to
finish configuration. Even I know what it is doing in the background,
sometimes I have to open the task manager to make sure the LyX process
is really there.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sat, Jan 19, 2013 at 11:28 PM, Scott Kostyshak <skost...@lyx.org> wrote:
> Has there been discussion on the possibility of configuring LyX as
> part of the install process rather than after the install when LyX is
> first opened?
>
> I'm thinking mainly of Windows, where currently there are reports of
> the users being confused by opening LyX the first time and not seeing
> any indication that LyX is running correctly and they restart their
> computer after a minute assuming something is wrong.
>
> Are there disadvantages that I'm not seeing here?
>
> Scott


Re: An idea on improving the literate programming support

2013-01-04 Thread Yihui Xie
On Tue, Dec 25, 2012 at 12:13 PM, Liviu Andronic landronim...@gmail.com wrote:
 On Sun, Dec 16, 2012 at 10:02 PM, Yihui Xie x...@yihui.name wrote:
 If the only goal is to edit R code externally, it is already possible
 with knitr: http://yihui.name/knitr/demo/externalization/

 I've tested this and the feature seems very useful (in a way, exactly
 what I was looking for), but not immediately obvious for a new user.
 Would you consider including a point on this in the Help Manuals 
 Knitr? Perhaps even show off an example of external code in this
 document?

We may publish another article to update Gregor Gorjanc's article on
LyX/Sweave: http://www.r-project.org/doc/Rnews/Rnews_2008-1.pdf In the
new article, we can introduce all new features since then; I discussed
this with Greg and JMarc earlier last year, but we did not really work
on it. Perhaps we do not need separate manuals for Sweave and knitr.

I'll write a draft paper later today.



 And a general solution of sending program code to the terminal might
 be more useful.

 But then I'm not sure that I understand what is the difference between
 your original idea and my half-baked proposal. It seems to me that
 such functionality would cover sending program code to the terminal
 in a more general way.

Yes I mean your proposal is more general.


 Cheers
 Liviu



Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


Re: An idea on improving the literate programming support

2013-01-04 Thread Yihui Xie
On Tue, Dec 25, 2012 at 12:13 PM, Liviu Andronic <landronim...@gmail.com> wrote:
> On Sun, Dec 16, 2012 at 10:02 PM, Yihui Xie <x...@yihui.name> wrote:
>> If the only goal is to edit R code externally, it is already possible
>> with knitr: http://yihui.name/knitr/demo/externalization/
>>
> I've tested this and the feature seems very useful (in a way, exactly
> what I was looking for), but not immediately obvious for a new user.
> Would you consider including a point on this in the Help Manuals >
> Knitr? Perhaps even show off an example of external code in this
> document?

We may publish another article to update Gregor Gorjanc's article on
LyX/Sweave: http://www.r-project.org/doc/Rnews/Rnews_2008-1.pdf In the
new article, we can introduce all new features since then; I discussed
this with Greg and JMarc earlier last year, but we did not really work
on it. Perhaps we do not need separate manuals for Sweave and knitr.

I'll write a draft paper later today.

>
>
>> And a general solution of sending program code to the terminal might
>> be more useful.
>>
> But then I'm not sure that I understand what is the difference between
> your original idea and my half-baked proposal. It seems to me that
> such functionality would cover "sending program code to the terminal"
> in a more general way.

Yes I mean your proposal is more general.

>
> Cheers
> Liviu



Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


Re: An idea on improving the literate programming support

2012-12-16 Thread Yihui Xie
If the only goal is to edit R code externally, it is already possible
with knitr: http://yihui.name/knitr/demo/externalization/

And a general solution of sending program code to the terminal might
be more useful.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sun, Dec 16, 2012 at 6:14 AM, Liviu Andronic landronim...@gmail.com wrote:
 On Thu, Dec 13, 2012 at 8:04 PM, Scott Kostyshak skost...@lyx.org wrote:
 I wonder if this ticket has something to say about implementation:
 http://www.lyx.org/trac/ticket/7404
 If each inset had an option to edit externally then the user could
 set the edit command to whatever he/she wanted.

 I'm not sure that this would work. For one, this would imply that each
 chunk is opened in a different R session, which is suboptimal.

 Yihui's idea could prove immensely useful, but we need a document-wide
 solution. Here's a half-baked proposal for implementation:
 - Define an 'Sweave load workspace' custom inset that would allow to
 echo=F=
 load('workspace')
 @

 where 'workspace' can be './.RData' or whatever the user inputs.
 Given Juergen's recent work on insets, I think it is possible to
 define such a monstrosity.

 - In the c-menu of this inset, there would be an 'Open R session' item
 that when activated would open a terminal in the dir of the LyX file,
 and load the associated workspace (as indicated in the inset). If
 possible, instead of a terminal we would open RStudio (or some other R
 editor).

 - We would need a new LFUN (associated with some 'ctrl+alt+r' binding
 or whatever) that would allow the execution of chunk: Take the chunk
 contents and pass them to R (or RStudio). We might want to have an
 LFUN allowing executing code line by line. Such an arrangement would
 allow to evaluate the chunks while working in LyX.

 - Another possibility would be that upon activating the c-menu item,
 LyX would export to Sweave, open the resulting .Rnw file in RStudio
 and let the user use RStudio functionality to evaluate the chunks.

 Would it be difficult to implement something similar?

 Regards
 Liviu


Re: An idea on improving the literate programming support

2012-12-16 Thread Yihui Xie
If the only goal is to edit R code externally, it is already possible
with knitr: http://yihui.name/knitr/demo/externalization/

And a general solution of sending program code to the terminal might
be more useful.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sun, Dec 16, 2012 at 6:14 AM, Liviu Andronic <landronim...@gmail.com> wrote:
> On Thu, Dec 13, 2012 at 8:04 PM, Scott Kostyshak <skost...@lyx.org> wrote:
>> I wonder if this ticket has something to say about implementation:
>> http://www.lyx.org/trac/ticket/7404
>> If each inset had an option to "edit externally" then the user could
>> set the "edit command" to whatever he/she wanted.
>>
> I'm not sure that this would work. For one, this would imply that each
> chunk is opened in a different R session, which is suboptimal.
>
> Yihui's idea could prove immensely useful, but we need a document-wide
> solution. Here's a half-baked proposal for implementation:
> - Define an 'Sweave load workspace' custom inset that would allow to
> <

An idea on improving the literate programming support

2012-12-13 Thread Yihui Xie
Hi,

One idea about literate programming in LyX has been in my mind for a
while, and I'm wondering how you think about it. I'll take
Sweave/knitr for example:

One nice feature of R language is that it can be used interactively,
which is very helpful for us to do some experimental or exploratory
analysis before we come up with a final data analysis report. I was
thinking perhaps we could send R code from LyX to R like Emacs/ESS and
RStudio do, e.g. open a system shell or command window from LyX, and
send R code there to be evaluated. At the moment we can only compile
the whole LyX document in a batch manner.

I have no idea about the implementation. Any feedback is welcome. Thanks!

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


An idea on improving the literate programming support

2012-12-13 Thread Yihui Xie
Hi,

One idea about literate programming in LyX has been in my mind for a
while, and I'm wondering how you think about it. I'll take
Sweave/knitr for example:

One nice feature of R language is that it can be used interactively,
which is very helpful for us to do some experimental or exploratory
analysis before we come up with a final data analysis report. I was
thinking perhaps we could send R code from LyX to R like Emacs/ESS and
RStudio do, e.g. open a system shell or command window from LyX, and
send R code there to be evaluated. At the moment we can only compile
the whole LyX document in a batch manner.

I have no idea about the implementation. Any feedback is welcome. Thanks!

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


Re: Sweave Chunk inset

2012-11-25 Thread Yihui Xie
I do not see the value of the weird Scode environment; I think it was
invented only to bring the author a fake feeling that he is writing
LaTeX, since it is not really a LaTeX environment at all.

For me, I just want an approach to input = and @ quickly in LyX;
perhaps InsetArgument is an overkill for this task. I'll be happy
enough if LyX has something like macro recording so I can press a
shortcut to input = in an ERT when writing Sweave documents.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sun, Nov 25, 2012 at 4:07 PM, Jean-Marc Lasgouttes
lasgout...@lyx.org wrote:
 Le 25/11/2012 17:35, Jürgen Spitzmüller a écrit :

 With most recent trunk you can try the following

 InsetLayout Flex:Sweave Chunk
  LabelString   Sweave Chunk
  LatexType none
  LyXType   Custom
  DecorationMinimalistic
  MultiPar  true
  ParbreakIsNewline 1
  Spellcheck0
  FreeSpacing   true
  ForceLTR  true
  Argument 1
  Mandatory   1
  LabelString Chunk Options
  Tooltip Chunk Options
  LeftDelim   
  RightDelim  =
  EndArgument
 End


 Will there be a carriage return after the = ?

 Actually I am not sure that catering for sweave weird syntax is the best
 thing to do. Another possibility is to use the LaTeX-like syntax with an
 Scode environment. The only weird thing about it is that it uses an optional
 argument with {} delimiters :-|

 JMarc




Re: Sweave Chunk inset

2012-11-25 Thread Yihui Xie
I do not see the value of the weird Scode environment; I think it was
invented only to bring the author a fake feeling that he is writing
LaTeX, since it is not really a LaTeX environment at all.

For me, I just want an approach to input <<>>= and @ quickly in LyX;
perhaps InsetArgument is an overkill for this task. I'll be happy
enough if LyX has something like macro recording so I can press a
shortcut to input <<>>= in an ERT when writing Sweave documents.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sun, Nov 25, 2012 at 4:07 PM, Jean-Marc Lasgouttes
<lasgout...@lyx.org> wrote:
> Le 25/11/2012 17:35, Jürgen Spitzmüller a écrit :
>
>> With most recent trunk you can try the following
>>
>> InsetLayout "Flex:Sweave Chunk"
>>  LabelString   "Sweave Chunk"
>>  LatexType none
>>  LyXType   Custom
>>  DecorationMinimalistic
>>  MultiPar  true
>>  ParbreakIsNewline 1
>>  Spellcheck0
>>  FreeSpacing   true
>>  ForceLTR  true
>>  Argument 1
>>  Mandatory   1
>>  LabelString "Chunk Options"
>>  Tooltip "Chunk Options"
>>  LeftDelim   <<
>>  RightDelim  >>=
>>  EndArgument
>> End
>
>
> Will there be a carriage return after the >>= ?
>
> Actually I am not sure that catering for sweave weird syntax is the best
> thing to do. Another possibility is to use the LaTeX-like syntax with an
> Scode environment. The only weird thing about it is that it uses an optional
> argument with {} delimiters :-|
>
> JMarc
>
>


Re: TeX capacity exceeded

2012-11-05 Thread Yihui Xie
It is possible with a huge tikz plot (e.g. a scatter plot with more
than ten thousand points). If anybody is interested and uses R, I can
give an example. It might be irrelevant to the original post here,
though.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Mon, Nov 5, 2012 at 4:22 PM, Richard Heck rgh...@lyx.org wrote:
 On 11/05/2012 03:49 PM, Robert Adolle wrote:

 How to extend this capacity ?
 Thank you very much for help.

 You almost never actually need to do this, and I'm not sure it's even
 possible. The problem is some kind of error elsewhere in the document.

 Richard



Re: TeX capacity exceeded

2012-11-05 Thread Yihui Xie
It is possible with a huge tikz plot (e.g. a scatter plot with more
than ten thousand points). If anybody is interested and uses R, I can
give an example. It might be irrelevant to the original post here,
though.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Mon, Nov 5, 2012 at 4:22 PM, Richard Heck <rgh...@lyx.org> wrote:
> On 11/05/2012 03:49 PM, Robert Adolle wrote:
>>
>> How to extend this capacity ?
>> Thank you very much for help.
>>
> You almost never actually need to do this, and I'm not sure it's even
> possible. The problem is some kind of error elsewhere in the document.
>
> Richard
>


Re: Noweb/Literate programming Copier problem

2012-10-28 Thread Yihui Xie
That is okay for me, and I do not mind Knitr although it is indeed
rarely capitalized.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sun, Oct 28, 2012 at 10:11 PM, Scott Kostyshak skost...@lyx.org wrote:

 Is the attached patch OK? I broke style by leaving knitr lowercase
 because I have never seen it capitalized.

 Scott


Re: Noweb/Literate programming Copier problem

2012-10-28 Thread Yihui Xie
That is okay for me, and I do not mind "Knitr" although it is indeed
rarely capitalized.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sun, Oct 28, 2012 at 10:11 PM, Scott Kostyshak <skost...@lyx.org> wrote:
>
> Is the attached patch OK? I broke style by leaving knitr lowercase
> because I have never seen it capitalized.
>
> Scott


Re: [PATCH] Fix importation of noweb files with tex2lyx

2012-10-24 Thread Yihui Xie
Gregor may know the history of Scrap; that term has been there ever
since I started using LyX/Sweave, and I never know how it came in.

Noweb is only one of the implementations of literate programming (to
beat Knuth's WEB), so I guess literate may actually be a better
name.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Wed, Oct 24, 2012 at 8:27 AM, Jean-Marc Lasgouttes
lasgout...@lyx.org wrote:
 This is a patch for testing (Kayvan?) since I do not have the
 tools/knowledge. This allows proper importation of noweb files (at least as
 good as it used to be).

 I also renamed the literate format. Tell me whether this is a problem.

 Finally, is there a reason why the Scrap layout is not Chunk, like it is in
 noweb documentation? Where does this scrap term come from?

 I wanted to extend that to sweave/knitr, but I have two problems:

 * knitr should have its own file extension
 * we need proper verbatim reading to make things work. There are too many
 strange characters in R code.

 JMarc



Re: [PATCH] Fix importation of noweb files with tex2lyx

2012-10-24 Thread Yihui Xie
Gregor may know the history of "Scrap"; that term has been there ever
since I started using LyX/Sweave, and I never know how it came in.

Noweb is only one of the implementations of literate programming (to
beat Knuth's WEB), so I guess "literate" may actually be a better
name.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Wed, Oct 24, 2012 at 8:27 AM, Jean-Marc Lasgouttes
<lasgout...@lyx.org> wrote:
> This is a patch for testing (Kayvan?) since I do not have the
> tools/knowledge. This allows proper importation of noweb files (at least as
> good as it used to be).
>
> I also renamed the "literate" format. Tell me whether this is a problem.
>
> Finally, is there a reason why the Scrap layout is not Chunk, like it is in
> noweb documentation? Where does this scrap term come from?
>
> I wanted to extend that to sweave/knitr, but I have two problems:
>
> * knitr should have its own file extension
> * we need proper verbatim reading to make things work. There are too many
> strange characters in R code.
>
> JMarc
>


Re: knitr and Sweave security

2012-10-21 Thread Yihui Xie
I learned \write18 from a quick search:
http://stackoverflow.com/questions/3252957/how-to-execute-shell-script-from-latex

Security problems exist in most software packages. In this case
(knitr/Sweave), a pure technical solution does not seem to be
possible... Sometimes I do want to execute system() commands.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sun, Oct 21, 2012 at 1:54 AM, Liviu Andronic landronim...@gmail.com wrote:
 On Sun, Oct 21, 2012 at 6:55 AM, Yihui Xie x...@yihui.name wrote:
 The blacklist-based solution can stop nothing as you showed, so I
 think we cannot do much except writing it in the documentation.

 What about an MS Excel style 'Do not execute scripts' option or
 dialogue? Basically we could introduce two modes when Sweave/knitr
 module is loaded:
 - Run scripts, all works as it does now.
 - Do not run scripts, where the scripty modules are being disabled (or
 similar) and some flag is being displayed somewhere, perhaps in the
 status bar (or the WM title bar).

 If scripts are detected then a dialogue pops up with a warning and
 asks the user how to proceed. This should provide a minimum of
 security.

 What do you think of this? Regards
 Liviu

 PS While we're on the subject of security, is it not possible to
 simply use LaTeX to write malicious code?


Re: knitr and Sweave security

2012-10-21 Thread Yihui Xie
I learned \write18 from a quick search:
http://stackoverflow.com/questions/3252957/how-to-execute-shell-script-from-latex

Security problems exist in most software packages. In this case
(knitr/Sweave), a pure technical solution does not seem to be
possible... Sometimes I do want to execute system() commands.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sun, Oct 21, 2012 at 1:54 AM, Liviu Andronic <landronim...@gmail.com> wrote:
> On Sun, Oct 21, 2012 at 6:55 AM, Yihui Xie <x...@yihui.name> wrote:
>> The blacklist-based solution can stop nothing as you showed, so I
>> think we cannot do much except writing it in the documentation.
>>
> What about an MS Excel style 'Do not execute scripts' option or
> dialogue? Basically we could introduce two modes when Sweave/knitr
> module is loaded:
> - Run scripts, all works as it does now.
> - Do not run scripts, where the scripty modules are being disabled (or
> similar) and some flag is being displayed somewhere, perhaps in the
> status bar (or the WM title bar).
>
> If scripts are detected then a dialogue pops up with a warning and
> asks the user how to proceed. This should provide a minimum of
> security.
>
> What do you think of this? Regards
> Liviu
>
> PS While we're on the subject of security, is it not possible to
> simply use LaTeX to write malicious code?


Re: $$e not set on import -- import of .Rnw (knitr) fails

2012-10-20 Thread Yihui Xie
I think it should be easy to ignore the encoding argument if it does
not exist, but the problem that confuses me is why importing Rnw is
involved with lyxsweave.R or lyxknitr.R. I mean Rnw should be treated
as a normal TeX document (the R code should not be executed through
Sweave or knitr), except that the code chunks (between = and @)
should be treated differently, e.g. as ERT.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sat, Oct 20, 2012 at 11:13 AM, Scott Kostyshak skost...@lyx.org wrote:
 On Fri, Oct 19, 2012 at 5:11 AM, Jean-Marc Lasgouttes
 lasgout...@lyx.org wrote:
 Le 18/10/2012 16:19, Scott Kostyshak a écrit :

 The unchangedConverter.log is here (error):
 http://paste.debian.net/201557/


 So the error happens on export to latex because the encoding is not
 specified.

 The error happens when importing the Rnw in LyX, which from what I
 understand currently calls the Rnw - LaTeX (plain) converter and then
 run tex2lyx.

 I think I do not understand what you do exactly. Does the same happen with
 Sweave (I do not have knitr here)?

 Yes, the same happens with Sweave because the converter Sweave -
 LaTeX (plain) has a $$e and that string is set to empty because of the
 following code:
 command = subst(command, token_encoding, buffer ?
 buffer-params().encoding().iconvName() : string());

 Could you send me an example file and a
 step by step description of what you actually do?

 Yes. I've been using the example file that comes with LyX but I think
 that the same error would occur with trying to import any .Rnw file
 via Sweave or knitr.

 1. Start a clean LyX instance from current master branch (although I
 have the same problem in branch. I wonder if importing a .Rnw has
 worked at some point?).
 2. File  Open  Examples button  sweave.lyx
 3. File  Export  Export As  [tempfolder]/sweaveexample.Rnw  (select
 the Sweave (.Rnw) format)
 4. Close the current document (the sweave.lyx file) just to make sure
 that it's not involved with the import probem.
 5. File  Import  Sweave...  [tempfolder]/sweaveexample.Rnw
 6. At this point I get an error.

 Here are steps to show that (1) it is indeed the Sweave - LaTeX
 (plain) converter that is being used and (2) that setting the $$e
 variable improves things:
 7. Close the error box from (6).
 8. Go to Tools  Preferences  File Handling  Converters  select
 Sweave - LaTeX (plain) and in the Converter text box manually delete
 $$e and insert in it's place ISO-8859-15 so that the converter is
 now:
 Rscript --verbose --no-save --no-restore $$s/scripts/lyxsweave.R
 $$p$$i $$p$$o ISO-8859-15 $$r
 9. Click the Modify button.
 10. Click the Save button.
 11. Repeat step (5).
 12. The .Rnw is now partly imported. There will be other problems in
 the import process which I think are due to tex2lyx, but these
 problems are different from the Rnw - tex problem I am reporting
 here.

 Is the solution to modify lyxsweave.R and lyxknitr.R so that if they
 are not passed an encoding they should just not change the encoding
 from the default R one? This would be easy to do.

 Thanks,

 Scott


Re: Noweb/Literate programming Copier problem

2012-10-20 Thread Yihui Xie
I think that should be enough. A pointer to the knitr manual in
Help--Specific Manuals--Knitr Manual can be helpful too (I
remember Liviu mentioned this once).

BTW, can you export knitr.lyx to LyX2.0 format? Just like I did here:
https://github.com/yihui/lyx/commit/68c4a7fa78a1ac7e317c783cb415fc21a5ca2705
Otherwise users may not be able to open this file (\lyxformat 424 is
too high).

Thanks!

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Tue, Oct 16, 2012 at 7:58 PM, Scott Kostyshak skost...@lyx.org wrote:

 OK thanks for the tips. I'm guessing it's OK to update the format in
 trunk when changing the manuals?

 I don't think anything in-depth needs to be written there about knitr
 in the Additional manual because knitr already has a manual for use
 with LyX. However, it is currently an example. The only thing
 unmanual-like about knitr.lyx is its length, but in my opinion it is
 sufficient as is, especially because a lot that is in the Sweave
 manual applies to knitr.

 Attached is a patch to update the Additional manual. Is it OK?

 Thanks,

 Scott


Re: Noweb/Literate programming Copier problem

2012-10-20 Thread Yihui Xie
I see. I did not check out the 2.0.x branch. It is indeed 413 there. Thanks!

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sat, Oct 20, 2012 at 5:53 PM, Scott Kostyshak skost...@lyx.org wrote:
 On Sat, Oct 20, 2012 at 6:40 PM, Yihui Xie x...@yihui.name wrote:
 I think that should be enough. A pointer to the knitr manual in
 Help--Specific Manuals--Knitr Manual can be helpful too (I
 remember Liviu mentioned this once).

 Sure, I can do that. Pavel, is that OK? Trunk only?

 BTW, can you export knitr.lyx to LyX2.0 format? Just like I did here:
 https://github.com/yihui/lyx/commit/68c4a7fa78a1ac7e317c783cb415fc21a5ca2705
 Otherwise users may not be able to open this file (\lyxformat 424 is
 too high).

 424 is only for the master branch. knitr.lyx in the 2.0.x branch has
 format 413. I think this is consistent with the other manuals. Am I
 missing something?

 Thanks,

 Scott



Re: knitr and Sweave security

2012-10-20 Thread Yihui Xie
I do not see an obvious approach to solve this issue except
documenting the potential security problem in the manual. It exists in
all R-related applications, including R packages. I have seen people
collecting keywords like system() and file.remove(), but that is
apparently far from a perfect solution. Education is probably the only
way...

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sat, Oct 20, 2012 at 8:51 PM, Scott Kostyshak skost...@lyx.org wrote:
 I do not see knitr and Sweave security discussed anywhere. The
 Customization guide has 5 paragraphs on security regarding external
 templates.

 For example, someone could post a .lyx file asking for help that
 contains malicious code. I don't always check the list of modules that
 a document has and sometimes it might be hard to go through the entire
 file looking at the chunks of code (which might not stand out since
 they can be collapsed) before compiling. Using R's system command,
 one can run arbitrary commands, downloading/uploading or deleting
 information.

 In the external template support, measures are taken to restrict the
 access that the user has to the shell.

 I do not see any options that Rscript can accept to provide more security.

 Any thoughts as far as improving security, warning the user, or documentation?

 Thanks,

 Scott


Re: knitr and Sweave security

2012-10-20 Thread Yihui Xie
The blacklist-based solution can stop nothing as you showed, so I
think we cannot do much except writing it in the documentation.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sat, Oct 20, 2012 at 9:41 PM, Scott Kostyshak skost...@lyx.org wrote:

 You mean searching the chunk for the word system? I agree that it
 would be useless:
 first - sy
 second - stem
 do.call(paste(first,second,sep=),list(command=echo I still have
 access  tempfile.txt))

 What if knitr overrides the system function before processing the chunk?
 My guess is that it's not a good idea: there is probably a way around
 it, there are many other functions that would need to be blacklisted
 and overridden, and it would probably cause more bugs than security.
 But I wanted to throw it out there.

 Thanks,

 Scott


Re: $$e not set on import --> import of .Rnw (knitr) fails

2012-10-20 Thread Yihui Xie
I think it should be easy to ignore the encoding argument if it does
not exist, but the problem that confuses me is why importing Rnw is
involved with lyxsweave.R or lyxknitr.R. I mean Rnw should be treated
as a normal TeX document (the R code should not be executed through
Sweave or knitr), except that the code chunks (between <<>>= and @)
should be treated differently, e.g. as ERT.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sat, Oct 20, 2012 at 11:13 AM, Scott Kostyshak <skost...@lyx.org> wrote:
> On Fri, Oct 19, 2012 at 5:11 AM, Jean-Marc Lasgouttes
> <lasgout...@lyx.org> wrote:
>> Le 18/10/2012 16:19, Scott Kostyshak a écrit :
>>
>>> The unchangedConverter.log is here (error):
>>> http://paste.debian.net/201557/
>>
>>
>> So the error happens on export to latex because the encoding is not
>> specified.
>
> The error happens when importing the Rnw in LyX, which from what I
> understand currently calls the Rnw -> LaTeX (plain) converter and then
> run tex2lyx.
>
>> I think I do not understand what you do exactly. Does the same happen with
>> Sweave (I do not have knitr here)?
>
> Yes, the same happens with Sweave because the converter Sweave ->
> LaTeX (plain) has a $$e and that string is set to empty because of the
> following code:
> command = subst(command, token_encoding, buffer ?
> buffer->params().encoding().iconvName() : string());
>
>> Could you send me an example file and a
>> step by step description of what you actually do?
>
> Yes. I've been using the example file that comes with LyX but I think
> that the same error would occur with trying to import any .Rnw file
> via Sweave or knitr.
>
> 1. Start a clean LyX instance from current master branch (although I
> have the same problem in branch. I wonder if importing a .Rnw has
> worked at some point?).
> 2. File > Open > Examples button > sweave.lyx
> 3. File > Export > Export As > [tempfolder]/sweaveexample.Rnw  (select
> the Sweave (.Rnw) format)
> 4. Close the current document (the sweave.lyx file) just to make sure
> that it's not involved with the import probem.
> 5. File > Import > Sweave... > [tempfolder]/sweaveexample.Rnw
> 6. At this point I get an error.
>
> Here are steps to show that (1) it is indeed the Sweave -> LaTeX
> (plain) converter that is being used and (2) that setting the $$e
> variable improves things:
> 7. Close the error box from (6).
> 8. Go to Tools > Preferences > File Handling > Converters > select
> Sweave -> LaTeX (plain) and in the Converter text box manually delete
> "$$e" and insert in it's place "ISO-8859-15" so that the converter is
> now:
> Rscript --verbose --no-save --no-restore $$s/scripts/lyxsweave.R
> $$p$$i $$p$$o ISO-8859-15 $$r
> 9. Click the Modify button.
> 10. Click the Save button.
> 11. Repeat step (5).
> 12. The .Rnw is now partly imported. There will be other problems in
> the import process which I think are due to tex2lyx, but these
> problems are different from the Rnw -> tex problem I am reporting
> here.
>
> Is the solution to modify lyxsweave.R and lyxknitr.R so that if they
> are not passed an encoding they should just not change the encoding
> from the default R one? This would be easy to do.
>
> Thanks,
>
> Scott


Re: Noweb/Literate programming Copier problem

2012-10-20 Thread Yihui Xie
I think that should be enough. A pointer to the knitr manual in
"Help-->Specific Manuals-->Knitr Manual" can be helpful too (I
remember Liviu mentioned this once).

BTW, can you export knitr.lyx to LyX2.0 format? Just like I did here:
https://github.com/yihui/lyx/commit/68c4a7fa78a1ac7e317c783cb415fc21a5ca2705
Otherwise users may not be able to open this file (\lyxformat 424 is
too high).

Thanks!

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Tue, Oct 16, 2012 at 7:58 PM, Scott Kostyshak <skost...@lyx.org> wrote:
>
> OK thanks for the tips. I'm guessing it's OK to update the format in
> trunk when changing the manuals?
>
> I don't think anything in-depth needs to be written there about knitr
> in the Additional manual because knitr already has a "manual" for use
> with LyX. However, it is currently an example. The only thing
> unmanual-like about knitr.lyx is its length, but in my opinion it is
> sufficient as is, especially because a lot that is in the Sweave
> manual applies to knitr.
>
> Attached is a patch to update the Additional manual. Is it OK?
>
> Thanks,
>
> Scott


Re: Noweb/Literate programming Copier problem

2012-10-20 Thread Yihui Xie
I see. I did not check out the 2.0.x branch. It is indeed 413 there. Thanks!

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sat, Oct 20, 2012 at 5:53 PM, Scott Kostyshak <skost...@lyx.org> wrote:
> On Sat, Oct 20, 2012 at 6:40 PM, Yihui Xie <x...@yihui.name> wrote:
>> I think that should be enough. A pointer to the knitr manual in
>> "Help-->Specific Manuals-->Knitr Manual" can be helpful too (I
>> remember Liviu mentioned this once).
>
> Sure, I can do that. Pavel, is that OK? Trunk only?
>
>> BTW, can you export knitr.lyx to LyX2.0 format? Just like I did here:
>> https://github.com/yihui/lyx/commit/68c4a7fa78a1ac7e317c783cb415fc21a5ca2705
>> Otherwise users may not be able to open this file (\lyxformat 424 is
>> too high).
>
> 424 is only for the master branch. knitr.lyx in the 2.0.x branch has
> format 413. I think this is consistent with the other manuals. Am I
> missing something?
>
> Thanks,
>
> Scott
>


Re: knitr and Sweave security

2012-10-20 Thread Yihui Xie
I do not see an obvious approach to solve this issue except
documenting the potential security problem in the manual. It exists in
all R-related applications, including R packages. I have seen people
collecting keywords like system() and file.remove(), but that is
apparently far from a perfect solution. Education is probably the only
way...

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sat, Oct 20, 2012 at 8:51 PM, Scott Kostyshak <skost...@lyx.org> wrote:
> I do not see knitr and Sweave security discussed anywhere. The
> Customization guide has 5 paragraphs on security regarding external
> templates.
>
> For example, someone could post a .lyx file asking for help that
> contains malicious code. I don't always check the list of modules that
> a document has and sometimes it might be hard to go through the entire
> file looking at the chunks of code (which might not stand out since
> they can be collapsed) before compiling. Using R's "system" command,
> one can run arbitrary commands, downloading/uploading or deleting
> information.
>
> In the external template support, measures are taken to restrict the
> access that the user has to the shell.
>
> I do not see any options that Rscript can accept to provide more security.
>
> Any thoughts as far as improving security, warning the user, or documentation?
>
> Thanks,
>
> Scott


Re: knitr and Sweave security

2012-10-20 Thread Yihui Xie
The blacklist-based solution can stop nothing as you showed, so I
think we cannot do much except writing it in the documentation.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sat, Oct 20, 2012 at 9:41 PM, Scott Kostyshak <skost...@lyx.org> wrote:
>
> You mean searching the chunk for the word "system"? I agree that it
> would be useless:
> first <- "sy"
> second <- "stem"
> do.call(paste(first,second,sep=""),list(command="echo I still have
> access >> tempfile.txt"))
>
> What if knitr overrides the "system" function before processing the chunk?
> My guess is that it's not a good idea: there is probably a way around
> it, there are many other functions that would need to be blacklisted
> and overridden, and it would probably cause more bugs than security.
> But I wanted to throw it out there.
>
> Thanks,
>
> Scott


Re: $$e not set on import -- import of .Rnw (knitr) fails

2012-10-18 Thread Yihui Xie
Import Rnw is something I was asked long time ago but have not figured
out how it works. It seems the Sweave/knitr module is called but
really should not be, because these modules are only responsible for
Rnw--TeX, not for Rnw--LyX. Or should they? Ideally LyX should be
able to handle the TeX part, and for the R code chunks (= and @),
they can be imported to ERT, but I do not know how to do that.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Thu, Oct 18, 2012 at 5:02 AM, Scott Kostyshak skost...@lyx.org wrote:
 On Thu, Oct 18, 2012 at 3:46 AM, Jean-Marc Lasgouttes
 lasgout...@lyx.org wrote:
 Le 18/10/12 01:49, Scott Kostyshak a écrit :

 Stupid question; where is importation of knitr files defined in
 converters?


 Rnw (knitr) - latex (plain)
 The converter is currently:
 Rscript --verbose --no-save --no-restore $$s/scripts/lyxknitr.R $$p$$i
 $$p$$o $$e $$r
 When I change this to the following, import works:
 Rscript --verbose --no-save --no-restore $$s/scripts/lyxknitr.R $$p$$i
 $$p$$o ISO-8859-15 $$r


 But this is a converter for export, not import.

 Ah, then I don't understand how LyX handles imports. The Customization
 manual does not talk about importing. Doesn't LyX use the converters
 to convert the file to LaTeX and then use tex2lyx to import the tex
 file?

 What is the difference between the Rnw files when you do this change?

 No difference. In the recipe for reproducing, steps (1) and (2) are
 the same. To get it to import I only substitute for $$e before step
 (3) (importing).

 Scott


Re: $$e not set on import --> import of .Rnw (knitr) fails

2012-10-18 Thread Yihui Xie
Import Rnw is something I was asked long time ago but have not figured
out how it works. It seems the Sweave/knitr module is called but
really should not be, because these modules are only responsible for
Rnw-->TeX, not for Rnw-->LyX. Or should they? Ideally LyX should be
able to handle the TeX part, and for the R code chunks (<<>>= and @),
they can be imported to ERT, but I do not know how to do that.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Thu, Oct 18, 2012 at 5:02 AM, Scott Kostyshak <skost...@lyx.org> wrote:
> On Thu, Oct 18, 2012 at 3:46 AM, Jean-Marc Lasgouttes
> <lasgout...@lyx.org> wrote:
>> Le 18/10/12 01:49, Scott Kostyshak a écrit :
>>
>>>> Stupid question; where is importation of knitr files defined in
>>>> converters?
>>>
>>>
>>> Rnw (knitr) -> latex (plain)
>>> The converter is currently:
>>> Rscript --verbose --no-save --no-restore $$s/scripts/lyxknitr.R $$p$$i
>>> $$p$$o $$e $$r
>>> When I change this to the following, import works:
>>> Rscript --verbose --no-save --no-restore $$s/scripts/lyxknitr.R $$p$$i
>>> $$p$$o ISO-8859-15 $$r
>>
>>
>> But this is a converter for export, not import.
>
> Ah, then I don't understand how LyX handles imports. The Customization
> manual does not talk about importing. Doesn't LyX use the converters
> to convert the file to LaTeX and then use tex2lyx to import the tex
> file?
>
>> What is the difference between the Rnw files when you do this change?
>
> No difference. In the recipe for reproducing, steps (1) and (2) are
> the same. To get it to import I only substitute for $$e before step
> (3) (importing).
>
> Scott


Re: Noweb/Literate programming Copier problem

2012-10-10 Thread Yihui Xie
I'm pretty busy at the moment. I'm wondering if Scott can do it.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Wed, Oct 10, 2012 at 6:41 PM, Pavel Sanda sa...@lyx.org wrote:
 Kayvan Sylvan wrote:
 So I fixed the documentation (patch attached) and I now have a perfectly
 working solution for using LyX and noweb for literate programming.

 Please apply my patch and we can just close ticket 5444.

 Note that the Customization.lyx file had Change Tracking enabled, so I left
 it on. Someone will have to accept the changes after applying this patch.

 It is now in.
 BTW we still do not have a word about knitr in Additional manual.
 Yihui, what about add few paragraphs there?

 Pavel


Re: Noweb/Literate programming Copier problem

2012-10-10 Thread Yihui Xie
I'm pretty busy at the moment. I'm wondering if Scott can do it.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Wed, Oct 10, 2012 at 6:41 PM, Pavel Sanda <sa...@lyx.org> wrote:
> Kayvan Sylvan wrote:
>> So I fixed the documentation (patch attached) and I now have a perfectly
>> working solution for using LyX and noweb for literate programming.
>>
>> Please apply my patch and we can just close ticket 5444.
>>
>> Note that the Customization.lyx file had Change Tracking enabled, so I left
>> it on. Someone will have to accept the changes after applying this patch.
>
> It is now in.
> BTW we still do not have a word about knitr in Additional manual.
> Yihui, what about add few paragraphs there?
>
> Pavel


Re: [PATCH] lyxknitr failed when /tmp on different fs

2012-10-01 Thread Yihui Xie
I have tested it on my Windows 7 and I did not see any problems.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Mon, Oct 1, 2012 at 1:35 AM, Scott Kostyshak skost...@lyx.org wrote:
 On Fri, Sep 28, 2012 at 2:50 AM, Yihui Xie x...@yihui.name wrote:
 I'm confident enough with the updated lyxknitr.R, but we may still
 need to test it under Windows.

 OK. Let's wait for someone to test on Windows first then. I'm not sure
 what the protocol for committing is if we can't find a Windows + LyX +
 R + knitr tester.

 Scott


Re: [PATCH] lyxknitr failed when /tmp on different fs

2012-10-01 Thread Yihui Xie
I have tested it on my Windows 7 and I did not see any problems.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Mon, Oct 1, 2012 at 1:35 AM, Scott Kostyshak <skost...@lyx.org> wrote:
> On Fri, Sep 28, 2012 at 2:50 AM, Yihui Xie <x...@yihui.name> wrote:
>> I'm confident enough with the updated lyxknitr.R, but we may still
>> need to test it under Windows.
>
> OK. Let's wait for someone to test on Windows first then. I'm not sure
> what the protocol for committing is if we can't find a Windows + LyX +
> R + knitr tester.
>
> Scott


Re: [PATCH] lyxknitr failed when /tmp on different fs

2012-09-28 Thread Yihui Xie
I'm confident enough with the updated lyxknitr.R, but we may still
need to test it under Windows.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Fri, Sep 28, 2012 at 1:43 AM, Scott Kostyshak skost...@lyx.org wrote:
 On Thu, Sep 27, 2012 at 3:56 PM, Scott Kostyshak skost...@lyx.org wrote:
 On Thu, Sep 27, 2012 at 1:40 PM, Yihui Xie x...@yihui.name wrote:
 Hi Scott,

 Attached is my patch. Now lyxknitr.R does not move files at all; all
 old tricks are gone, and the R script is much cleaner. I have tested
 it under Ubuntu.

 It looks a lot cleaner indeed.

 I'm not sure you can commit it to the git repository, so I cc JMarc.

 BTW, I also updated the homepage of the knitr package from
 yihui.github.com/knitr to yihui.name/knitr

 Great, thanks a lot Yihui! I will test this later.

 Yihui, testing went well for me, both on the computer where I have an
 encrypted home and on a different computer. Unfortunately, they are
 both also Ubuntu. Do you think this needs further testing on
 non-Ubuntu computers?

 I updated the homepage of the knitr package in the example file. The
 updated diff is attached.

 Scott


Re: [PATCH] lyxknitr failed when /tmp on different fs

2012-09-28 Thread Yihui Xie
I'm confident enough with the updated lyxknitr.R, but we may still
need to test it under Windows.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Fri, Sep 28, 2012 at 1:43 AM, Scott Kostyshak <skost...@lyx.org> wrote:
> On Thu, Sep 27, 2012 at 3:56 PM, Scott Kostyshak <skost...@lyx.org> wrote:
>> On Thu, Sep 27, 2012 at 1:40 PM, Yihui Xie <x...@yihui.name> wrote:
>>> Hi Scott,
>>>
>>> Attached is my patch. Now lyxknitr.R does not move files at all; all
>>> old tricks are gone, and the R script is much cleaner. I have tested
>>> it under Ubuntu.
>>
>> It looks a lot cleaner indeed.
>>
>>> I'm not sure you can commit it to the git repository, so I cc JMarc.
>>>
>>> BTW, I also updated the homepage of the knitr package from
>>> yihui.github.com/knitr to yihui.name/knitr
>>
>> Great, thanks a lot Yihui! I will test this later.
>
> Yihui, testing went well for me, both on the computer where I have an
> encrypted home and on a different computer. Unfortunately, they are
> both also Ubuntu. Do you think this needs further testing on
> non-Ubuntu computers?
>
> I updated the homepage of the knitr package in the example file. The
> updated diff is attached.
>
> Scott


Re: [PATCH] lyxknitr failed when /tmp on different fs

2012-09-27 Thread Yihui Xie
I was bitten by this problem as well a few days ago, but I forgot to
work on it. I think I have a better fix which does not involve with
copying or renaming files at all. I'll do it soon. Thanks!

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Thu, Sep 27, 2012 at 6:18 AM, Scott Kostyshak skost...@lyx.org wrote:
 When /tmp was on a different file system (e.g. encrypted home),
 lyxknitr.R failed to move files to /tmp because it relied on R's
 'file.rename' function, which in turn relied on the rename function in
 stdio.h, which was failing with the EXDEV errno. Now lyxknitr.R relies
 on 'file.copy'.

 Yihui, does this look OK?

 Note that I also changed a comment: file.rename renamed a .tex and a .R for 
 me.

 Thanks,

 Scott


Re: [PATCH] lyxknitr failed when /tmp on different fs

2012-09-27 Thread Yihui Xie
Hi Scott,

Attached is my patch. Now lyxknitr.R does not move files at all; all
old tricks are gone, and the R script is much cleaner. I have tested
it under Ubuntu.

I'm not sure you can commit it to the git repository, so I cc JMarc.

BTW, I also updated the homepage of the knitr package from
yihui.github.com/knitr to yihui.name/knitr

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Thu, Sep 27, 2012 at 6:18 AM, Scott Kostyshak skost...@lyx.org wrote:
 When /tmp was on a different file system (e.g. encrypted home),
 lyxknitr.R failed to move files to /tmp because it relied on R's
 'file.rename' function, which in turn relied on the rename function in
 stdio.h, which was failing with the EXDEV errno. Now lyxknitr.R relies
 on 'file.copy'.

 Yihui, does this look OK?

 Note that I also changed a comment: file.rename renamed a .tex and a .R for 
 me.

 Thanks,

 Scott


lyxknitr.diff
Description: Binary data


Re: [PATCH] lyxknitr failed when /tmp on different fs

2012-09-27 Thread Yihui Xie
I was bitten by this problem as well a few days ago, but I forgot to
work on it. I think I have a better fix which does not involve with
copying or renaming files at all. I'll do it soon. Thanks!

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Thu, Sep 27, 2012 at 6:18 AM, Scott Kostyshak <skost...@lyx.org> wrote:
> When /tmp was on a different file system (e.g. encrypted home),
> lyxknitr.R failed to move files to /tmp because it relied on R's
> 'file.rename' function, which in turn relied on the rename function in
> , which was failing with the EXDEV errno. Now lyxknitr.R relies
> on 'file.copy'.
>
> Yihui, does this look OK?
>
> Note that I also changed a comment: file.rename renamed a .tex and a .R for 
> me.
>
> Thanks,
>
> Scott


Re: [PATCH] lyxknitr failed when /tmp on different fs

2012-09-27 Thread Yihui Xie
Hi Scott,

Attached is my patch. Now lyxknitr.R does not move files at all; all
old tricks are gone, and the R script is much cleaner. I have tested
it under Ubuntu.

I'm not sure you can commit it to the git repository, so I cc JMarc.

BTW, I also updated the homepage of the knitr package from
yihui.github.com/knitr to yihui.name/knitr

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Thu, Sep 27, 2012 at 6:18 AM, Scott Kostyshak <skost...@lyx.org> wrote:
> When /tmp was on a different file system (e.g. encrypted home),
> lyxknitr.R failed to move files to /tmp because it relied on R's
> 'file.rename' function, which in turn relied on the rename function in
> , which was failing with the EXDEV errno. Now lyxknitr.R relies
> on 'file.copy'.
>
> Yihui, does this look OK?
>
> Note that I also changed a comment: file.rename renamed a .tex and a .R for 
> me.
>
> Thanks,
>
> Scott


lyxknitr.diff
Description: Binary data


Re: [LyX master] Fix bug #7741: incorrect locale when starting R from LyX?

2012-08-21 Thread Yihui Xie
It is difficult to build the Windows installer from source. If there
is a daily Windows build, I'd love to test it.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Tue, Aug 21, 2012 at 5:33 AM, Jean-Marc Lasgouttes
lasgout...@lyx.org wrote:
 This commit is mostly about removing bad code, and it fixes a locale bug
 when spawning external programs. I'd like to backport this to branch.

 I am confident that it works well in linux, but could some macos/windows
 users confirm that they still can change UI language through preferences?

 JMarc



Re: [LyX master] Fix bug #7741: incorrect locale when starting R from LyX?

2012-08-21 Thread Yihui Xie
It is difficult to build the Windows installer from source. If there
is a daily Windows build, I'd love to test it.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Tue, Aug 21, 2012 at 5:33 AM, Jean-Marc Lasgouttes
<lasgout...@lyx.org> wrote:
> This commit is mostly about removing bad code, and it fixes a locale bug
> when spawning external programs. I'd like to backport this to branch.
>
> I am confident that it works well in linux, but could some macos/windows
> users confirm that they still can change UI language through preferences?
>
> JMarc
>


Re: problematic copier for JPEG figures?

2012-07-18 Thread Yihui Xie
Oops... I cannot reproduce it on the other machine, so I need to
examine this problem more carefully before I report back.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Wed, Jul 18, 2012 at 1:06 AM, Yihui Xie x...@yihui.name wrote:
 Hi,

 I'm not sure anyone else can reproduce this weird behavior under LyX
 2.0.4 (Ubuntu): the tex code for jpeg figures seems to be wrong.
 Suppose the jpeg file is foo.jpg; in the tex code exported from LyX it
 will become this:

 \includegraphics{\string0_path_to_foo\string.jpg, jpeg}

 pdflatex will write the text jpeg jpeg before the figure in the PDF
 output. It turns out that LyX copied foo.jpg to the temp dir as
 0_path_to_foo.jpg, jpeg. I do not understand why this happens. PNG
 figures are fine.

 Regards,
 Yihui
 --
 Yihui Xie xieyi...@gmail.com
 Phone: 515-294-2465 Web: http://yihui.name
 Department of Statistics, Iowa State University
 2215 Snedecor Hall, Ames, IA


Re: problematic copier for JPEG figures?

2012-07-18 Thread Yihui Xie
Oops... I cannot reproduce it on the other machine, so I need to
examine this problem more carefully before I report back.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Wed, Jul 18, 2012 at 1:06 AM, Yihui Xie <x...@yihui.name> wrote:
> Hi,
>
> I'm not sure anyone else can reproduce this weird behavior under LyX
> 2.0.4 (Ubuntu): the tex code for jpeg figures seems to be wrong.
> Suppose the jpeg file is foo.jpg; in the tex code exported from LyX it
> will become this:
>
> \includegraphics{\string"0_path_to_foo\string".jpg, jpeg}
>
> pdflatex will write the text "jpeg jpeg" before the figure in the PDF
> output. It turns out that LyX copied foo.jpg to the temp dir as
> "0_path_to_foo.jpg, jpeg". I do not understand why this happens. PNG
> figures are fine.
>
> Regards,
> Yihui
> --
> Yihui Xie <xieyi...@gmail.com>
> Phone: 515-294-2465 Web: http://yihui.name
> Department of Statistics, Iowa State University
> 2215 Snedecor Hall, Ames, IA


problematic copier for JPEG figures?

2012-07-17 Thread Yihui Xie
Hi,

I'm not sure anyone else can reproduce this weird behavior under LyX
2.0.4 (Ubuntu): the tex code for jpeg figures seems to be wrong.
Suppose the jpeg file is foo.jpg; in the tex code exported from LyX it
will become this:

\includegraphics{\string0_path_to_foo\string.jpg, jpeg}

pdflatex will write the text jpeg jpeg before the figure in the PDF
output. It turns out that LyX copied foo.jpg to the temp dir as
0_path_to_foo.jpg, jpeg. I do not understand why this happens. PNG
figures are fine.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


problematic copier for JPEG figures?

2012-07-17 Thread Yihui Xie
Hi,

I'm not sure anyone else can reproduce this weird behavior under LyX
2.0.4 (Ubuntu): the tex code for jpeg figures seems to be wrong.
Suppose the jpeg file is foo.jpg; in the tex code exported from LyX it
will become this:

\includegraphics{\string"0_path_to_foo\string".jpg, jpeg}

pdflatex will write the text "jpeg jpeg" before the figure in the PDF
output. It turns out that LyX copied foo.jpg to the temp dir as
"0_path_to_foo.jpg, jpeg". I do not understand why this happens. PNG
figures are fine.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


insert \and between authors?

2012-03-08 Thread Yihui Xie
Hi,

Maybe I missed the documentation somewhere, but each time I have to
insert \and as TeX code when my document has multiple authors. Would
it be a good idea to implement it as an item in Insert--Formatting?
Visually it is a horizontal space in LyX. Thanks!

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


insert \and between authors?

2012-03-08 Thread Yihui Xie
Hi,

Maybe I missed the documentation somewhere, but each time I have to
insert \and as TeX code when my document has multiple authors. Would
it be a good idea to implement it as an item in Insert-->Formatting?
Visually it is a horizontal space in LyX. Thanks!

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


Re: git.lyx.org - developers! your ssh public key please

2012-03-04 Thread Yihui Xie
Oh, yes, absolutely. Thanks again for your hard work!

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sun, Mar 4, 2012 at 6:54 AM, Lars Gullik Bjønnes lar...@gullik.org wrote:

 Let's do the git on our own server dance first. As said if we later on
 want to move to a hosted git service that will be very easy.

 --
         Lgb


Re: git.lyx.org - developers! your ssh public key please

2012-03-04 Thread Yihui Xie
Oh, yes, absolutely. Thanks again for your hard work!

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sun, Mar 4, 2012 at 6:54 AM, Lars Gullik Bjønnes <lar...@gullik.org> wrote:
>
> Let's do the "git on our own server" dance first. As said if we later on
> want to move to a hosted git service that will be very easy.
>
> --
>         Lgb


Re: git.lyx.org - developers! your ssh public key please

2012-03-03 Thread Yihui Xie
I mean discussion in email is less efficient than directly in code,
where you can point out why this line is not good, and how that line
needs improvement, etc.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sat, Mar 3, 2012 at 4:31 AM, Lars Gullik Bjønnes lar...@gullik.org wrote:
 On Sat, Mar 3, 2012 at 04:25, Yihui Xie x...@yihui.name wrote:
 [...]
 Personally I believe it is very inefficient to email patches

 In what way inefficient?

 git send-email HEAD~3

 to send the small patchset for commenting somewhere is not exactly hard.

 and it is
 so inconvenient to discuss code in emails.

 I couldn't disagree more I think.

 --
         Lgb


Re: git.lyx.org - developers! your ssh public key please

2012-03-03 Thread Yihui Xie
This is expected to me: programmers tend to do everything by
themselves. I cannot promise all the conversions, but GitHub supports
importing from an svn repo with one click, so if you want to move
there, I can certainly do it. For the rest of the jobs, they require
more time, but I believe after the conversion it will be easier to
maintain since almost everything is under GIT. I'm willing to
contribute some time if you want, but from the replies I have got so
far, I guess I can give up the attempt to convince you now.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sat, Mar 3, 2012 at 4:06 AM, Lars Gullik Bjønnes lar...@gullik.org wrote:
 In short, this is approximately true for me: GitHub = GIT + Trac +
 Wiki + Web and all are based on GIT. Anyway, this is just my 2 cents
 when I saw the transition from SVN to GIT, and of course you are free
 to invest time and efforts in setting up your own server.

 Will _you_ step up to do all the conversions needed?
 We already have an extensive wiki, we have nice web pages
 and a running bug tracker.

 Setting up a gitolite server for git is easy. And it is not like we are
 closing the door on a later move to some git hosting service.

 --
         Lgb


Re: git.lyx.org - developers! your ssh public key please

2012-03-03 Thread Yihui Xie
Uwe,

Since you work under Windows, I also recommend TortoiseGIT with
msysgit, unless you like working with CLI heavily.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sat, Mar 3, 2012 at 7:32 AM, Vincent van Ravesteijn v...@lyx.org wrote:
 Op 3-3-2012 14:17, Uwe Stöhr schreef:

 Am 02.03.2012 02:07, schrieb Lars Gullik Bjønnes:

 I am not going to setup anonymous cloning right now, but I want
 developers to send me their public ssh keys.


 I never used SSH until now, so could anybody please give me a short
 introduction what I need to do?

 thanks and regards
 Uwe


 1. Install:
 http://msysgit.googlecode.com/files/Git-1.7.9-preview20120201.exe
 2. Start Git Bash
 3. type ssh-keygen
 4. press enter to store the key in the default location
 5. enter a passphrase or just press enter

 You'll get a message: Your public key has been saved in .

 6. send this public key to Lars.
 7. after Lars has added your key to the server, the following should work:

 ssh g...@git.lyx.org info
 and
 git clone g...@git.lyx.org:testing

 8. Enjoy your checkout of the git test repo.

 Vincent





Re: git.lyx.org - developers! your ssh public key please

2012-03-03 Thread Yihui Xie
Fair enough. Decision time: GitHub is heaven for me, and sort of hell
for you; it is a personal matter of taste, so I'm not going to
continue this discussion.

Sorry to bother all, and thank you all for the great work! I love LyX
and GIT, both of which have significantly increased my productivity.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sat, Mar 3, 2012 at 11:54 AM, Vincent van Ravesteijn v...@lyx.org wrote:
 Op 3-3-2012 18:00, Yihui Xie schreef:

 I mean discussion in email is less efficient than directly in code,
 where you can point out why this line is not good, and how that line
 needs improvement, etc.


 If you're interested, I'll share some discussion of the git developers
 themselves. The git-community itself works only with e-mail. They don't have
 a bug tracker, and all the code, of all developers goes through the mailing
 list.

 See the following discussion which took place in the last few days:
 http://thread.gmane.org/gmane.comp.version-control.git/191835

 Some quotes from this thread:

 ... the design of git was created with the idea of handling patches via
 e-mail in mind.
 I run a project that is mainly hosted on github, but I absolutely
 positively refuse to use their web interface for anything.
 I want everything in *one* interface, and I want it just the way *I* want
 it, and it shouldn't (necessarily) dictate how *you* should work. Email is
 just that.

 Vincent


Re: git.lyx.org - developers! your ssh public key please

2012-03-03 Thread Yihui Xie
I mean discussion in email is less efficient than directly in code,
where you can point out why this line is not good, and how that line
needs improvement, etc.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sat, Mar 3, 2012 at 4:31 AM, Lars Gullik Bjønnes <lar...@gullik.org> wrote:
> On Sat, Mar 3, 2012 at 04:25, Yihui Xie <x...@yihui.name> wrote:
> [...]
>> Personally I believe it is very inefficient to email patches
>
> In what way inefficient?
>
> git send-email HEAD~3
>
> to send the small patchset for commenting somewhere is not exactly hard.
>
>> and it is
>> so inconvenient to discuss code in emails.
>
> I couldn't disagree more I think.
>
> --
>         Lgb


Re: git.lyx.org - developers! your ssh public key please

2012-03-03 Thread Yihui Xie
This is expected to me: programmers tend to do everything by
themselves. I cannot promise all the conversions, but GitHub supports
importing from an svn repo with one click, so if you want to move
there, I can certainly do it. For the rest of the jobs, they require
more time, but I believe after the conversion it will be easier to
maintain since almost everything is under GIT. I'm willing to
contribute some time if you want, but from the replies I have got so
far, I guess I can give up the attempt to convince you now.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sat, Mar 3, 2012 at 4:06 AM, Lars Gullik Bjønnes <lar...@gullik.org> wrote:
>> In short, this is approximately true for me: GitHub = GIT + Trac +
>> Wiki + Web and all are based on GIT. Anyway, this is just my 2 cents
>> when I saw the transition from SVN to GIT, and of course you are free
>> to invest time and efforts in setting up your own server.
>
> Will _you_ step up to do all the conversions needed?
> We already have an extensive wiki, we have nice web pages
> and a running bug tracker.
>
> Setting up a gitolite server for git is easy. And it is not like we are
> closing the door on a later move to some git hosting service.
>
> --
>         Lgb


Re: git.lyx.org - developers! your ssh public key please

2012-03-03 Thread Yihui Xie
Uwe,

Since you work under Windows, I also recommend TortoiseGIT with
msysgit, unless you like working with CLI heavily.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sat, Mar 3, 2012 at 7:32 AM, Vincent van Ravesteijn <v...@lyx.org> wrote:
> Op 3-3-2012 14:17, Uwe Stöhr schreef:
>
>> Am 02.03.2012 02:07, schrieb Lars Gullik Bjønnes:
>>
>>> I am not going to setup anonymous cloning right now, but I want
>>> developers to send me their public ssh keys.
>>
>>
>> I never used SSH until now, so could anybody please give me a short
>> introduction what I need to do?
>>
>> thanks and regards
>> Uwe
>
>
> 1. Install:
> http://msysgit.googlecode.com/files/Git-1.7.9-preview20120201.exe
> 2. Start "Git Bash"
> 3. type "ssh-keygen"
> 4. press enter to store the key in the default location
> 5. enter a passphrase or just press enter
>
> You'll get a message: "Your public key has been saved in ."
>
> 6. send this public key to Lars.
> 7. after Lars has added your key to the server, the following should work:
>
> "ssh g...@git.lyx.org info"
> and
> "git clone g...@git.lyx.org:testing"
>
> 8. Enjoy your checkout of the git test repo.
>
> Vincent
>
>
>


Re: git.lyx.org - developers! your ssh public key please

2012-03-03 Thread Yihui Xie
Fair enough. Decision time: GitHub is heaven for me, and sort of hell
for you; it is a personal matter of taste, so I'm not going to
continue this discussion.

Sorry to bother all, and thank you all for the great work! I love LyX
and GIT, both of which have significantly increased my productivity.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sat, Mar 3, 2012 at 11:54 AM, Vincent van Ravesteijn <v...@lyx.org> wrote:
> Op 3-3-2012 18:00, Yihui Xie schreef:
>
> I mean discussion in email is less efficient than directly in code,
> where you can point out why this line is not good, and how that line
> needs improvement, etc.
>
>
> If you're interested, I'll share some discussion of the git developers
> themselves. The git-community itself works only with e-mail. They don't have
> a bug tracker, and all the code, of all developers goes through the mailing
> list.
>
> See the following discussion which took place in the last few days:
> http://thread.gmane.org/gmane.comp.version-control.git/191835
>
> Some quotes from this thread:
>
> "... the design of git was created with the idea of handling patches via
> e-mail in mind."
> "I run a project that is mainly hosted on github, but I absolutely
> positively refuse to use their web interface for anything."
> "I want everything in *one* interface, and I want it just the way *I* want
> it, and it shouldn't (necessarily) dictate how *you* should work. Email is
> just that."
>
> Vincent


Re: git.lyx.org - developers! your ssh public key please

2012-03-02 Thread Yihui Xie
Well, I think I understand some of the advantages of GIT like easy
branching. I do not even bother to compare it to SVN because GIT is so
much better.

I mean GitHub makes GIT even better; there are too many advantages and
I just list a few of them here:

1. developers manage their own SSH keys on GitHub and you do not need
to ask them to submit their public keys to you;

2. people who are not in the developer team can fork the project with
one-click to their own repositories, change the code and send pull
request online (instead of emailing patches) so that you can review
the patch online; a very critical feature here is you can _discuss_
the code line by line with the one who submit this patch -- comments
can be made in-between the code lines; if you are not satisfactory
with the patch, you can require one to revise the code and resubmit;
this process can go on and on until you are satisfied and accept the
patch; see here for an example of my own:
https://github.com/ramnathv/knitr/commit/33a75f4029

Personally I believe it is very inefficient to email patches and it is
so inconvenient to discuss code in emails. If people send me pull
requests on GitHub, I may merge them in a few minutes, but patches in
email often lay in my inbox for months.

3. you can either discuss on GitHub pages, or directly reply the email
notifications from GitHub about the discussions; the email will go to
GitHub. This is unlike trac, you have to go to the web page to discuss
(maybe there are configurations that enable trac to manage emails, but
I did not see this happen in LyX SVN ages).

4. bugs tracker; they call issues, which are also closely tied to
code; you can write a commit message like fixed #43 to fix the issue
43 (the issue will be closed and there will be a reference to the
commit in the issue page); it is also more convenient to manage bug
reports: one thing I do not like trac is I'm unable to change the
report after I submit it (e.g. I want to add more code examples, or
fix typos).

5. wiki support: you can manage wiki pages by GIT, or edit them
online; the default aesthetics looks good (e.g.
https://github.com/yihui/formatR/wiki)

6. GitHub pages: you can even manage your website on GitHub by
creating a branch named gh-pages and use the Jekyll engine to
compile markdown files to HTML (this is automatic on GitHub so you
only maintain lightweight markdown files); it is easy to setup and
after that, you can manage the website by GIT (see, everything on
GitHub can go to GIT); sorry to use my own projects as examples again,
but you can see the source
https://github.com/yihui/knitr/tree/gh-pages of the site
http://yihui.name/knitr/ for example

Here is a recent article Lord of the Files: How GitHub Tamed Free
Software (And More):
http://www.wired.com/wiredenterprise/2012/02/github/all/1

In short, this is approximately true for me: GitHub = GIT + Trac +
Wiki + Web and all are based on GIT. Anyway, this is just my 2 cents
when I saw the transition from SVN to GIT, and of course you are free
to invest time and efforts in setting up your own server.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Fri, Mar 2, 2012 at 4:01 AM, Vincent van Ravesteijn v...@lyx.org wrote:
 Op 2-3-2012 7:35, Yihui Xie schreef:

 I was actually wondering why not move to GitHub directly since
 everything is ready there and it saves a huge amount of server admin
 efforts... Maybe I missed some conversations earlier, but IMHO GitHub
 makes collaborations way way easier.


 In what sense does it make it easier ? Pull requests are nice, but this
 requires all developers to read the mailing lists and to keep track of any
 pull requests on github. It's easy to submit patches to the mailing list
 using git send-email. In this way, all developers can respond.

 Using git, you could acquire commit rights faster than using svn, because at
 first you will be restricted to pushing branches like
 yihuixie/new-feature. This won't affect the source code until it gets
 merged in by someone.

 Vincent


Re: git.lyx.org - developers! your ssh public key please

2012-03-02 Thread Yihui Xie
Well, I think I understand some of the advantages of GIT like easy
branching. I do not even bother to compare it to SVN because GIT is so
much better.

I mean GitHub makes GIT even better; there are too many advantages and
I just list a few of them here:

1. developers manage their own SSH keys on GitHub and you do not need
to ask them to submit their public keys to you;

2. people who are not in the developer team can fork the project with
one-click to their own repositories, change the code and send pull
request online (instead of emailing patches) so that you can review
the patch online; a very critical feature here is you can _discuss_
the code line by line with the one who submit this patch -- comments
can be made in-between the code lines; if you are not satisfactory
with the patch, you can require one to revise the code and resubmit;
this process can go on and on until you are satisfied and accept the
patch; see here for an example of my own:
https://github.com/ramnathv/knitr/commit/33a75f4029

Personally I believe it is very inefficient to email patches and it is
so inconvenient to discuss code in emails. If people send me pull
requests on GitHub, I may merge them in a few minutes, but patches in
email often lay in my inbox for months.

3. you can either discuss on GitHub pages, or directly reply the email
notifications from GitHub about the discussions; the email will go to
GitHub. This is unlike trac, you have to go to the web page to discuss
(maybe there are configurations that enable trac to manage emails, but
I did not see this happen in LyX SVN ages).

4. bugs tracker; they call "issues", which are also closely tied to
code; you can write a commit message like "fixed #43" to fix the issue
43 (the issue will be closed and there will be a reference to the
commit in the issue page); it is also more convenient to manage bug
reports: one thing I do not like trac is I'm unable to change the
report after I submit it (e.g. I want to add more code examples, or
fix typos).

5. wiki support: you can manage wiki pages by GIT, or edit them
online; the default aesthetics looks good (e.g.
https://github.com/yihui/formatR/wiki)

6. GitHub pages: you can even manage your website on GitHub by
creating a branch named "gh-pages" and use the Jekyll engine to
compile markdown files to HTML (this is automatic on GitHub so you
only maintain lightweight markdown files); it is easy to setup and
after that, you can manage the website by GIT (see, everything on
GitHub can go to GIT); sorry to use my own projects as examples again,
but you can see the source
https://github.com/yihui/knitr/tree/gh-pages of the site
http://yihui.name/knitr/ for example

Here is a recent article "Lord of the Files: How GitHub Tamed Free
Software (And More)":
http://www.wired.com/wiredenterprise/2012/02/github/all/1

In short, this is approximately true for me: GitHub = GIT + Trac +
Wiki + Web and all are based on GIT. Anyway, this is just my 2 cents
when I saw the transition from SVN to GIT, and of course you are free
to invest time and efforts in setting up your own server.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Fri, Mar 2, 2012 at 4:01 AM, Vincent van Ravesteijn <v...@lyx.org> wrote:
> Op 2-3-2012 7:35, Yihui Xie schreef:
>>
>> I was actually wondering why not move to GitHub directly since
>> everything is ready there and it saves a huge amount of server admin
>> efforts... Maybe I missed some conversations earlier, but IMHO GitHub
>> makes collaborations way way easier.
>>
>
> In what sense does it make it easier ? Pull requests are nice, but this
> requires all developers to read the mailing lists and to keep track of any
> pull requests on github. It's easy to submit patches to the mailing list
> using "git send-email". In this way, all developers can respond.
>
> Using git, you could acquire commit rights faster than using svn, because at
> first you will be restricted to pushing branches like
> "yihuixie/new-feature". This won't affect the source code until it gets
> merged in by someone.
>
> Vincent


Re: git.lyx.org - developers! your ssh public key please

2012-03-01 Thread Yihui Xie
I was actually wondering why not move to GitHub directly since
everything is ready there and it saves a huge amount of server admin
efforts... Maybe I missed some conversations earlier, but IMHO GitHub
makes collaborations way way easier.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Fri, Mar 2, 2012 at 12:09 AM, Xu Wang xuwang...@gmail.com wrote:
 Excellent! How does this work for non-developers? For example, I would like
 to be able to do something and then do a pull-request. I think at this point
 I can only fix typos and maybe a small error, but my work would need to be
 verified.

 Thank you for this, Xu

 On Thu, Mar 1, 2012 at 8:07 PM, Lars Gullik Bjønnes lar...@gullik.org
 wrote:

 I have begun to setup and do the lyx conversion proper.
 Expect things to happen fairly quick now.

 However I do not want to do this _too_ fast.

 http://git.lyx.org/

 I am not going to setup anonymous cloning right now, but I want
 developers to send me their public ssh keys.
 (If you do not already have write access to the svn repo, don't bother
 sending me a public key either. Be sure to send as attachment.)

 After I get your public key and add it you will get
 access to clone, push and pull to the testing repo.
 Play all you like with that.

 In the meantime I will fixup the git repo I have of lyx, and
 we should be able to make the switch over failr quick.
 We need to make the proper track setup first though.

 --
         Lgb




Re: git.lyx.org - developers! your ssh public key please

2012-03-01 Thread Yihui Xie
I was actually wondering why not move to GitHub directly since
everything is ready there and it saves a huge amount of server admin
efforts... Maybe I missed some conversations earlier, but IMHO GitHub
makes collaborations way way easier.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Fri, Mar 2, 2012 at 12:09 AM, Xu Wang <xuwang...@gmail.com> wrote:
> Excellent! How does this work for non-developers? For example, I would like
> to be able to do something and then do a pull-request. I think at this point
> I can only fix typos and maybe a small error, but my work would need to be
> verified.
>
> Thank you for this, Xu
>
> On Thu, Mar 1, 2012 at 8:07 PM, Lars Gullik Bjønnes <lar...@gullik.org>
> wrote:
>>
>> I have begun to setup and do the lyx conversion proper.
>> Expect things to happen fairly quick now.
>>
>> However I do not want to do this _too_ fast.
>>
>> http://git.lyx.org/
>>
>> I am not going to setup anonymous cloning right now, but I want
>> developers to send me their public ssh keys.
>> (If you do not already have write access to the svn repo, don't bother
>> sending me a public key either. Be sure to send as attachment.)
>>
>> After I get your public key and add it you will get
>> access to clone, push and pull to the testing repo.
>> Play all you like with that.
>>
>> In the meantime I will fixup the git repo I have of lyx, and
>> we should be able to make the switch over failr quick.
>> We need to make the proper track setup first though.
>>
>> --
>>         Lgb
>
>


Re: LyX 2.0.3 Binaries?

2012-02-27 Thread Yihui Xie
I tested it quickly under Windows 7, and it worked fine. Thanks!

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Mon, Feb 27, 2012 at 5:08 PM, Uwe Stöhr uwesto...@web.de wrote:

 Here is my installer:
 https://sourceforge.net/projects/lyxwininstaller/

 I tested it on Win XP 64 bit, Win 7 32bit and Win 7 64bit.

 It should now be mature enough to become soon the official one. The only
 thing that is now missing is that you still need admin privileges to install
 LyX, but work is in progress with the ImageMagick people to make this
 possible.

 Any testing and comments are welcome.

 regards
 Uwe


Re: LyX 2.0.3 Binaries?

2012-02-27 Thread Yihui Xie
I tested it quickly under Windows 7, and it worked fine. Thanks!

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Mon, Feb 27, 2012 at 5:08 PM, Uwe Stöhr <uwesto...@web.de> wrote:
>
> Here is my installer:
> https://sourceforge.net/projects/lyxwininstaller/
>
> I tested it on Win XP 64 bit, Win 7 32bit and Win 7 64bit.
>
> It should now be mature enough to become soon the official one. The only
> thing that is now missing is that you still need admin privileges to install
> LyX, but work is in progress with the ImageMagick people to make this
> possible.
>
> Any testing and comments are welcome.
>
> regards
> Uwe


Re: Mailing List Problem

2012-02-25 Thread Yihui Xie
Yes I saw that as well when I replied Paul Johnson's post.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sat, Feb 25, 2012 at 3:03 PM, Richard Heck rgh...@comcast.net wrote:

 It looks as if supp...@casinodesk.com has gotten into our lyx-user mailing
 list somehow, and it's sending replies to everything. Can someone remove it?

 Richard



Re: Mailing List Problem

2012-02-25 Thread Yihui Xie
Yes I saw that as well when I replied Paul Johnson's post.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sat, Feb 25, 2012 at 3:03 PM, Richard Heck <rgh...@comcast.net> wrote:
>
> It looks as if supp...@casinodesk.com has gotten into our lyx-user mailing
> list somehow, and it's sending replies to everything. Can someone remove it?
>
> Richard
>


Re: LyX 2.0.3 Sources Available

2012-02-19 Thread Yihui Xie
Good with Ubuntu 11.10:

Configuration
  Host type:x86_64-unknown-linux-gnu
  Special build flags:  build=release use-aspell use-hunspell
  C   Compiler: gcc
  C   Compiler LyX flags:
  C   Compiler flags:-O2
  C++ Compiler: g++ (4.6.1)
  C++ Compiler LyX flags:
  C++ Compiler flags:-O2
  Linker flags:
  Linker user flags:
  Qt 4 Frontend:
  Qt 4 version: 4.7.4
  Packaging:posix
  LyX binary dir:   /usr/local/bin
  LyX files dir:/usr/local/share/lyx

Configuration of LyX was successful.


Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sun, Feb 19, 2012 at 2:05 PM, Stephan Witt st.w...@gmx.net wrote:
 Am 19.02.2012 um 17:18 schrieb Richard Heck:

 LyX 2.0.3 source tarballs are available from:
    http://frege.brown.edu/lyx/
 Please let me know if there are any difficulties. I'll plan to release late 
 this week (Friday or Saturday) if there are not.

 Please note that branch is still closed.



Re: LyX 2.0.3 Sources Available

2012-02-19 Thread Yihui Xie
I have installed from your PPA and it seems to be working well. Thanks!

One minor point: one needs to import the key before Ubuntu can use
that repository

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com A64833C9F8214ACD

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sun, Feb 19, 2012 at 2:40 PM, Liviu Andronic landronim...@gmail.com wrote:
 On Sun, Feb 19, 2012 at 5:18 PM, Richard Heck rgh...@comcast.net wrote:
 LyX 2.0.3 source tarballs are available from:

 Ubuntu binaries are available on the LyX Team PPA [1]. Should anyone
 trying the PPA encounter any issues with those, please let me know.
 [1] https://launchpad.net/~lyx-devel/+archive/release

 Configuration
  Host type:                    x86_64-pc-linux-gnu
  Special build flags:          build=release warnings use-aspell
 use-enchant use-hunspell
  C   Compiler:                 gcc
  C   Compiler LyX flags:
  C   Compiler flags:            -g -O2
  C++ Compiler:                 g++ (4.4.3)
  C++ Compiler LyX flags:
  C++ Compiler flags:            -g -O2
  Linker flags:
  Linker user flags:            -Wl,-Bsymbolic-functions -Wl,-z,defs
 -Wl,--as-needed -Wl,-z,defs -Wl,--as-needed
  Qt 4 Frontend:
      Qt 4 version:             4.6.2
  Packaging:                    posix
  LyX binary dir:               /usr/bin
  LyX files dir:                /usr/share/lyx


 Liviu


Re: LyX 2.0.3 Sources Available

2012-02-19 Thread Yihui Xie
Good with Ubuntu 11.10:

Configuration
  Host type:x86_64-unknown-linux-gnu
  Special build flags:  build=release use-aspell use-hunspell
  C   Compiler: gcc
  C   Compiler LyX flags:
  C   Compiler flags:-O2
  C++ Compiler: g++ (4.6.1)
  C++ Compiler LyX flags:
  C++ Compiler flags:-O2
  Linker flags:
  Linker user flags:
  Qt 4 Frontend:
  Qt 4 version: 4.7.4
  Packaging:posix
  LyX binary dir:   /usr/local/bin
  LyX files dir:/usr/local/share/lyx

Configuration of LyX was successful.


Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sun, Feb 19, 2012 at 2:05 PM, Stephan Witt <st.w...@gmx.net> wrote:
> Am 19.02.2012 um 17:18 schrieb Richard Heck:
>
>> LyX 2.0.3 source tarballs are available from:
>>    http://frege.brown.edu/lyx/
>> Please let me know if there are any difficulties. I'll plan to release late 
>> this week (Friday or Saturday) if there are not.
>>
>> Please note that branch is still closed.
>


Re: LyX 2.0.3 Sources Available

2012-02-19 Thread Yihui Xie
I have installed from your PPA and it seems to be working well. Thanks!

One minor point: one needs to import the key before Ubuntu can use
that repository

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com A64833C9F8214ACD

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sun, Feb 19, 2012 at 2:40 PM, Liviu Andronic <landronim...@gmail.com> wrote:
> On Sun, Feb 19, 2012 at 5:18 PM, Richard Heck <rgh...@comcast.net> wrote:
>> LyX 2.0.3 source tarballs are available from:
>>
> Ubuntu binaries are available on the LyX Team PPA [1]. Should anyone
> trying the PPA encounter any issues with those, please let me know.
> [1] https://launchpad.net/~lyx-devel/+archive/release
>
> Configuration
>  Host type:                    x86_64-pc-linux-gnu
>  Special build flags:          build=release warnings use-aspell
> use-enchant use-hunspell
>  C   Compiler:                 gcc
>  C   Compiler LyX flags:
>  C   Compiler flags:            -g -O2
>  C++ Compiler:                 g++ (4.4.3)
>  C++ Compiler LyX flags:
>  C++ Compiler flags:            -g -O2
>  Linker flags:
>  Linker user flags:            -Wl,-Bsymbolic-functions -Wl,-z,defs
> -Wl,--as-needed -Wl,-z,defs -Wl,--as-needed
>  Qt 4 Frontend:
>      Qt 4 version:             4.6.2
>  Packaging:                    posix
>  LyX binary dir:               /usr/bin
>  LyX files dir:                /usr/share/lyx
>
>
> Liviu


Re: [patch] support for verbatim

2012-02-12 Thread Yihui Xie
I have been curious about this too; even listings is well supported,
but the verbatim environment is not.

I believe a better HTML tag should be pre/pre instead of
blockquote in this case.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sun, Feb 12, 2012 at 6:58 PM, Uwe Stöhr uwesto...@web.de wrote:
 verbatim is a standard environment in almost all document classes but LyX
 does for an unknown reason not support it.
 We got from time to time requests to support it and we have some open bugs
 that tex2lyx fails to import files because of this.

 Attached is a fix that implements this, it works for all document classes I
 have installed so I'm looking forward to get it in for LyX 2.1. (This would
 be a fileformat change of course.)

 Any opinions against supporting verbatim?

 Richard, I don't know what is the best output for HTML, any idea?

 regards Uwe


Re: [patch] support for verbatim

2012-02-12 Thread Yihui Xie
I have been curious about this too; even listings is well supported,
but the verbatim environment is not.

I believe a better HTML tag should be  instead of
blockquote in this case.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sun, Feb 12, 2012 at 6:58 PM, Uwe Stöhr <uwesto...@web.de> wrote:
> verbatim is a standard environment in almost all document classes but LyX
> does for an unknown reason not support it.
> We got from time to time requests to support it and we have some open bugs
> that tex2lyx fails to import files because of this.
>
> Attached is a fix that implements this, it works for all document classes I
> have installed so I'm looking forward to get it in for LyX 2.1. (This would
> be a fileformat change of course.)
>
> Any opinions against supporting verbatim?
>
> Richard, I don't know what is the best output for HTML, any idea?
>
> regards Uwe


Re: timeout when using the Sweave module

2012-02-09 Thread Yihui Xie
Per document or per machine sounds good to me. BTW, I have created a
ticket online so this issue will not be forgotten:
http://www.lyx.org/trac/ticket/8032

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Fri, Feb 3, 2012 at 7:37 AM, Jean-Marc Lasgouttes lasgout...@lyx.org wrote:
 Le 03/02/2012 04:08, Jack Tanner a écrit :

 Jean-Marc Lasgoutteslasgouttesat  lyx.org  writes:


 It is probably doable to set the timeout value per converter. This would
 be the best solution IMO.


 I can be convinced that setting the timeout value on a chunk-by-chunk
 basis is
 excessive, but per converter is too coarse. Maybe per document?


 You mean per-document and per machine, right? :p

 Seriously, the timeout only kicks in when a program is hung. For Sweave
 document, I do not think that having it set too large (would 1 hour be
 enough to you?) would hurt.

 Or do I misunderstood what these timeouts do?

 JMarc


Re: timeout when using the Sweave module

2012-02-09 Thread Yihui Xie
Per document or per machine sounds good to me. BTW, I have created a
ticket online so this issue will not be forgotten:
http://www.lyx.org/trac/ticket/8032

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Fri, Feb 3, 2012 at 7:37 AM, Jean-Marc Lasgouttes <lasgout...@lyx.org> wrote:
> Le 03/02/2012 04:08, Jack Tanner a écrit :
>
>> Jean-Marc Lasgouttes<lasgouttes  lyx.org>  writes:
>>
>>>
>>> It is probably doable to set the timeout value per converter. This would
>>> be the best solution IMO.
>>
>>
>> I can be convinced that setting the timeout value on a chunk-by-chunk
>> basis is
>> excessive, but per converter is too coarse. Maybe per document?
>>
>
> You mean per-document and per machine, right? :p
>
> Seriously, the timeout only kicks in when a program is hung. For Sweave
> document, I do not think that having it set too large (would 1 hour be
> enough to you?) would hurt.
>
> Or do I misunderstood what these timeouts do?
>
> JMarc


Re: timeout when using the Sweave module

2012-02-02 Thread Yihui Xie
The time-out restriction is from LyX, so Sweave/knitr cannot do
anything about it.

My current workaround is to export Rnw from LyX, run knitr on it with
cache turned on, and run LyX again since the time-consuming chunks
have been calculated and cached.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Thu, Feb 2, 2012 at 3:16 PM, Jack Tanner i...@hotmail.com wrote:
 Liviu Andronic landronimirc at gmail.com writes:


 Can the 'timeout' be configured? Or is it possible to treat
 Sweave/knitr documents differently? Regards

 One Sweave/knitr computation is different from another. I'd expect 1+1 to be
 computed quickly, but I also have some simulations that take hours, and I'd 
 love
 to use knitr to include those results in a LyX document. I'd vote for a global
 LyX setting that Sweave/knitr has a longer time-out by default, and a knitr
 option that allows different time-outs per chunk.



Re: timeout when using the Sweave module

2012-02-02 Thread Yihui Xie
The time-out restriction is from LyX, so Sweave/knitr cannot do
anything about it.

My current workaround is to export Rnw from LyX, run knitr on it with
cache turned on, and run LyX again since the time-consuming chunks
have been calculated and cached.

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Thu, Feb 2, 2012 at 3:16 PM, Jack Tanner <i...@hotmail.com> wrote:
> Liviu Andronic  gmail.com> writes:
>
>>
>> Can the 'timeout' be configured? Or is it possible to treat
>> Sweave/knitr documents differently? Regards
>
> One Sweave/knitr computation is different from another. I'd expect 1+1 to be
> computed quickly, but I also have some simulations that take hours, and I'd 
> love
> to use knitr to include those results in a LyX document. I'd vote for a global
> LyX setting that Sweave/knitr has a longer time-out by default, and a knitr
> option that allows different time-outs per chunk.
>


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Yihui Xie
I guess you compiled the document under
/usr/local/share/lyx-2.0.3svn/examples/, right?

I believe the problem is that R has no write privilege to that
directory, so the default pdf() device cannot be started there. You
can copy sweave.lyx to a directory where you have write privilege, and
see if it compiles correctly.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



2012/2/1 Jean-Pierre Chrétien jeanpierre.chret...@free.fr:
 Hello,

 I took a look to the new specific manual describing sweave with the latest
 2.0.3svn. The pdf export fails on an Rscript error:

 cite
 Running: Rscript --verbose --no-save --no-restore
 /usr/local/share/lyx-2.0.3svn/scripts/lyxsweave.R
 /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.Rnw
 /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.tex ISO-8859-15
 /usr/local/share/lyx-2.0.3svn/examples/
 running
  '/usr/lib/R/bin/R --slave --no-restore --no-save --no-restore
 --file=/usr/local/share/lyx-2.0.3svn/scripts/lyxsweave.R --args
 /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.Rnw
 /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.tex ISO-8859-15'

 [1] FALSE
 Writing to file /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.tex
 Processing code chunks ...
  1 : term verbatim
  2 : echo (label=sweave-sty)
  3 : echo keep.source term verbatim (label=setup)
  4 : echo keep.source (label=sweave-manual)
  5 : echo keep.source term verbatim (label=print-integers)
  6 : echo term hide (label=hide-results)
  7 : echo term verbatim (label=calculator)
  8 : echo term verbatim (label=rnorm)
  9 : echo term verbatim (label=iris-summary)
 10 : term tex (label=xtable-demo)
 Loading required package: xtable
 11 : echo term verbatim eps pdf (label=iris-pairs)

 Erreur :  chunk 11 (label=iris-pairs)
 Error in function (file = ifelse(onefile, Rplots.pdf, Rplot%03d.pdf),  :
  impossible de démarrer le périphérique pdf
 De plus : Messages d'avis :
 1: In library(package, lib.loc = lib.loc, character.only = TRUE,
 logical.return = TRUE,  :
  there is no package called 'xtable'
 2: In function (file = ifelse(onefile, Rplots.pdf, Rplot%03d.pdf),  :
  impossible d'ouvrir le fichier en argument de 'pdf' 'Rplots.pdf'
 Exécution arrêtée
 Systemcall.cpp(270): Systemcall: 'Rscript --verbose --no-save --no-restore
 /usr/local/share/lyx-2.0.3svn/scripts/lyxsweave.R
 /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.Rnw
 /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.tex ISO-8859-15
 /usr/local/share/lyx-2.0.3svn/examples/' finished with exit code 1
 Error: Conversion du fichier impossible
 /cite

 I installed R and related packages on my Debian box (Squeeze, R version
 2.11). While updating fr.po for 2.0.3, I saw something about a requirement
 for R version =2.14.
 Is that the reason of failure ?

 --
 Jean-Pierre



Re: Sweave manual pdf compilation fails

2012-02-01 Thread Yihui Xie
You are right (ideally), but this is a long-lasting annoying problem
with R's default graphical device which is pdf() in the
non-interactive session. Unfortunately it has to create a file under
the current working directory (usually named Rplots.pdf). I requested
a true null device which does not write files, and it was implemented
in R 2.14.1, but again, unfortunately it has a bug which makes this
null device still write a file named NA. I have not got any response
from R core yet about this bug.

I can submit a simple patch to lyxsweave.R to avoid this problem by
redirecting the default file to a temp dir, but I'm not sure if it is
still in time. It should not break string freeze, though.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Wed, Feb 1, 2012 at 10:18 AM, Liviu Andronic landronim...@gmail.com wrote:
 On Wed, Feb 1, 2012 at 5:15 PM, Yihui Xie x...@yihui.name wrote:
 I guess you compiled the document under
 /usr/local/share/lyx-2.0.3svn/examples/, right?

 I believe the problem is that R has no write privilege to that
 directory, so the default pdf() device cannot be started there. You
 can copy sweave.lyx to a directory where you have write privilege, and
 see if it compiles correctly.

 Hmm, isn't the compilation supposed to be performed in a /tmp/ dir,
 where permissions are available?

 Liviu


  1   2   >