文本不适合方框

文本不适合方框

我用 Inkspace 创建了以下图片并导出到 tikz。问题是文本不适合方框。箭头应该用渐变色,但这并不重要。我尝试了parbox环境tabular。结果与下面的结果类似。还有其他方法可以修复它吗?抱歉代码太丑了 )) 提前谢谢!

在此处输入图片描述

\documentclass[12pt,a4paper,oneside, ngerman]{scrreprt}
\usepackage[ansinew]{inputenc} 
\usepackage{tikz}
\begin{document}
\begin{figure}


\definecolor{ccccccc}{RGB}{204,204,204}
\definecolor{cffffff}{RGB}{255,255,255}
\definecolor{c999999}{RGB}{153,153,153}
\definecolor{mygray}{RGB}{240,240,240}

\begin{tikzpicture}[ y=0.80pt, x=0.8pt,yscale=-1, scale=0.9]
\begin{scope}[opacity=0.540,transparency group]
  \path[cm={{1.1134,0.0,0.0,1.1134,(-102.46687,-81.77008)}},fill=ccccccc]
    (557.1429,311.6479)arc(-0.015:180.015:138.571)arc(-180.015:0.015:138.571) --
    cycle;
  \path[cm={{1.02577,0.0,0.0,1.02577,(-65.21652,-55.31787)}},fill=cffffff]
    (557.1429,311.6479)arc(-0.015:180.015:138.571)arc(-180.015:0.015:138.571) --
    cycle;
  \path[fill=black] (180,242.36218) node[above right] (text4246) {};
  \path[draw=ccccccc,line join=miter,line cap=butt,miter limit=4.00,line
    width=0.000pt] (265.0000,152.3622) -- (310.0000,127.3622);
