Re: Beamer background image on one slide only

2009-12-20 Thread Graham M Smith

I have finally worked this out

You need

ERT box{
\usebackgroundtemplate{\includegraphics[width=\paperwidth]
{/home/graham/Dropbox/Lectures/R-Intro/Images/Moon.png}}

Then the begin frame menu item

Frame content

Then end frame menu item

Then an ERT box with }

This seems to work fine , but is there a better way?

Graham

Graham M Smith wrote:
Using an ERT box I can add a background image to  Beamer presentation 
with


\usebackgroundtemplate{\includegraphics[width=\paperwidth]
{/home/graham/Dropbox/Lectures/R-Intro/Images/Moon.png}}

But this adds it to every slide, and I only want it on a single slide.

I have tried some other options such as putting this in the preamble 
(from searching the Lyx archives)


\newcommand\BackgroundPicture[1]{%
\setbeamertemplate{background}{%
\parbox[c][\paperheight]{\paperwidth}{%
\vfill \hfill 
\includegraphics[width=0.8\paperwidth,height=0.8\paperheight]{#1}

\hfill \vfill
}}}

and then

\BackgroundPicture{image}

But again this adds the same image to every slide.


I have tried replacing the image with nil \BackgroundPicture{} for the 
next slide to try and switch it off, and tried replacing it with a 
different image, but both are ignored.


The Latex instructions are to put the entire slide in a graphics block 
ended with a } but putting this in an ERT at the end of the slide 
throws an error. even when I have a matching { at the beginning of the 
code.


I have tried the "end frame" menu option, but again this doesn't stop 
the graphic appearing on all subsequent slides.


Hopefully this is one of those things that is easy to do, just 
difficult to find.


Thanks,

Graham




--
--
Graham M Smith
graham.sm...@myotis.co.uk

Station Cottage, Station Road
Binegar, Somerset
BA3 4UQ




Beamer background image on one slide only

2009-12-20 Thread Graham M Smith

Using an ERT box I can add a background image to  Beamer presentation with

\usebackgroundtemplate{\includegraphics[width=\paperwidth]
{/home/graham/Dropbox/Lectures/R-Intro/Images/Moon.png}}

But this adds it to every slide, and I only want it on a single slide.

I have tried some other options such as putting this in the preamble 
(from searching the Lyx archives)


\newcommand\BackgroundPicture[1]{%
\setbeamertemplate{background}{%
\parbox[c][\paperheight]{\paperwidth}{%
\vfill \hfill 
\includegraphics[width=0.8\paperwidth,height=0.8\paperheight]{#1}

\hfill \vfill
}}}

and then

\BackgroundPicture{image}

But again this adds the same image to every slide.


I have tried replacing the image with nil \BackgroundPicture{} for the 
next slide to try and switch it off, and tried replacing it with a 
different image, but both are ignored.


The Latex instructions are to put the entire slide in a graphics block 
ended with a } but putting this in an ERT at the end of the slide throws 
an error. even when I have a matching { at the beginning of the code.


I have tried the "end frame" menu option, but again this doesn't stop 
the graphic appearing on all subsequent slides.


Hopefully this is one of those things that is easy to do, just difficult 
to find.


Thanks,

Graham

--
--
Graham M Smith




Re: Optimising PDF file size - graphics management

2009-12-19 Thread Graham M Smith

José Matos

Except, I am only using screen grabs when I need to illustrate what the
screen looks like. Looking at my original post I should probably have
had a comma after "screen grabs".
  


With "screen grab" do you mean a screen shot of R's output?
  
No, when I said that I need to illustrate what the screen looks like, I 
literally meant what the screen looked like with multiple windows open, 
menus, toolbars etc.


In fact, in terms of Lyx the solution seems to be grabbing the screen as 
a png rather than a PDF.  the PNGs are a up to 25%  the size of the PDFs 
and Lyx seems to be able to re-size these with little loss of quality. 
Not as good as the PDF, but much smaller.  However, given that Lyx seems 
to do some optimisation anyway, whether it makes any difference to the 
size of the final document.


Graham




Re: Optimising PDF file size - graphics management

2009-12-19 Thread Graham M Smith

Paul

A suggestion Graham: try to produce vectorial graphics with R (and not
screen-shots); this will reduce the size of your graphics and improve
dramatically their quality.
  

Mmmm, yes :-)

Except, I am only using screen grabs when I need to illustrate what the 
screen looks like. Looking at my original post I should probably have 
had a comma after "screen grabs".


All the charts and graphs are exported from R as PDFs.

Graham




Optimising PDF file size - graphics management

2009-12-19 Thread Graham M Smith
Not really a Lyx question, but it has spawned from using Lyx, and Lyx 
users are likely to have an appropriate approach.


I have a 20 page Lyx Beamer document that I am compiling as an article 
(A4) and a presentation. Both PDFs end up at 2.7Mb.


The bulk of the documents are screen grabs and graphics produced from R. 
File sizes for the graphics range from a few kb to almost 1Mb (all PDFs) 
for the screenshots.


First question is whether there is any optimisation of file sizes during 
the compiling to PDF and the original file sizes don't really matter. 
This seems to the case to a certain extent as the total file size for 
all the graphics exceeds the 2.7Mb of the final file.


But should I still be trying to reduce the size of the original files. 
If so is there a best way of doing this, and is there guidance somewhere 
on target sizes and resolutions for different purposes.


It seems an obvious and recurring question that people might have, but 
googling seems to just throw up lots about web pages. So I would be 
interested if any Lyx users have established some routine for managing 
this problem.


I am using Ubuntu 9.1, most of the time.

Many thanks,

Graham


--
--
Graham M Smith




Re: organisation as author not cited properly

2009-12-07 Thread Graham M Smith



It's being shown this way in LyX or in the output?


As Stephen points out, it does in fact compile properly and looks fine 
as the PDF.  I jumped to the conclusion that as it wasn't looking right 
in Lyx, that it wouldn't compile properly either.


Never thought about compiling to check.

Thanks,

Graham


--
--
Graham M Smith
graham.sm...@myotis.co.uk





organisation as author not cited properly

2009-12-07 Thread Graham M Smith

I have a bibtex file created in Jabref

The entry in the author field is {R Development Core Team} but  Lyx is 
citing it as  Team (2009).


As I understand it, the curly brackets around the name should stop the 
contents being parsed like this.


Can I fix this.

Graham


--
--
Graham M Smith
graham.sm...@myotis.co.uk





Re: Sweave - R command line running off edge of page

2009-12-06 Thread Graham M Smith
I'm ashamed to say, that continued searching has found that I had 
already been given the answer to this earlier this year. But in a 
different context and my initial searches didn't find it.


The answer is to put the Sweave code into an ERT box and start it with:

/SweaveOpts{keep.source=TRUE}

This stops the R parser from ignoring the line break codes.

In the article class document that I copied the text from, I had added 
this to the preamble and hadn't realised it was there.


In fact I now also realise that you can use it as a scrap using 


<>=

Graham

Graham

Graham M Smith wrote:

I have an Sweave/lyx document with a long line of code .

As an article (noweb), ctrl+return allows me to break up the code and 
allow it to fit the page and still work as code.


I have pasted the text from the article class file into a new file 
that uses the book class (noweb). But now the line runs off the edge 
of the page and the single ctrl+return I can see, prints out as \n  
rather than wrapping the text.


As always, I could do with some suggestions as to how to fix this.

Graham





--
--
Graham M Smith
graham.sm...@myotis.co.uk

Station Cottage, Station Road
Binegar, Somerset
BA3 4UQ




Sweave - R command line running off edge of page

2009-12-05 Thread Graham M Smith

I have an Sweave/lyx document with a long line of code .

As an article (noweb), ctrl+return allows me to break up the code and 
allow it to fit the page and still work as code.


I have pasted the text from the article class file into a new file that 
uses the book class (noweb). But now the line runs off the edge of the 
page and the single ctrl+return I can see, prints out as \n  rather than 
wrapping the text.


As always, I could do with some suggestions as to how to fix this.

Graham


--
--
Graham M Smith
graham.sm...@myotis.co.uk





Re: adding appendix before Bibliography

2009-12-04 Thread Graham M Smith

OK,

The appendix box was a red herring as this wasn't what I wanted and 
removing [titletoc] from the load package line seems to let it work.


Graham

Graham M Smith wrote:
After searching the forum I have downloaded a sample file illustrating 
using the appendix package. I want the appendices to come before the 
bibliography


I have added

\usepackage[titletoc]{appendix} to the preamble
and

\begin{appendices} and \end{appendices}


but the example file seems to have these commands wrapped in an 
"appendix" box, but I can't work out how to do this.


I would appreciate some help.

Thanks,

Graham




--
--
Graham M Smith
graham.sm...@myotis.co.uk

Station Cottage, Station Road
Binegar, Somerset
BA3 4UQ




adding appendix before Bibliography

2009-12-04 Thread Graham M Smith
After searching the forum I have downloaded a sample file illustrating 
using the appendix package. I want the appendices to come before the 
bibliography


I have added

\usepackage[titletoc]{appendix} to the preamble
and

\begin{appendices} and \end{appendices}


but the example file seems to have these commands wrapped in an 
"appendix" box, but I can't work out how to do this.


I would appreciate some help.

Thanks,

Graham

--
--
Graham M Smith
graham.sm...@myotis.co.uk





Re: [LyX] Lattice library and sweave

2009-11-26 Thread Graham M Smith

Kevin,

As you will now have seen, problem was solved.

Thanks,

Graham

Kevin Middleton wrote:

Wrap the xyplot line in an explicit print() statement:

print(xyplot(light.trans~simpson))



On Nov 26, 2009, at 8:53 AM, Graham M Smith wrote:

  

Should the lattice library work with Lyx?

Ubuntu 9.04, Lyx 1.6.2, R 2.10 with latest version of lattice.

It seems to compile OK, but although the code appears I get no plot.

<>=
library(lattice)
xyplot(light.trans~simpson)
@

Anyone any ideas?

Thanks,

Graham

--
--
Graham M Smith






  



--
--
Graham M Smith
graham.sm...@myotis.co.uk

Station Cottage, Station Road
Binegar, Somerset
BA3 4UQ




Re: Lattice library and sweave

2009-11-26 Thread Graham M Smith

OK, with help from Mateo, you need to add a print command as below:

<>=
library(lattice)
print(xyplot(light.trans~simpson))
@

Graham

Graham M Smith wrote:
Actually, I now realise I had this problem before and it was solved by 
changing the encoding to UTF8, but its not working this time.


Graham

Graham M Smith wrote:

Should the lattice library work with Lyx?

Ubuntu 9.04, Lyx 1.6.2, R 2.10 with latest version of lattice.

It seems to compile OK, but although the code appears I get no plot.

<>=
library(lattice)
xyplot(light.trans~simpson)
@

Anyone any ideas?

Thanks,

Graham







--
--
Graham M Smith
graham.sm...@myotis.co.uk

Station Cottage, Station Road
Binegar, Somerset
BA3 4UQ




Re: Lattice library and sweave

2009-11-26 Thread Graham M Smith
Actually, I now realise I had this problem before and it was solved by 
changing the encoding to UTF8, but its not working this time.


Graham

Graham M Smith wrote:

Should the lattice library work with Lyx?

Ubuntu 9.04, Lyx 1.6.2, R 2.10 with latest version of lattice.

It seems to compile OK, but although the code appears I get no plot.

<>=
library(lattice)
xyplot(light.trans~simpson)
@

Anyone any ideas?

Thanks,

Graham




--
--
Graham M Smith
graham.sm...@myotis.co.uk

Station Cottage, Station Road
Binegar, Somerset
BA3 4UQ




Lattice library and sweave

2009-11-26 Thread Graham M Smith

Should the lattice library work with Lyx?

Ubuntu 9.04, Lyx 1.6.2, R 2.10 with latest version of lattice.

It seems to compile OK, but although the code appears I get no plot.

<>=
library(lattice)
xyplot(light.trans~simpson)
@

Anyone any ideas?

Thanks,

Graham

--
--
Graham M Smith





Re: Professional and Scientific Writing Book

2009-11-04 Thread Graham M Smith


>In addition, I'd really like some instructions/examples on how to 
create "business" like >documents. When I've tried, I've found it 
difficult and annoying to try to get the appearance the >way the company 
wants it. (With logos, lines and legaleese..). So tips and instructions 
on that >would certainly be useful


I would also support this.

Graham



Re: Professional and Scientific Writing Book

2009-11-03 Thread Graham M Smith

Rob

But are there other things that you would like to see?  The standard LyX
documentation is so good that I've found myself struggling to find other
topics that need to be covered, other than a tremendously quick overview
of the program and instructions on where to find the docs.
  
I wonder if something on Lyx/Sweave/R/Beamer might be useful. This 
combination is unbeatable (and I think unique, ignoring working with 
straight Latex) for anyone with scientific/statistics  related 
teaching/writing/presentations to do, but not immediately obvious how to 
get working, especially  with beamer (I am still trying to sort that out).


Graham







Re: How many use Linux: was[LyX] explicit mail subject

2009-09-11 Thread Graham M Smith

Paul A. Rubin wrote:

Steve Litt wrote:

On Friday 11 September 2009 09:58:04 Murray Eisenberg wrote:

But only a fraction of folks use Unix/Linux!


I've always assumed that fraction was about 4/5 but never examined 
that assumption. Does anyone know the percentages of LyX users on:


Linux
Windows
Mac
BSD
Other

Just to start the ball rolling, I've always used LyX on Linux (since 
2001) and am currently using it on Ubuntu 9.0.4.




