使文本适合圆形形状

使文本适合圆形形状

我试图将文本放入箭头内,但形状为圆形,但是文本无法很好地弯曲。

 \documentclass[border=5mm]{standalone}

 \usepackage{tikz}
 \usetikzlibrary{arrows}
 \begin{document}
 \begin{tikzpicture}[paths/.style={->, thick, >=stealth'}]

 \node (species_1) at (-3,0.5) {};

 \node (species_2) at (0,0) 
     {};

 \node (species_3) at (2,-2) 
     {};

 \node (species_4) at (0,-4) 
     {};

 \node (species_5) at (-2,-2) 
     {};

 \node (species_6) at (-3,-4) 
     {};
\draw[-triangle 90 cap, very thick,double, double distance=9pt] (species_2) to [bend left=40] node[black, sloped,bend left=40]{Develop}  (species_3);
\draw[-triangle 90 cap, very thick,double, double distance=9pt]  (species_3) to [bend left=40] node[black, sloped] {Design} (species_4);
\draw[-triangle 90 cap, very thick,double, double distance=9pt]  (species_4) to [bend left=40] node[black, sloped] {Plan} (species_5);
\draw[-triangle 90 cap, very thick,double, double distance=9pt]  (species_5) to [bend left=40] node[black, sloped] {Deploy} (species_2);


\draw[-triangle 90 cap, very thick,double, double distance=9pt]  (species_6) to node[black, sloped] {Plan}(species_4);
 


 \end{tikzpicture}
 \end{document}

更新,

我设法使用提供的链接中的代码,现在我如何使用相同的代码使相同的图形垂直对齐?

代码:

\documentclass[border=5pt]{standalone}
\usepackage{xcolor}
\definecolor{ocre}{HTML}{800000}
\definecolor{sky}{HTML}{C6D9F1}
\definecolor{skybox}{HTML}{5F86B3}
\usepackage{tikz}
\usepackage{pgfmath}
\usetikzlibrary{decorations.text, arrows.meta,calc,shadows.blur,shadings}


% arctext from Andrew code with modifications:
%Variables: 1: ID, 2:Style 3:box height 4: Radious 5:start-angl 6:end-angl 7:text {format along path} 
\def\arctext[#1][#2][#3](#4)(#5)(#6)#7{

\draw[#2] (#5:#4cm+#3) coordinate (above #1) arc (#5:#6:#4cm+#3)
             -- (#6:#4) coordinate (right #1) -- (#6:#4cm-#3) coordinate (below right #1) arc (#6:#5:#4cm-#3) coordinate (below #1)
             -- (#5:#4) coordinate (left #1) -- cycle;
            \def\a#1{#4cm+#3}
            \def\b#1{#4cm-#3}
\path[
    decoration={
        raise = -0.5ex, % Controls relavite text height position.
        text  along path,
        text = {#7},
        text align = center,        
    },
    decorate
    ]
    (#5:#4) arc (#5:#6:#4);
}

%arcarrow, this is mine, for beerware purpose...
%Function: Draw an arrow from arctex coordinate specific nodes to another 
%Arrow start at the start of arctext box and could be shifted to change the position
%to avoid go over another box.
%Var: 1:Start coordinate 2:End coordinate 3:angle to shift from acrtext box  
\def\arcarrow(#1)(#2)[#3]{
    \draw[thick,->,>=latex] 
        let \p1 = (#1), \p2 = (#2), % To access cartesian coordinates x, and y.
            \n1 = {veclen(\x1,\y1)}, % Distance from the origin
            \n2 = {veclen(\x2,\y2)}, % Distance from the origin
            \n3 = {atan2(\y1,\x1)} % Angle where acrtext starts.
        in (\n3-#3: \n1) -- (\n3-#3: \n2); % Draw the arrow.
}

\begin{document}
    \begin{tikzpicture}[
        % Environment Cfg
        font=\sf    \scriptsize,
        % Styles
        myarrow/.style={
            thick,
            -latex,
        },
        Center/.style ={
            circle,
            fill=ocre,
            text=white,
            align=center,
            font =\footnotesize\bf,
            inner sep=1pt,          
        },
        RedArc/.style ={
            color=black,
            thick,
            fill=ocre,
            blur shadow, %Tikzedt not suport online view
        },
        SkyArc/.style ={
            color=skybox,
            thick,
            fill=sky,
            blur shadow, %Tikzedt not suport online view
        },
    ]

    % Drawing the center
    \node[Center](SOSA) at (0,0) {Team 1\\ Blog};
    \coordinate (SOSA-R) at (0:1.2); % To make compatible with \arcarrow macro.

    % Drawing the Tex Arcs

    % \Arctext[ID][box-style][box-height](radious)(start-angl)(end-angl){|text-styles| Text}

    \arctext[SSN][SkyArc][8pt](1.5)(25)(-20){|\footnotesize\color{black}|Design};
    \arctext[SCap][SkyArc][8pt](1.5)(75)(27){|\footnotesize\color{black}| Develop};
    \arctext[SRel][SkyArc][8pt](1.5)(107)(77){|\footnotesize\color{black}| Test};
    \arctext[SRel][SkyArc][8pt](1.5)(152)(109){|\footnotesize\color{black}|Deploy};
    \arctext[SRel][SkyArc][8pt](1.5)(200)(154){|\footnotesize\color{black}|Review};
    \draw[-stealth, ultra thick](-2,-1)to node[below, midway]{Sprint 1}++(4,0);



  

    %Drawing the Arrows
    %\arcarrow(above/below ID)(abobe/below ID)[shift]



%    %Same level Arrows
%    \draw[myarrow] (left SSNX) -- (right DUAM);
%    \draw[myarrow] (left SSN) -- (left SRel);
%    \draw[myarrow] (left SCap) -- (right SSN);


    \end{tikzpicture}

\end{document}

答案1

当机器人更新这篇文章中的某些内容时,我看到了这一点,因此既然我在这里,我必须留下一些简化的代码,其中包含一些按要求解释的内容。我添加了一些我一路学到的东西。

结果:

在此处输入图片描述

梅威瑟:

\documentclass[border=5pt]{standalone}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usepackage{pgfmath}
\usetikzlibrary{decorations.text, arrows.meta,calc,shadows.blur,shadings}
% arctext from Andrew code with modifications:
%Variables: 1: ID, 2:Style 3:box height 4: Radious 5:start-angl 6:end-angl 7:text {format along path} 
\def\arctext[#1][#2][#3](#4)(#5)(#6)#7{
    \draw[#2] (#5:#4cm+#3) coordinate (above #1) arc (#5:#6:#4cm+#3) 
    -- (#6-5:#4) coordinate (right #1) -- (#6:#4cm-#3) coordinate (below right #1) arc (#6:#5:#4cm-#3) coordinate (below #1)
    -- (#5-5:#4) coordinate (left #1) -- cycle;
    \path[
    decoration={
        raise = -0.5ex, % Controls relavite text height position.
        text  along path,
        text = {#7},
        text align = center,        
    },
    decorate
    ]
    (#5-5:#4) arc (#5-5:#6:#4);
}

\begin{document}
    \begin{tikzpicture}[
        % Styles
        ShdShape/.style ={
            color=#1!50!black,
            thick,
            upper left=#1,
            upper right=black!50!#1,
            lower left=white,
            lower right=blue!50!#1,
            blur shadow, %Tikzedt not suport online view
        }
        ]           
        % you can anidate this in a new drawing definition
        \def\Sprint[#1](#2)[#3]#4#5#6#7#8{
            \begin{scope}[shift={(#1)},rotate=#2] 
                \node[ShdShape=gray,draw,align=center,circle](CENTER) at (0,0) {Team #3 \\ Blog};
                \arctext[SSN][ShdShape=orange][8pt](2)(25)(-20){|\footnotesize\color{black}|#8};
                \arctext[SCap][ShdShape=yellow][8pt](2)(75)(27){|\footnotesize\color{black}|#7};
                \arctext[SRel][ShdShape=lime][8pt](2)(107)(77){|\footnotesize\color{black}|#6};
                \arctext[SRel][ShdShape=green][8pt](2)(152)(109){|\footnotesize\color{black}|#5};
                \arctext[SRel][ShdShape=SeaGreen][8pt](2)(200)(154){|\footnotesize\color{black}|#4};
                \draw[-stealth, ultra thick](-2,-1)to node[below, midway,rotate=#2]{Sprint #3}++(4,0);
            \end{scope}
        }
        
        %Then draw many of these in other positions...  
        \Sprint[0,0](0)[1]{Design}{Develop}{Test}{Deploy}{Review}
        \Sprint[0,4](0)[2]{Task 1}{Task 2}{Task 3}{Task 4}{Task 5}
        \Sprint[5,4](-45)[3]{Task 6}{Task 7}{Task 8}{Task 9}{too much...}
        
        %Or you can shift or rotate a part of new drawings using scope.
        \begin{scope}[shift={(5,0)},rotate=15] 
        \node[ShdShape=white,draw,align=center,circle,text=black](CENTER) at (0,0) {Team X \\ Blog};
        \arctext[SSN][ShdShape=blue!50!green][8pt](1)(180)(0){|\footnotesize\color{black}|personalized};
        \arctext[SCap][ShdShape=cyan][8pt](1)(180)(360){|\footnotesize\color{black}|option};
        \end{scope}
\end{tikzpicture}
    
\end{document}

答案2

希望您期待这一点(感谢Herbert Voss and Timothy Van Zandt发布PSTricks教程):

\documentclass[12pt]{book}
\usepackage{PSTricks}
\usepackage{pst-text}

\begin{document}

\LARGE
\psset{linestyle=none}%
\pstextpath[c]{\psarcn(0,0){1.8}{180}{0}}{Centre National de la}
\pstextpath[c]{\psarc(0,0){1.8}{180}{0}}{Recherche Scientifique}

\end{document}

输出 在此处输入图片描述

请注意使用LaTeX->dvips->PS2PDF以获得更好的输出...

相关内容