0

I'm preparing a beamer presentation and have a complicated mindmap in it. To make it nicely fit on the frames I use \tikzset{small mindmap}.

On subsequent frames I have images with nicely drawn scale bars.

Setting a 'small mindmap' messes up the placement of my scalebar label, as can be seen in the screenshot below.

messed up background

I think it has something to do with setting a general zoom/scale factor in tikz. Is there a way I can 'reset' tikz to a normal state after drawing my mindmap? This would result in (something like) the second screenshot.

intended result

Below is the code, boiled down to nearly minimal state. I couldn't manage to find an example image, is this not available in beamer? The issue can be seen when commenting/uncommenting line 12 and recompiling the document.

\documentclass{beamer}

\usepackage{siunitx}
\usepackage{tikz}
    \usetikzlibrary{mindmap}

\newlength\imagewidth% needed for scalebars
\newlength\imagescale% needed for scalebars

\begin{document}

\tikzset{small mindmap}

\begin{frame}
    \begin{tikzpicture}%
        \path[mindmap] node[concept] {Something} child {node[concept] {A}};
    \end{tikzpicture}
\end{frame}

\begin{frame}
    \pgfmathsetlength{\imagewidth}{\linewidth}%
    \pgfmathsetlength{\imagescale}{\imagewidth/1536}%
    \def\x{949}% scalebar-x starting at golden ratio of image width of 1536px = 949
    \def\y{1335}% scalebar-y at 90% of image height of 1483px = 1335
    \begin{tikzpicture}[x=\imagescale,y=-\imagescale]
        \node[anchor=north west, inner sep=0pt, outer sep=0pt] at (0,0) {\includegraphics[width=\imagewidth]{example−image}};
        \draw[|-|,blue,thick] (0,742) -- (1536,742) node [sloped,midway,above,fill=green,semitransparent,text opacity=1] {1536px};
    \end{tikzpicture}%
\end{frame}

\end{document}
3
  • 3
    Call \tikzset{small mindmap} in your first tikzpicture... Jun 21 at 14:33
  • 1
    Note: example−image is not example-image ( is not -). Jun 21 at 14:47
  • @PaulGaborit: Comment1: Thanks for the pointer, this helps. I'll move all the settings changes into the tikzpictures. Comment2: I copy-pasted from texdoc mwe and the dashes were not copied correctly.
    – Habi
    Jun 21 at 14:53

0

Your Answer

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

Browse other questions tagged or ask your own question.