如何正确将文章类中的 Tikz 图片无变形地转换为 Beamer

如何正确将文章类中的 Tikz 图片无变形地转换为 Beamer

我想将article这张tikz图片的文档类转换为一个beamer类,并且 tikz 图片会变形并且看起来任性beamer

这里是article class

\documentclass[border=10pt]{extarticle}
\makeatletter
\setlength{\@fptop}{0pt}
\makeatother
%
\usepackage{tikz,tgtermes,float}% times is deprecated - use one of the other options
\usetikzlibrary{mindmap,trees}
\definecolor{mypink3}{cmyk}{0, 0.7808, 0.4429, 0.1412}
\definecolor{yel}{rgb}{0.898, 0.6196, 0.14}
\definecolor{blue1}{rgb}{0.11, 0.5, 0.9}

\begin{document}
\begin{figure}[t!]
    \begin{tikzpicture}[scale=0.8, line join=round]%,trim left={(-3,0)}, trim right={(5.5,0)}] 
        \path [
        mindmap,
        every node/.append style={text=white},
        level 1 concept/.append style={level distance=180, sibling angle=30, font=\large\sffamily\bfseries},
        level 2 concept/.append style={level distance=90, font=\sffamily\bfseries},
        concept color=yel!90!black,
        ]
        node [concept, font=\Huge\sffamily\bfseries, ball color=yel!90!black,  inner sep=10] (Mother of Mothers) {Mother of Mothers}[counterclockwise from=70] 
        
        child [concept color=mypink3!90!black] {
                node [concept, inner sep=10, ball color=mypink3!90!black] (Mother 1) {Mother 1}
                child[grow=75, concept color=blue1!90!black] {
                    node [concept,  inner sep=5, ball color=blue1!90!black] (Child 11) {Child 1, 1}
                } 
                child [grow=75, clockwise from=45, concept color=blue1!90!black ] {
                    node [concept, inner sep=5, ball color=blue1!90!black] (Child 12) {Child 1, 2}
                }
                child [grow=75, clockwise from=145, concept color=blue1!140!black ] {
                    node [concept, inner sep=5, ball color=blue1!90!black] (Child 13) {Child 1, 3}
                }
            }
        child [concept color=mypink3!90!black] {
                node [concept,  inner sep=10, ball color=mypink3!90!black] (Mother 2) {Mother 2}
                child [concept color=blue1!90!black] {
                    node [concept, inner sep=5, ball color=blue1!90!black] (Child 21) {Child 2, 1}
                }
                child [concept color=blue1!90!black, grow=115] {
                    node [concept, inner sep=5, ball color=blue1!90!black] (Child 22) {Child 2, 2}
                }
            }
        child [concept color=mypink3!90!black] {
                node [concept,  inner sep=10, ball color=mypink3!90!black] (Mother 3) {Mother 3}
                child [concept color=blue1!90!black, grow=140] {
                    node [concept, inner sep=5, ball color=blue1!90!black] (Child 31) {Child 3, 1}
                }
                child [concept color=blue1!90!black, grow=180] {
                    node [concept, inner sep=5, ball color=blue1!90!black] (Child 32) {Child 32}
                }
                child [concept color=blue1!90!black, grow=100] {
                    node [concept, inner sep=5, ball color=blue1!90!black] (Child 33) {Child 3, 3}
                }
            }
        child [concept color=mypink3!90!black] {
                node [concept,  inner sep=10, ball color=mypink3!90!black] (Mother 4) {Mother 4}
                [counterclockwise from=180]
                child [concept color=blue1!90!black] {
                    node [concept, inner sep=5, ball color=blue1!90!black] (Child 41) {Child 4,1}
                }
                child [concept color=blue1!90!black] {
                    node [concept, inner sep=5, ball color=blue1!90!black] (Child 42) {Child 4,2}
                    }
                }
            ;
        \end{tikzpicture}
    \caption{MindMap}
    \label{fig5}
    \end{figure}
\end{document}

输出如下

这是我的试验

