Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

LaTeX newbie here, so please be gentle.

I'm working with knitr to generate pdf report. The document consists of quite few large maps, with a lot of details or small multiples. Ideally, whenever such map appears, I'd like to set the page orientation to landscape and get the maximum figure that will fit into it.

So far I've been trying a set up of:

\documentclass[a4paper]{article}

% setting very small margins
\usepackage{fullpage}

% better for printing, page displayed vertically, content in landscape mode
% \usepackage{lscape}

% better for screen, page displayed horizontally, content in landscape mode
\usepackage{pdflscape}

But whenever i use \begin{landscape} I get an extra white page in front..

I tried the solution from this question, but it didn't remove the page.

And I still haven’t figure out the knitr settings for maximum available figure to fit. In chunk options I can use out.width='1\\linewidth'. Or I could use out.width, out.height but then I have to figure out dimensions myself right?

share|improve this question
1  
\begin{landscape} is akin to adding a figure the size of the page (a weak analogy, but...). a figure the size of the page needs to have a clean page to typeset on, so it issues \clearpage (or something). if you want your landscape stuff as “real figures”, use the rotating package’s sidewaysfigure (etc) environment (but note it doesn't have the pdflscape package’s tricks in it ... i’ve not managed to make that work yet). –  wasteofspace Apr 23 '13 at 16:17

1 Answer 1

up vote 4 down vote accepted

I do not see the extra white page you mentioned:

\documentclass[a4paper]{article}
\usepackage{fullpage}
\usepackage{pdflscape}
\begin{document}

\begin{landscape}
<<test, out.width='1\\linewidth', fig.width=7, fig.height=4>>=
par(mar=c(4, 4, .1, .1)); plot(1:10)
@
\end{landscape}

\end{document}

share|improve this answer
1  
Hi Yihui. Thanks a lot for answer (and your amazing work on knitr too!). It seemed that lack of figure size specifications was causing problems. I followed your suggestions and specified dimension out.width='10in', fig.width=16, fig.height=9 and that solved the problem. –  radek Apr 29 '13 at 9:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.