smartdiagram 包中模块之间具有恒定距离的流程图

smartdiagram 包中模块之间具有恒定距离的流程图

我有这个流程图:

\documentclass[a4 paper, 12pt]{article}

\usepackage{smartdiagram}
\usepackage[neveradjust]{paralist} % compact list

\begin{document}
\begin{figure}[h]
\centering      
    \smartdiagramset{border color=none,
    %module minimum width = 8cm,
    text width = 0.6\linewidth,
    uniform color list = gray!100!black for 4 items,
    back arrow disabled=true,
    module y sep=2.2
    }
\smartdiagram[flow diagram]{
    \textbf{short word},
    \textbf{a longer than short word}
    \begin{compactitem}
        \item Description 1
        \item Description 2
    \end{compactitem},
    \textbf{a longer than short word} 
    \begin{compactitem}
        \item Description 1
        \item Description 2
        \item Description 3
    \end{compactitem},
    \textbf{short word} 
    }
    \caption{words and description}
    \label{fig:words} 
\end{figure}
\end{document}

流程图

如何使模块之间的距离等距,即使箭头长度不变?

附言:如何才能让模块的大小与模块内部的文本一样大?如有任何帮助,我们将不胜感激

答案1

没有smartdiagram但有chains

\documentclass[a4 paper, 12pt]{article}

\usepackage{tikz}
\usetikzlibrary{arrows.meta,chains, shadows, positioning}
%\usepackage{smartdiagram}
\usepackage[neveradjust]{paralist} % compact list

\begin{document}
\begin{figure}[h]
\centering      
\begin{tikzpicture}[
    every node/.style={
        rounded corners,
        %fill=gray,
        top color=white,
        bottom color=gray,
        drop shadow,
        on chain,
        join,
    },
    >=stealth,
    every join/.style={gray,line width=1mm,->},
    node distance=1cm,
    start chain=going below
    ]
   \node[font=\bfseries] {short word};
   \node[align=center, text width=6cm] {\textbf{a longer than short word}\\
    \begin{compactitem}
        \item Description 1
        \item Description 2
    \end{compactitem}};
    \node[align=center, text width=6cm] {\textbf{a longer than short word}\\
    \begin{compactitem}
        \item Description 1
        \item Description 2
        \item Description 3
    \end{compactitem}};
    \node[font=\bfseries] {short word};
    \end{tikzpicture}
    \caption{words and description}
    \label{fig:words} 
\end{figure}
\end{document}

在此处输入图片描述

答案2

没有smartdiagram

\documentclass[a4 paper, 12pt]{article}
\usepackage{tikz}
\usetikzlibrary{positioning,shadows}
\usepackage[neveradjust]{paralist}
\usepackage{varwidth}


\begin{document}
\begin{figure}[h]
\centering
\begin{tikzpicture}[every node/.style={align=center,top color=white,bottom color=gray,drop shadow,rounded corners}]
 \node(1)[font=\bfseries] {short word};
 \node(2)[below=1.5cm of 1]
 {\begin{varwidth}{\linewidth}
 \begin{compactitem}
        \item Description 1
        \item Description 2
 \end{compactitem}
 \end{varwidth}};
 \node(3)[below=1.5cm of 2]{
    a longer than short word\\
    \begin{varwidth}{\linewidth}
 \begin{compactitem}
        \item Description 1
        \item Description 2
        \item Description 3
 \end{compactitem}
 \end{varwidth}};
 \node(4)[font=\bfseries,below=1.5cm of 3] {short word};
 \path[->,>=stealth,line width=2mm,gray!70] (1)edge(2) (2)edge(3) (3)edge(4);
\end{tikzpicture}
    \caption{words and description}
    \label{fig:words} 
\end{figure}
\end{document}

相关内容