\documentclass[compress]{beamer}
\usepackage    {tikz}
\usetheme      {Warsaw}
\usetikzlibrary{3d}
\makeatletter
\setlength{\@fptop}{0pt}
\makeatother
%
    \usepackage{tikz,tgtermes,float}% times is deprecated - use one of the other options
    \usetikzlibrary{mindmap,trees}
    \definecolor{mypink3}{cmyk}{0, 0.7808, 0.4429, 0.1412}
    \definecolor{yel}{rgb}{0.898, 0.6196, 0.14}
    \definecolor{blue1}{rgb}{0.11, 0.5, 0.9}

    \begin{document}
\begin{frame}{Conversion to Beamer Class}
    \centering
    \begin{tikzpicture}[scale=0.8, line join=round]%,trim left={(-3,0)}, trim right={(5.5,0)}] 
        \path [
        mindmap,
        every node/.append style={text=white},
        level 1 concept/.append style={level distance=180, sibling angle=30, font=\large\sffamily\bfseries},
        level 2 concept/.append style={level distance=90, font=\sffamily\bfseries},
        concept color=yel!90!black,
        ]
        node [concept, font=\Huge\sffamily\bfseries, ball color=yel!90!black,  inner sep=10] (Mother of Mothers) {Mother of Mothers}[counterclockwise from=70] 
        
        child [concept color=mypink3!90!black] {
                node [concept, inner sep=10, ball color=mypink3!90!black] (Mother 1) {Mother 1}
                child[grow=75, concept color=blue1!90!black] {
                    node [concept,  inner sep=5, ball color=blue1!90!black] (Child 11) {Child 1, 1}
                } 
                child [grow=75, clockwise from=45, concept color=blue1!90!black ] {
                    node [concept, inner sep=5, ball color=blue1!90!black] (Child 12) {Child 1, 2}
                }
                child [grow=75, clockwise from=145, concept color=blue1!140!black ] {
                    node [concept, inner sep=5, ball color=blue1!90!black] (Child 13) {Child 1, 3}
                }
            }
        child [concept color=mypink3!90!black] {
                node [concept,  inner sep=10, ball color=mypink3!90!black] (Mother 2) {Mother 2}
                child [concept color=blue1!90!black] {
                    node [concept, inner sep=5, ball color=blue1!90!black] (Child 21) {Child 2, 1}
                }
                child [concept color=blue1!90!black, grow=115] {
                    node [concept, inner sep=5, ball color=blue1!90!black] (Child 22) {Child 2, 2}
                }
            }
        child [concept color=mypink3!90!black] {
                node [concept,  inner sep=10, ball color=mypink3!90!black] (Mother 3) {Mother 3}
                child [concept color=blue1!90!black, grow=140] {
                    node [concept, inner sep=5, ball color=blue1!90!black] (Child 31) {Child 3, 1}
                }
                child [concept color=blue1!90!black, grow=180] {
                    node [concept, inner sep=5, ball color=blue1!90!black] (Child 32) {Child 32}
                }
                child [concept color=blue1!90!black, grow=100] {
                    node [concept, inner sep=5, ball color=blue1!90!black] (Child 33) {Child 3, 3}
                }
            }
        child [concept color=mypink3!90!black] {
                node [concept,  inner sep=10, ball color=mypink3!90!black] (Mother 4) {Mother 4}
                [counterclockwise from=180]
                child [concept color=blue1!90!black] {
                    node [concept, inner sep=5, ball color=blue1!90!black] (Child 41) {Child 4,1}
                }
                child [concept color=blue1!90!black] {
                    node [concept, inner sep=5, ball color=blue1!90!black] (Child 42) {Child 4,2}
                    }
                }
            ;
        \end{tikzpicture}
    \end{frame}
\end{document}

以下是投影仪的输出

我想要的是

我希望该类beamer看起来article与其框架中的类完全一样

答案1

您的图像太大,无法放入幻灯片中。需要将其缩小,例如:

...
\begin{tikzpicture}[scale=0.6, transform shape, % <---
                    line join=round]
...

在此处输入图片描述

相关内容