SmartDiagram 重叠文本

SmartDiagram 重叠文本

我在图形环境中使用带有附加模块的 SmartDiagram。但是附加模块的绘制超出了图形环境的边界:

重叠示例

我如何获得图形以使其不与文本重叠?

这是我当前的代码:

\documentclass{article}
\usepackage{smartdiagram}
\usesmartdiagramlibrary{additions}
\begin{document}
Some lines of text: these should be above the diagram.
\begin{figure}[h]
    \centering
    \smartdiagramset{
     circular distance=36mm,
     text width=35mm,
     module minimum width=35mm,
     module minimum height=15mm,
     module shape=rectangle,
     arrow tip=to,
     uniform arrow color=true,
     arrow color=gray!50!black,
     border color=black,
     uniform color list=white for 6 items,
     additions={
       additional item offset=15mm,
       additional item text width=35mm,
       additional item height=15mm,
       additional item shape=rectangle,
       additional item border color=black,
       additional item shadow=drop shadow,
       additional arrow color=gray!50!black,
     }
    }
    \smartdiagramadd[circular diagram:clockwise]{
            {Second Box (2)}, 
            {Third Box (3)}, 
            {Fourth Box (4)}, 
            {Fifth Box (5)}, 
            {Sixth Box (6)}
        }{
            above of module1/{First Box (1)
        }
    }
    \smartdiagramconnect{-to}{additional-module1/module1}   
    \caption{Example diagram.}
\end{figure}
\end{document}

答案1

在使用选项的additions单独环境中添加。因此,这些项目不会更新边界框,如手册第 7 页所述。建议使用。但是,在这种情况下,似乎不用也一样容易。tikzpictureremember picture, overlayminipage

h如果需要标题,我会使用center环境和,而不是使用\captionof说明符。也就是说,如果您确实不希望图形浮动。如果您确实希望它浮动(如有必要),那么只需像原始示例中那样使用figure和即可。\centering

无论哪种方式,您都需要手动在图表中留出空间以容纳附加模块。例如:

\documentclass{article}
\usepackage{smartdiagram,capt-of}
\usesmartdiagramlibrary{additions}
\begin{document}
Some lines of text: these should be above the diagram.
\begin{center}
  \vskip 30mm\par
  \smartdiagramset{
    circular distance=36mm,
    text width=35mm,
    module minimum width=35mm,
    module minimum height=15mm,
    module shape=rectangle,
    arrow tip=to,
    uniform arrow color=true,
    arrow color=gray!50!black,
    border color=black,
    uniform color list=white for 6 items,
    additions={
      additional item offset=15mm,
      additional item text width=35mm,
      additional item height=15mm,
      additional item shape=rectangle,
      additional item border color=black,
      additional item shadow=drop shadow,
      additional arrow color=gray!50!black,
    }
  }
  \smartdiagramadd[circular diagram:clockwise]{
    {Second Box (2)},
    {Third Box (3)},
    {Fourth Box (4)},
    {Fifth Box (5)},
    {Sixth Box (6)}
  }{
    above of module1/{First Box (1)
    }
  }
  \smartdiagramconnect{-to}{additional-module1/module1}
  \captionof{figure}{Example diagram.}
\end{center}
\end{document}

生产

跳过补偿

相关内容