Just to kick the ball out of bounds, how do you count cross-platform 
users?  I have it on one XP box and two Ubuntu boxes, and I use it 
heavily under both OSes.


When I first came across LyX (which goes back far enough that the only 
Windows version was a port that required Cygwin), Linux users vastly 
outnumbered Windows users.  From list traffic, I suspect Linux is 
still prevalent (followed by Windows, then Mac), but the "vastly" is 
likely no longer true.


/Paul

Well, I have it on a ubuntu 9.04 Thinkpad, a Mint Gloria eePC, a MacBook 
Pro, and two XP desktops (which have Mint Gloria running under 
Virtulisation also running Lyx) So work that one out :-)


Graham



Re: changing margins in article class when using Beamer

2009-08-13 Thread Graham M Smith

Paul
I'm using 1.6.2, on Ubuntu 9.04 and none of the margin/page controls 
are greyed out, so I can already adjust paper type/size and margins 
in article (beamer) as in any article. It was just that these then 
needed set back to "default" when switching back t Beamer.


Strange isn't it.



Strange indeed.  Did you by any chance hack the article-beamer.layout 
file?  Or might you have an old version of the layout files in your 
~/.lyx folder that maybe are superseding the current versions?  
This is fresh install of Ubuntu 9.04, on an HD that did have Windows on 
it, but I installed Ubuntu to use the entire disc.   Lyx was installed 
with synaptic and I haven't hacked/edited/changed any aspect of Lyx, so 
I have no idea why it isn't working as it should, especially as your 
other post says that its greyed out on you copy of Ubuntu.


