5
  \documentclass[10pt]{beamer}
  \usepackage{amsmath}
  \usepackage{amssymb}
  \usepackage[english]{babel}
  \usepackage{color}
  \usepackage{float}
  \usepackage[T1]{fontenc}
  \usepackage[latin1]{inputenc}
  \usepackage{pgf}
  \usepackage{setspace}
  \usepackage{textcomp}
  \usepackage{tikz}
  \usepackage{verbatim}
  \usepackage{mathrsfs}
  \usetikzlibrary{arrows,shapes}
  \usepackage{adjustbox}
  \usepackage{pgf,tikz}

  \mode<presentation>{
    \usetheme{Warsaw}
    \usecolortheme{crane}
    \setbeamertemplate{navigation symbols}{}
    \setbeamercovered{transparent}
  }

  \title{Disks}

  \AtBeginSubsection[]{
    \begin{frame}<beamer>{Outline}
    \tableofcontents[currentsection,currentsubsection]
    \end{frame}
  }

  \begin{document}
  \begin{frame}{Initial solution}
  %\begin{adjustbox}{max size={.95\textwidth}{.8\textheight}}
  \resizebox{11.5cm}{!}{%
  \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]%, scale=0.5]
      \coordinate (b) at (13,3) ;
      \coordinate (c) at (14,3) ;
      \coordinate (d) at (15,3) ;
      \coordinate (i) at (9,5)  ;
      \coordinate (g) at (9,4)  ;
      \coordinate (e) at (9,3)  ;
      \coordinate (n) at (5,3)  ;
    \coordinate (o) at (4,3)  ;
      \coordinate (p) at (3,3)  ;
      \coordinate (a) at (12,3) ;
      \coordinate (m) at (6,3)  ;
      \coordinate (h) at (10,5) ;
      \coordinate (j) at (10,4) ;
      \coordinate (f) at (10,3) ;
      \draw (p) circle [radius = 3];
      \draw (d) circle [radius = 3];
  \end{tikzpicture}
      }%
  %\end{adjustbox}
  \end{frame}
  \end{document}

In the MWE above,

  • When I use \resizebox to scale the picture, the entire picture (2 disks) are visible, provided I do not exceed 11.5cm (a value found out by trial-and-error, something I want to avoid) Using resizebox
  • Hence, I tried using adjustbox (as mentioned in the question here), but if I used adjustbox by commenting the \resizebox block and uncommenting the adjustbox line, the effect was as if I hadn't used it at all. (The disk on the right was completely left out of the picture.) Using adjustbox What am I doing wrong? I could finish my current slides using \resizebox, but I wanted to use the "better" way of "scaling only if required" using adjustbox, and wanted to understand why it isn't happening in my case...
TCSGrad
  • 872
  • 3
    This is a good question- thanks for providing sample code. It would be great if you could remove some of the unnecessary packages- it's always best to try and strip your code down to the minimum if possible :) – cmhughes Jun 08 '13 at 18:24
  • 1
    After cleaning the code, change \resizebox{11.5cm}{!}{} with \resizebox{\columnwidth}{!}{} and for adjustbox use \begin{adjustbox}{max size={\columnwidth}{!}} instead of \begin{adjustbox}{max size={.95\textwidth}{.8\textheight}}. – cacamailg Jun 08 '13 at 19:04
  • @cacamailg: \resizebox{\columnwidth} works (I no longer have to use trial and error approach), but I get the same result with \begin{adjustbox}{max size={\columnwidth}{!}} i.e. only one disk! – TCSGrad Jun 08 '13 at 19:19
  • @TCSGrad both solutions work for me. I am using the adjustbox Version v1.0 – 2012/05/21, TeXLive 2012. – cacamailg Jun 08 '13 at 19:22
  • @cacamailg: I'm using Texworks/TexMaker on OSX - how to find out what version of adjustbox is being used? – TCSGrad Jun 08 '13 at 19:32
  • @TCSGrad in OSX I don't know. In Linux, I open a terminal and write texdoc adjustbox and it display the documentation pdf file, which has the version on the top. – cacamailg Jun 08 '13 at 19:44
  • @cacamailg: Mine is Version v0.3 – 2011/03/20, using the same command on terminal... – TCSGrad Jun 08 '13 at 21:10
  • 1
    @TCSGrad it seems your TeX/LaTeX distribution needs an update. – cacamailg Jun 09 '13 at 00:09
  • 1
    This question appears to be off-topic because it is about an issue which is solved in the latest release of the package(s) involved. – Joseph Wright Aug 17 '13 at 20:23

0 Answers0