\end{scope}
  \path[fill=ccccccc,nonzero rule] (170.4042,189.8211) -- (259.5958,152.7604);
  \path[draw=ccccccc,fill=ccccccc,line join=miter,line cap=butt,miter
    limit=4.00,line width=9.982pt] (165.0322,167.4265) .. controls
    (205.0000,167.3622) and (240.0000,167.3622) .. (264.5510,156.9455);
  \path[draw=ccccccc,fill=ccccccc,line join=miter,line cap=butt,miter
    limit=4.00,line width=9.840pt] (548.1593,287.4135) -- (598.5310,326.3043);
  \path[draw=ccccccc,line join=miter,line cap=butt,miter limit=4.00,line
    width=9.840pt] (267.8571,151.6479) .. controls (285.0000,137.3622) and
    (295.0000,132.3622) .. (312.8571,125.2193);
  \path[draw=ccccccc,line join=miter,line cap=butt,miter limit=4.00,line
    width=11.126pt] (416.7852,123.3070) .. controls (465.0000,147.3622) and
    (485.0000,177.3622) .. (504.0658,210.8975);
  \path[draw=ccccccc,line join=miter,line cap=butt,miter limit=4.00,line
    width=9.840pt] (511.4464,278.0983) .. controls (506.4286,312.3622) and
    (505.0000,317.3622) .. (491.5232,339.1471);
  \path[draw=ccccccc,line join=miter,line cap=butt,miter limit=4.00,line
    width=11.558pt] (302.5861,399.3372) .. controls (360.0000,417.3622) and
    (390.0000,422.3622) .. (452.4374,382.1258);
  \path[draw=ccccccc,line join=miter,line cap=butt,miter limit=4.00,line
    width=11.126pt] (217.6500,281.8994) .. controls (225.0000,322.3622) and
    (230.0000,327.3622) .. (245.1144,355.2866);
  \path[draw=ccccccc,line join=miter,line cap=butt,miter limit=4.00,line
    width=11.126pt] (265.9079,154.0784) .. controls (241.4286,181.2908) and
    (233.2143,192.7193) .. (215.7025,237.4581);
  \path[draw=ccccccc,line join=miter,line cap=butt,miter limit=4.00,line
    width=9.840pt] (597.9835,325.9815) .. controls (624.8229,346.1229) and
    (624.8229,346.1229) .. (624.8229,346.1229);
  \path[draw=black,fill=mygray,line join=miter,line cap=butt,even odd rule,line
    width=0.987pt,rounded corners=0.0000cm] (133.2388,212.6087) rectangle
    (264.7613,274.0543);
  \path[cm={{0.91468,0.0,0.0,0.90175,(-100.95407,-80.85112)}},fill=cffffff,opacity=0.000]
    (644.4773,389.7021)arc(-0.000:180.000:148.492)arc(-180.000:0.000:148.492) --
    cycle;
  \path[fill=black] (150,262.36218) node[above right] (text4251) {};
  \path[draw=black,fill=mygray,line width=0.742pt] (595.7193,265.8981) --
    (509.7908,314.9300) -- (423.8622,265.8981) -- (509.7908,216.8661) -- cycle;
  \path[fill=black] (443.01562,266.86725) node[above right] (text4362)
    {\begin{minipage}[c]{10em}Abbruchkriterium \\ erfüllt?\end{minipage}};
  \path[cm={{0.79307,-0.34521,0.66812,2.0141,(127.42176,109.33876)}},fill=c999999]
    (210.0000,42.3622) -- (195.0000,51.0224) -- (195.0000,33.7019) -- cycle;
  \path[cm={{0.73268,0.45968,-1.28519,1.68858,(505.694,162.81655)}},fill=c999999]
    (210.0000,42.3622) -- (195.0000,51.0224) -- (195.0000,33.7019) -- cycle;
  \path[draw=black,fill=mygray,line join=miter,line cap=butt,even odd rule,line
    width=0.987pt,rounded corners=0.0000cm] (210.0560,328.7001) rectangle
    (341.5786,390.1457);
  \path[draw=black,fill=mygray,line join=miter,line cap=butt,even odd rule,line
    width=1.068pt,rounded corners=0.0000cm] (394.0991,348.4690) rectangle
    (548.3774,409.8133);
  \path[draw=black,fill=mygray,line join=miter,line cap=butt,even odd rule,line
    width=0.987pt,rounded corners=0.0000cm] (322.4799,94.0224) rectangle
    (454.0024,155.4680);
  \path[draw=black,fill=mygray,line join=miter,line cap=butt,even odd rule,line
    width=1.043pt,rounded corners=0.0000cm] (22.5064,134.1592) rectangle
    (169.6727,195.5343);
  \path[draw=black,fill=mygray,line join=miter,line cap=butt,even odd rule,line
    width=0.987pt,rounded corners=0.0000cm] (606.0053,302.4869) rectangle
    (737.5278,363.9325);
  \path[fill=black] (164.28571,247.93361) node[above right] (text4255) {Mutation};
  \path[fill=black] (217.85713,363.07645) node[above right] (text4255-0)
    {Rekombination};
  \path[fill=black] (405,373.79074) node[above right] (text4331) {\begin{minipage}[c]{10em}Selektion der\\ besten Individuen\end{minipage}};
  \path[fill=black] (340.14285,120.21932) node[above right] (text4335) {\begin{minipage}[c]{10em}Berechnung\\ der Fitness    \end{minipage}};
  \path[fill=black] (26.270847,159.8571) node[above right] (text4341)
    {\begin{minipage}[c]{10em}Initialisierung \\der ersten\\ Population\end{minipage}};
  \path[fill=black] (612.86725,328.42966) node[above right] (text4349) {\begin{minipage}[c]{10em}Ergebnis: \\ beste Individuen \end{minipage}};
  \path[cm={{0.60459,-0.61854,1.37766,1.61401,(84.78393,210.78691)}},fill=c999999]
    (210.0000,42.3622) -- (195.0000,51.0224) -- (195.0000,33.7019) -- cycle;
  \path[cm={{0.3593,0.78678,-2.00187,0.70393,(516.30858,26.20105)}},fill=c999999,miter
    limit=4.00,line width=7.278pt] (210.0000,42.3622) -- (195.0000,51.0224) --
    (195.0000,33.7019) -- cycle;
  \path[cm={{-0.28036,0.81824,-1.93729,-0.86596,(627.99541,212.57875)}},fill=c999999]
    (210.0000,42.3622) -- (195.0000,51.0224) -- (195.0000,33.7019) -- cycle;
  \path[cm={{-0.61294,-0.61027,1.62665,-1.36272,(357.04714,578.75742)}},fill=c999999]
    (210.0000,42.3622) -- (195.0000,51.0224) -- (195.0000,33.7019) -- cycle;
  \path[cm={{-0.22342,-0.83865,2.21259,-0.33168,(167.67156,464.36418)}},fill=c999999]
    (210.0000,42.3622) -- (195.0000,51.0224) -- (195.0000,33.7019) -- cycle;
  \path[fill=black] (582.5,298.07648) node[above right] (text5333) {Ja};
  \path[fill=black] (446.07141,322.36218) node[above right] (text5337) {Nein};

