1

I am trying to convert a SmartArt from MS PowerPoint to LaTeX.

It is horizontal orientated and not vertical like this example depicts.

The end result should replicate the example I created in Powerpoint, shown here: enter image description here

I am using 'smartdiagram' package to create the base

\documentclass[tikz,
border=3mm,
]{standalone}
\usetikzlibrary{arrows.meta,
    positioning,
    shapes.symbols,
}

\begin{document}
    \begin{tikzpicture}[
    node distance = 2mm and 2mm,
    sgn/.style = {signal, draw, signal from=west,
        minimum height=1.2em, minimum width=3em},
    ]
    \node (n1) [sgn]  {$Background$};
    \coordinate[right= -1mm of n1]  (a);
    \node (n2) [sgn,right=of a]  {$Primary Question$};
    \coordinate[right= of n2]  (b);
    \node (n3) [sgn,right=-1mm of b]  {$Secondary Question$};
    %
    \coordinate[above= of n1]  (c);
    \node (n4) [sgn, above=of c]  {$This chapter is about the background$};
    \end{tikzpicture}
\end{document}

But the size of the upper text box is dependent on the text input and not anchored into position.

2

I don't completely understand the problem because all nodes are dependent of its contents. As you can see in your example, arrows length depends on text length.

You can define draw an arrow with longer text if you declares the text as a centerd label. This way the length of text won't control the length of arrow. In following example, the tops most arrow is drawn this way. It's size has been adjusted with \phantom{Background} but you can use whatever you want.

About alignment. above=of c means take the center of new node and place it the default distance above the c.center. What alignment do you want?

\documentclass[tikz,
border=3mm,
]{standalone}
\usetikzlibrary{arrows.meta,
    positioning,
    shapes.symbols,
}

\begin{document}
    \begin{tikzpicture}[
    node distance = 2mm and 2mm,
    sgn/.style = {signal, draw, signal from=west,
        minimum height=1.2em, minimum width=3em, font=\slshape},
    ]
    \node (n1) [sgn]  {Background};
    \coordinate[right= -1mm of n1]  (a);
    \node (n2) [sgn,right=of a]  {Primary Question};
    \coordinate[right= of n2]  (b);
    \node (n3) [sgn,right=-1mm of b]  {Secondary Question};
    %
    \coordinate[above= of n1]  (c);
    \node (n4) [sgn, above=of c, label=center:{This chapter is about the background}]  {\phantom{Background}};
    \end{tikzpicture}
\end{document}

enter image description here

Update

After some test with labels, I've decided to do it with two nodes for each line. First you draw empty arrows and later on use them to place the text on each line.

\documentclass[tikz,
border=3mm,
]{standalone}
\usetikzlibrary{arrows.meta,
    positioning,
    shapes.symbols,
}

\begin{document}
    \begin{tikzpicture}[
%    node distance = 2mm and 2mm,
    sgn/.style = {signal, draw, signal from=west,
        minimum height=1.2em, minimum width=3em, font=\slshape},
    ]
    \node (n1) [sgn]  {Background};
    \node (n2) [sgn,right= 1mm of n1.east]  {Primary Question};
    \node (n3) [sgn,right= 1mm of n2.east]  {Secondary Question};
    %
    \node (n4) [sgn, above=1mm of n3.north] {\phantom{Secondary Question}};
    \node (n5) [sgn, above=1mm of n4.north west] {\phantom{Primary Question}};
    \node (n6) [sgn, above right=1mm and 0mm of n2.north west|-n5.north] {\phantom{Primary Question}};
    \node (n7) [sgn, above right=1mm and 0mm of n1.north west|-n6.north] {\phantom{Background}};
    \node[right=0mm of n7.west] {This chapter is about the background};
    \node at (n6.center) {This chapter is about this primary question};
    \node at (n5.center) {The chapter covers both questions};
    \node[left=1mm of n4.east] {This chapter is about this primary question};

    \end{tikzpicture}
\end{document}

enter image description here

  • Can the "This chapter" text be left aligned? In the diagram there is a combination of left, center and right-aligned text (Chp 2 --> left, Chp 3+4 --> centre, Chp 5 --> right) – user08041991 Nov 10 '18 at 12:39
  • @user08041991 left aligned with what? It's left aligned with background – Ignasi Nov 10 '18 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.