Re: sweave module and custom font issues

2010-03-26 Thread Guenter Milde
On 2010-03-25, Jean-Marc Lasgouttes wrote:
 Jean-Marc Lasgouttes lasgout...@lyx.org writes:
 Solution 3: Use \PassOptionToClass. Hmm, it might just work.

 I just tried it and it did not work, because 
 \PassOptionToClass{noae}{Sweave}
 is not correct in presence of a \usepackage{/path/to/Sweave} command.

Did you try wiht \PassOptionToPackage?

This must appear *before* the \usepackage call.

Günter



Re: sweave module and custom font issues

2010-03-26 Thread Jean-Marc Lasgouttes

Le 26/03/2010 10:43, Guenter Milde a écrit :

On 2010-03-25, Jean-Marc Lasgouttes wrote:

Jean-Marc Lasgoutteslasgout...@lyx.org  writes:

Solution 3: Use \PassOptionToClass. Hmm, it might just work.



I just tried it and it did not work, because
\PassOptionToClass{noae}{Sweave}
is not correct in presence of a \usepackage{/path/to/Sweave} command.


Did you try wiht \PassOptionToPackage?

This must appear *before* the \usepackage call.


It works only when Sweave does not insert \usepackage with
absolute path to Sweave.Sty. In this situation, it is easier
to add explicitely \usepackage[noae]{Sweave}.

JMarc


Re: sweave module and custom font issues

2010-03-26 Thread Guenter Milde
On 2010-03-25, Jean-Marc Lasgouttes wrote:
> Jean-Marc Lasgouttes  writes:
>> Solution 3: Use \PassOptionToClass. Hmm, it might just work.

> I just tried it and it did not work, because 
> \PassOptionToClass{noae}{Sweave}
> is not correct in presence of a \usepackage{/path/to/Sweave} command.

Did you try wiht \PassOptionToPackage?

This must appear *before* the \usepackage call.

Günter



Re: sweave module and custom font issues

2010-03-26 Thread Jean-Marc Lasgouttes

Le 26/03/2010 10:43, Guenter Milde a écrit :

On 2010-03-25, Jean-Marc Lasgouttes wrote:

Jean-Marc Lasgouttes  writes:

Solution 3: Use \PassOptionToClass. Hmm, it might just work.



I just tried it and it did not work, because
\PassOptionToClass{noae}{Sweave}
is not correct in presence of a \usepackage{/path/to/Sweave} command.


Did you try wiht \PassOptionToPackage?

This must appear *before* the \usepackage call.


It works only when Sweave does not insert \usepackage with
absolute path to Sweave.Sty. In this situation, it is easier
to add explicitely \usepackage[noae]{Sweave}.

JMarc


Re: sweave module and custom font issues

2010-03-25 Thread Jean-Marc Lasgouttes
Liviu Andronic landronim...@gmail.com writes:

 Dear LyX developers
 I notice this issue in current SVN (probably Alpha1):
 1. open a new 'article' document
 2. add the Sweave module
 3. write something
 4. change Document  Fonts  Roman to 'Palatino'
 5. view  pdf
 6. the generated pdf will contain the CMR10

 A custom font is ignored whenever the Sweave module in included in the
 document. Would there be a way to work around this?