Graham


Re: changing margins in article class when using Beamer

2009-08-13 Thread Graham M Smith

Jürgen

Graham M Smith wrote:
  

After changing to Beamer(article) class. I used the Document
Settings|Page Margins tab I unticked the default and changed the margin
sizes. I was hoping that Lyx would "magically" remember this was just
the default for the Beamer (article) bit, but it also took this as the
default for the Beamer class and refused to compile



I didn't follow this discussion in all detail, but wouldn't the use of a 
portmanteau beamer-article master solve this?


See:
http://wiki.lyx.org/LyX/Presentations#toc7
  

Indeed this does seem to be a solution :-)

Many thanks,

Graham



Re: changing margins in article class when using Beamer

2009-08-13 Thread Graham M Smith

Paul
Well, I have something to propose.  I still have no idea how you 
managed to change margins before (it should have been grayed out), 
unless maybe you're on an older version of LyX.  Since I could not 
change margins, I could not reproduce your results.


If you are using 1.6.x, though, I may have an answer.  The attached 
file is a replacement for the article-beamer layout file.  Drop it in 
your local layouts directory and reconfigure/restart LyX.  It should 
enable you to adjust paper type/size and margins in "article (beamer)" 
the same as in any article.  I've tested it both by converting 
existing presentations to articles and by using the embedding method 
in the link that Jürgen provided.
I'm using 1.6.2, on Ubuntu 9.04 and none of the margin/page controls are 
greyed out, so I can already adjust paper type/size and margins in 
article (beamer) as in any article. It was just that these then needed 
set back to "default" when switching back t Beamer.