\end{tikzpicture}

\end{figure}
\end{document}

答案1

在听取了 cjorssen 的建议并进行了缩放以避免出现过度装箱后,我得到了以下信息:

\documentclass[12pt,a4paper,oneside, ngerman]{scrreprt}
\usepackage[ansinew]{inputenc} 
\usepackage{tikz}

    \usetikzlibrary{shapes.geometric}
\usetikzlibrary{shapes.arrows}
\begin{document}
\begin{figure}


    \definecolor{ccccccc}{RGB}{204,204,204}
        \definecolor{cffffff}{RGB}{255,255,255}
        \definecolor{c999999}{RGB}{153,153,153}
        \definecolor{mygray}{RGB}{240,240,240}
        \definecolor{mygray1}{RGB}{226,226,226}

        \begin{tikzpicture}[ y=0.80pt, x=0.8pt,yscale=-1, scale=0.7]
        \begin{scope}[opacity=0.540,transparency group]
         \path[cm={{1.1134,0.0,0.0,1.1134,(-102.46687,-81.77008)}},fill=ccccccc]
            (557.1429,311.6479)arc(-0.015:180.015:138.571)arc(-180.015:0.015:138.571) --
            cycle;
          \path[cm={{1.02577,0.0,0.0,1.02577,(-65.21652,-55.31787)}},fill=cffffff]
            (557.1429,311.6479)arc(-0.015:180.015:138.571)arc(-180.015:0.015:138.571) --
            cycle;
          \path[fill=black] (180,242.36218) node[above right] (text4246) {};
          \path[draw=ccccccc,line join=miter,line cap=butt,miter limit=4.00,line
            width=0.000pt] (265.0000,152.3622) -- (310.0000,127.3622);
        \end{scope}
          \path[fill=ccccccc,nonzero rule] (170.4042,189.8211) -- (259.5958,152.7604);
          \path[draw=ccccccc,fill=ccccccc,line join=miter,line cap=butt,miter
            limit=4.00,line width=9.982pt] (165.0322,167.4265) .. controls
            (205.0000,167.3622) and (240.0000,167.3622) .. (264.5510,156.9455);
          \path[draw=ccccccc,fill=ccccccc,line join=miter,line cap=butt,miter
            limit=4.00,line width=9.840pt] (548.1593,287.4135) -- (598.5310,326.3043);
          \path[draw=ccccccc,line join=miter,line cap=butt,miter limit=4.00,line
            width=9.840pt] (267.8571,151.6479) .. controls (285.0000,137.3622) and
            (295.0000,132.3622) .. (312.8571,125.2193);
          \path[draw=ccccccc,line join=miter,line cap=butt,miter limit=4.00,line
            width=11.126pt] (416.7852,123.3070) .. controls (465.0000,147.3622) and
            (485.0000,177.3622) .. (504.0658,210.8975);
          \path[draw=ccccccc,line join=miter,line cap=butt,miter limit=4.00,line
            width=9.840pt] (511.4464,278.0983) .. controls (506.4286,312.3622) and
            (505.0000,317.3622) .. (491.5232,339.1471);
          \path[draw=ccccccc,line join=miter,line cap=butt,miter limit=4.00,line
            width=11.558pt] (302.5861,399.3372) .. controls (360.0000,417.3622) and
            (390.0000,422.3622) .. (452.4374,382.1258);
          \path[draw=ccccccc,line join=miter,line cap=butt,miter limit=4.00,line
            width=11.126pt] (217.6500,281.8994) .. controls (225.0000,322.3622) and
            (230.0000,327.3622) .. (245.1144,355.2866);
          \path[draw=ccccccc,line join=miter,line cap=butt,miter limit=4.00,line
            width=11.126pt] (265.9079,154.0784) .. controls (241.4286,181.2908) and
            (233.2143,192.7193) .. (215.7025,237.4581);
          \path[draw=mygray1,line join=miter,line cap=butt,miter limit=4.00,line
            width=9.840pt] (597.9835,325.9815) .. controls (624.8229,346.1229) and
            (624.8229,346.1229) .. (624.8229,346.1229);
            \node[diamond,aspect=3, draw = black, fill = mygray, align = center, ] at (525.01562,260.86725) {Abbruchkr. \\ erf\"{u}llt?};
          \path[cm={{0.79307,-0.34521,0.66812,2.0141,(127.42176,109.33876)}},fill=c999999]
            (210.0000,42.3622) -- (195.0000,51.0224) -- (195.0000,33.7019) -- cycle;
          \path[cm={{0.73268,0.45968,-1.28519,1.68858,(505.694,162.81655)}},fill=c999999]
            (210.0000,42.3622) -- (195.0000,51.0224) -- (195.0000,33.7019) -- cycle;
          \node[rectangle, draw = black, fill = mygray, align = center, text width = 7em, minimum height = 2.5em] at (270.85713,362.07645) {Rekombination};
          \node[rectangle, draw = black, fill = mygray, align = center, text width = 7em, minimum height = 2.5em] at (220.28571,245.93361) {Mutation};
            \node[rectangle, draw = black, fill = mygray, align = center, text width = 8em] at (477,375.79074) {Selektion der\\ besten Individuen};
          \node[rectangle, draw = black, fill = mygray, align = center, text width = 6em] at (393.14285,120.21932) {Berechnung \\ der Fitness};
          \node[rectangle, draw = black, fill = mygray, align = center, text width = 8em] at (75.270847,159.8571) {Initialisierung \\der ersten\\ Population};
          \node[rectangle, draw = black, fill = mygray, align = center, text width = 8em] at (698.86725,330.42966) {Ergebnis: \\ beste Individuen};
          \path[cm={{0.60459,-0.61854,1.37766,1.61401,(84.78393,210.78691)}},fill=c999999]
           (210.0000,42.3622) -- (195.0000,51.0224) -- (195.0000,33.7019) -- cycle;
          \path[cm={{0.3593,0.78678,-2.00187,0.70393,(516.30858,26.20105)}},fill=c999999,miter
           limit=4.00,line width=7.278pt] (210.0000,42.3622) -- (195.0000,51.0224) --
            (195.0000,33.7019) -- cycle;
          \path[cm={{-0.28036,0.81824,-1.93729,-0.86596,(627.99541,212.57875)}},fill=c999999]
            (210.0000,42.3622) -- (195.0000,51.0224) -- (195.0000,33.7019) -- cycle;
          \path[cm={{-0.61294,-0.61027,1.62665,-1.36272,(357.04714,578.75742)}},fill=c999999]
           (210.0000,42.3622) -- (195.0000,51.0224) -- (195.0000,33.7019) -- cycle;
          \path[cm={{-0.22342,-0.83865,2.21259,-0.33168,(167.67156,464.36418)}},fill=c999999]
            (210.0000,42.3622) -- (195.0000,51.0224) -- (195.0000,33.7019) -- cycle;
          \path[fill=black] (535.5,330.07648) node[above right] (text5333) {Ja};
          \path[fill=black] (440.07141,330.36218) node[above right] (text5337) {Nein};

    \end{tikzpicture}

    \end{figure}
\end{document}

在此处输入图片描述

相关内容