This is because Sweave uses the ae fonts by default :(

Fortunately there is the [noae] Sweave.sty option to avoid it.

Unfortunately, it is not easy to use automatically in LyX

Solution 1: add \usepackage[noae]{Sweave.sty} to the preamble. It
works well in the sense that Sweave will not add another
\usepackage{Sweave} line, but only make sense when the .sty file is in a
place where LaTeX can find it. By default, Sweave adds a line like
\usepackage{/path/to/sweave/Sweave.sty}

Solution 2: add noae to global documentclass options. This is
difficult to do in a module.

Solution 3: Use \PassOptionToClass. Hmm, it might just work.

JMarc


Re: sweave module and custom font issues

2010-03-25 Thread Jean-Marc Lasgouttes
Jean-Marc Lasgouttes lasgout...@lyx.org writes:
 Solution 3: Use \PassOptionToClass. Hmm, it might just work.

I just tried it and it did not work, because 
\PassOptionToClass{noae}{Sweave}
is not correct in presence of a \usepackage{/path/to/Sweave} command.

Sigh...

I like Sweave, but many design decisions are questionable.

The worse right now is that it does not work in when the latex input
encoding is not the same as the current locale (it does not know how to
read the file and one cannot force the encoding).

JMarc


Re: sweave module and custom font issues

2010-03-25 Thread Jean-Marc Lasgouttes
Liviu Andronic landronim...@gmail.com writes:
 Hmm, would it make sense to notify Friedrich Leisch, the author of Sweave?

I guess he knows already...

 And a question slightly departing from the original post, I am curious
 where should one choose the font for the actual R computations? In the
 attached .pdf, the code and results are displayed in a No name font
 (see attached screen shot). Is this something that can be set via the
 LaTeX preamble or the Sweave syntax?

Yes, Sweave uses fancyvrb.sty. In my documents I use:

\RecustomVerbatimEnvironment{Soutput}{Verbatim}{fontsize=\scriptsize}
\RecustomVerbatimEnvironment{Sinput}{Verbatim}{fontsize=\scriptsize, 
fontshape=sl}

You have to experiment to have the effect you want.

JMarc


Re: sweave module and custom font issues

2010-03-25 Thread Jean-Marc Lasgouttes
Liviu Andronic  writes:

> Dear LyX developers
> I notice this issue in current SVN (probably Alpha1):
> 1. open a new 'article' document
> 2. add the Sweave module
> 3. write "something"
> 4. change Document > Fonts > Roman to 'Palatino'
> 5. view > pdf
> 6. the generated pdf will contain the CMR10
>
> A custom font is ignored whenever the Sweave module in included in the
> document. Would there be a way to work around this?

This is because Sweave uses the ae fonts by default :(

Fortunately there is the [noae] Sweave.sty option to avoid it.

Unfortunately, it is not easy to use automatically in LyX

Solution 1: add "\usepackage[noae]{Sweave.sty}" to the preamble. It
works well in the sense that Sweave will not add another
\usepackage{Sweave} line, but only make sense when the .sty file is in a
place where LaTeX can find it. By default, Sweave adds a line like
\usepackage{/path/to/sweave/Sweave.sty}

Solution 2: add "noae" to global documentclass options. This is
difficult to do in a module.

Solution 3: Use \PassOptionToClass. Hmm, it might just work.

JMarc


Re: sweave module and custom font issues

2010-03-25 Thread Jean-Marc Lasgouttes
Jean-Marc Lasgouttes  writes:
> Solution 3: Use \PassOptionToClass. Hmm, it might just work.

I just tried it and it did not work, because 
\PassOptionToClass{noae}{Sweave}
is not correct in presence of a \usepackage{/path/to/Sweave} command.

Sigh...

I like Sweave, but many design decisions are questionable.

The worse right now is that it does not work in when the latex input
encoding is not the same as the current locale (it does not know how to
read the file and one cannot force the encoding).

JMarc


Re: sweave module and custom font issues

2010-03-25 Thread Jean-Marc Lasgouttes
Liviu Andronic  writes:
> Hmm, would it make sense to notify Friedrich Leisch, the author of Sweave?

I guess he knows already...

> And a question slightly departing from the original post, I am curious
> where should one choose the font for the actual R computations? In the
> attached .pdf, the code and results are displayed in a "No name" font
> (see attached screen shot). Is this something that can be set via the
> LaTeX preamble or the Sweave syntax?

Yes, Sweave uses fancyvrb.sty. In my documents I use:

\RecustomVerbatimEnvironment{Soutput}{Verbatim}{fontsize=\scriptsize}
\RecustomVerbatimEnvironment{Sinput}{Verbatim}{fontsize=\scriptsize, 
fontshape=sl}

You have to experiment to have the effect you want.

JMarc


Re: sweave module and custom font issues

2010-03-19 Thread Guenter Milde
On 2010-03-18, Liviu Andronic wrote:
 --0016e6d7f07bc6fb1e0482107256
 Content-Type: text/plain; charset=UTF-8

 On 3/18/10, Guenter Milde mi...@users.berlios.de wrote:
  Could you post a minimal tex file (i.e. the result of
  FileExportpdflatex).

 Yes, see attached. Any obvious issues with it?

Some:

1. The code before the preamble prevents error detection.

2. The package Sweave.sty is required, that is not available on CTAN.

3. Searching for Sweave.sty on the net, I found a version with this::

\ifthenelse{\boolean{swe...@ae}}{%
  \RequirePackage[T1]{fontenc}  
  \RequirePackage{ae}
}{}%

   which overwrites your font selection with the long deprecated ae
   virtual fonts (see l2tabu.pdf).
   
some solutions:

a) Load the font package after Sweave.sty (e.g. in the LaTeX preamble
   with the GUI font selector set to Default).

b) Load Sweave.sty with the noae option.

c) Tell the Sweave.sty maintainer not to load the deprecated package by
   default.

Günter