Strange isn't it.

Thanks for your help.

Graham


Re: changing margins in article class when using Beamer

2009-08-12 Thread Graham M Smith

Pau

lI thank you for bringing the beamer(article) to my attention. That is
very handy for me as well. I can see that if I insert some branches,
then I can really customize which material is included in the article
output.  Nice!

Yes, its a superb capability, I was also hoping to use the branches 
feature as I give similar  lectures to different courses and the 
branches feature would allow me to quickly customise the content.

To answer  your margin question, I wonder how you changed the margins?
In all of the beamer examples I find, the margin options are grayed
out and I can't change them.

After changing to Beamer(article) class. I used the Document 
Settings|Page Margins tab I unticked the default and changed the margin 
sizes. I was hoping that Lyx would "magically" remember this was just 
the default for the Beamer (article) bit, but it also took this as the 
default for the Beamer class and refused to compile

That means we need to make the change either in the preamble or in the
lyx layout or latex style file.  Blech. I started to think "there has
to be a better way" and this way seems to do it.

\oddsidemargin 0.0in
\textwidth 6.0in
%%testing: does following have any effect?
%%\evensidemargin 0.0in

Yes, this was my next step, but was hoping to avoid commenting code in 
and out in the preamble, but its not really a problem.


I continue to be amazed at how brilliantly useful Lyx/Latex is :-)

Graham



Re: changing margins in article class when using Beamer

2009-08-12 Thread Graham M Smith

Paul


