5

I would like to have a figure in landscape format to fill the whole page, i.e. I would like the width to be the textheight of a portrait page or the textwidth of a landscape page, respectively.

Here is an example of my code:

\documentclass[a5paper, 11pt]{scrbook}

\usepackage{graphicx}
\usepackage{color}
\usepackage{pdflscape}    

\begin{document}    
\begin{landscape}
 \begin{figure}
 \centering
 \def\svgwidth{\textwidth}
 \input{figure.pdf_tex}
 \caption{Example Figure}
 \end{figure}
\end{landscape}    
\end{document}

When running this through pdfLaTeX I get a landscape figure that is as wide as the textwidth of a portrait page.

Using

\def\svgwidth{\textheight}

does not change the output.

How can I get the figure to fill the whole page?


I cannot include figure.pdf since this format is not allowed to upload, but you can find figure.png further down.

The following is the code content of figure.pdf_tex:

\begingroup% 
 \makeatletter%
 \providecommand\color[2][]{%
 \errmessage{(Inkscape) Color is used for the text in Inkscape, but the 
package 'color.sty' is not loaded}%
        \renewcommand\color[2][]{}%
 }%
 \providecommand\transparent[1]{%
 \errmessage{(Inkscape) Transparency is used (non-zero) for the text in Inkscape, but the package 'transparent.sty' is not loaded}%
   \renewcommand\transparent[1]{}% 
 }%
 \providecommand\rotatebox[2]{#2}%
\ifx\svgwidth\undefined%
\setlength{\unitlength}{782.075bp}%
 \ifx\svgscale\undefined%
  \relax%
 \else%
  \setlength{\unitlength}{\unitlength * \real{\svgscale}}%
 \fi%
 \else%
\setlength{\unitlength}{\svgwidth}%
 \fi%
 \global\let\svgwidth\undefined%
 \global\let\svgscale\undefined%
 \makeatother%
 \begin{picture}(1,0.48489595)%
  \put(0,0){\includegraphics[width=\unitlength]{figure.pdf}}%
  \put(0.21413974,0.24055332){\color[rgb]{0,0,0}\makebox(0,0)
[lb]{\smash{Text}}}%
\end{picture}%
\endgroup%

figure

7
  • 1
    Please edit your question and add the contents of the file figure.pdf_tex. I think this will make it easier to help you. – Ian Thompson Jan 22 '14 at 13:39
  • Are you sure you want to distort the figure? If it has scaled as much as possible re. width then forcing it to scale to height will obviously distort the proportions of the image. – cfr Jan 23 '14 at 1:34
  • Try \linewidth. It works for me with \resizebox. – John Kormylo Jan 23 '14 at 4:44
  • @JohnKormylo: \linewidth works perfectly for me. Please post this as an answer. – Bettina Jan 23 '14 at 7:24
  • @cfr: I do not want to distort the figure. Thing is, it has not scaled as much as possible regarding width. – Bettina Jan 23 '14 at 7:33
11

Try \linewidth. It works for me with \resizebox.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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