Re: sweave module and custom font issues

2010-03-19 Thread Guenter Milde
On 2010-03-18, Liviu Andronic wrote:
> --0016e6d7f07bc6fb1e0482107256
> Content-Type: text/plain; charset=UTF-8

> On 3/18/10, Guenter Milde  wrote:
>>  Could you post a minimal tex file (i.e. the result of
>>  File>Export>pdflatex).

> Yes, see attached. Any obvious issues with it?

Some:

1. The code before the preamble prevents error detection.

2. The package Sweave.sty is required, that is not available on CTAN.

3. Searching for Sweave.sty on the net, I found a version with this::

\ifthenelse{\boolean{swe...@ae}}{%
  \RequirePackage[T1]{fontenc}  
  \RequirePackage{ae}
}{}%

   which overwrites your font selection with the long deprecated "ae"
   virtual fonts (see l2tabu.pdf).
   
some solutions:

a) Load the font package after Sweave.sty (e.g. in the LaTeX preamble
   with the GUI font selector set to "Default").

b) Load Sweave.sty with the "noae" option.

c) Tell the Sweave.sty maintainer not to load the deprecated package by
   default.

Günter



Re: sweave module and custom font issues

2010-03-18 Thread Guenter Milde
On 2010-03-16, Liviu Andronic wrote:
 --0016e6d99b98aa25240481f389dc
 Content-Type: text/plain; charset=UTF-8

 Dear LyX developers
 I notice this issue in current SVN (probably Alpha1):
 1. open a new 'article' document
 2. add the Sweave module
 3. write something
 4. change Document  Fonts  Roman to 'Palatino'
 5. view  pdf
 6. the generated pdf will contain the CMR10

 A custom font is ignored whenever the Sweave module in included in the
 document. Would there be a way to work around this?

CMR10 (Computer Modern) is the default fallback font if the required
font is not available in the requested encoding, shape, family, ...

Could you post a minimal tex file (i.e. the result of
FileExportpdflatex).

Günter



Re: sweave module and custom font issues

2010-03-18 Thread Liviu Andronic
On 3/18/10, Guenter Milde mi...@users.berlios.de wrote:
  Could you post a minimal tex file (i.e. the result of
  FileExportpdflatex).

Yes, see attached. Any obvious issues with it?
Liviu


newfile1.tex
Description: TeX document


Re: sweave module and custom font issues

2010-03-18 Thread Guenter Milde
On 2010-03-16, Liviu Andronic wrote:
> --0016e6d99b98aa25240481f389dc
> Content-Type: text/plain; charset=UTF-8

> Dear LyX developers
> I notice this issue in current SVN (probably Alpha1):
> 1. open a new 'article' document
> 2. add the Sweave module
> 3. write "something"
> 4. change Document > Fonts > Roman to 'Palatino'
> 5. view > pdf
> 6. the generated pdf will contain the CMR10

> A custom font is ignored whenever the Sweave module in included in the
> document. Would there be a way to work around this?

CMR10 (Computer Modern) is the default fallback font if the required
font is not available in the requested encoding, shape, family, ...

Could you post a minimal tex file (i.e. the result of
File>Export>pdflatex).

Günter



Re: sweave module and custom font issues

2010-03-18 Thread Liviu Andronic
On 3/18/10, Guenter Milde  wrote:
>  Could you post a minimal tex file (i.e. the result of
>  File>Export>pdflatex).
>
Yes, see attached. Any obvious issues with it?
Liviu


newfile1.tex
Description: TeX document


sweave module and custom font issues

2010-03-16 Thread Liviu Andronic
Dear LyX developers
I notice this issue in current SVN (probably Alpha1):
1. open a new 'article' document
2. add the Sweave module
3. write something
4. change Document  Fonts  Roman to 'Palatino'
5. view  pdf
6. the generated pdf will contain the CMR10

A custom font is ignored whenever the Sweave module in included in the
document. Would there be a way to work around this?
Liviu


-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail


newfile1.lyx
Description: Binary data


newfile1.pdf
Description: Adobe PDF document


sweave module and custom font issues

2010-03-16 Thread Liviu Andronic
Dear LyX developers
I notice this issue in current SVN (probably Alpha1):
1. open a new 'article' document
2. add the Sweave module
3. write "something"
4. change Document > Fonts > Roman to 'Palatino'
5. view > pdf
6. the generated pdf will contain the CMR10

A custom font is ignored whenever the Sweave module in included in the
document. Would there be a way to work around this?
Liviu


-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail


newfile1.lyx
Description: Binary data


newfile1.pdf
Description: Adobe PDF document