That's ok, I understood what you meant -- just not why you did it.  I 
don't use article (Beamer), but my impression is that it's purpose is 
to facilitate turning a slideshow into a paper (either after the fact 
or in parallel development).  I don't think it's really intended to 
reproduce slides in slide-like form (although I could be wrong), and 
in any case it seems to be overkill for handouts (unless maybe you 
mean to annotate the handouts a fair bit).
Ah, but we have a fundamental misunderstanding. The reason I started 
using Beamer was the very fact that I could prepare slides and lecture 
notes (article) in parallel.  I don't want a print out of the slides in 
a slide-like form.  I use the slide content as an outline for my 
lecture, but expand on this (with more text than you would want to put 
on the slides), and additional diagrams, examples, reference list etc as 
a class hand out. So students get properly written (and illustrated)  
hand outs, for my lectures.


In fact it was this capability that brought me to latex/beamer in the 
first place after a plea on various forums for any ideas on how I could 
keep my handouts and presentations in sync so I didn't have to try and 
keep two documents (Powerpoint and Word) up to date and in sync.  But 
Beamer became available in Lyx before I managed to develop any real 
expertise in Latex, even though I had started to rewrite all my lecture 
material in Latex


I have put up with the wide margins up to now, but it seems a waste of 
paper, and it would be useful to allow diagrams and graphs to expand 
across the full page width.


Am I in the wrong place? A simple handout option would be nice.  This 
is 1.6.2 on Ubuntu 9.04



In this case, just type the word 'handout' (no quotes) in the "Custom" 
field and then View->PDF (pdflatex).  What you get is a bunch of 
slides, one per page, same margins as the original. 
Ahh, now that is still useful, as I still produce a single copy like 
this for myself (as a guide for my lecture), but do it by commenting in 
and out the following lines in the preamble (lifted from one of my 
original Latex presentations)


%\usepackage{pgfpages}

%\pgfpagesuselayout{4 on 1}[a4paper,border shrink=2mm]

%\setbeamercolor{background canvas}{bg=black!1}

%\setbeamertemplate{footline}[page number]


Now that we aren't talking at cross purposes :-), have you any 
suggestions on my original question.



I could of course add a line for the margins in the preamble that I 
comment out and in depending on the output, but I was hoping for 
something a bit more automated than that.



Graham





Re: changing margins in article class when using Beamer

2009-08-12 Thread Graham M Smith

Paul
Any particular reason you are switching to the article class for 
handouts, as opposed to using the handout option in the class options 
field?

Mmmm,

I'm not switching to the article class, I'm switching to the "article 
(Beamer)" class. I realise now that I described this as "beamer article" 
class in my original post.


However, I can't see a handout option under  class options assuming this 
is meant to be under Document settings|document class.


The document class options predefined is ticked but greyed out with [No 
options predefined] in the field.


This is when Document Class "presentation(Beamer)" is selected.

Am I in the wrong place? A simple handout option would be nice.  This is 
1.6.2 on Ubuntu 9.04


Thanks,

Graham




Re: changing margins in article class when using Beamer

2009-08-11 Thread Graham M Smith

rh
If you can find some macro that is defined in this case, but not in 
the other case, then all you need is:

\ifx\thatmacro\undefined\relax\else
 your stuff here 
\fi
I don't know what \thatmacro might be, though.
Thanks, but unfortunately, this doesn't mean very much to me, I confess 
I was hoping for a single options line in the preamble :-(


Graham


changing margins in article class when using Beamer

2009-08-11 Thread Graham M Smith
I'm using Beamer, and producing a presentation handout by switching to 
the beamer article class, which defaults to wide margins.


If I change the margins in documents settings, this then prevents the 
beamer slides being produced (I get a compile error). I assume I can put 
something in the preamble that will switch the margins for beamer 
article only, but don't know what this might be.


Can anyone help with this?

Many thanks,

Graham


Re: Sweave with Beamer and Koma Script book

2009-06-20 Thread Graham M Smith

Jean-Marc Lasgouttes wrote:

Le 20 juin 09 à 12:02, Graham Smith a écrit :
Showing my ignorance of how all this works, but how do you get Sweave 
to work with Beamer and the Koma Script book class?
There is a Sweave module that has been posted to lyx-devel (I do not 
have it at hand) and that is

incorporated into 2.0.0svn. If you do not find it, I'll send a copy.

JMarc

Thanks, but not familiar with modules or svn for that matter.

Can I just add the module into the appropriate directory and then add it 
via document settings modules?


I have had a look for it, but not sure where or what exactly I am 
looking for.  Given its still a under development, am I going to be able 
to set up as a complete beginner?


Graham