4

My code about smartdiagram has some problems. I would like to ask people who handle Latex, in particular, smartdiagram part.

\begin{frame}{}
    \begin{beamerboxesrounded}[upper=uppercol,lower=lowercol,shadow=true]{Example 2}
        \begin{minipage}[c][3cm]{.5\textwidth}
            \begin{center}
                \smartdiagramset{
                    border color=none,
                    back arrow disabled=true
                }
                \smartdiagram[flow diagram:horizontal]{
                    $X$,
                    Noisy channel,
                    $Y$,
                    $f(\cdot)$,
                    $Z$
                }
            \end{center}
        \end{minipage}

        ...
    \end{beamerboxesrounded}
\end{frame}

imge

I want to draw like the following image: Hope

Moreover, I do not know why the size (width) exceeds the page even though I use minipage environment.

So far, I used to draw image in powerpoint, to save it with pdf extension, to open the pdf file in illustrator program, and re-save the image with eps extension.

Now, I think it's time that I learn to use smartdiagram!!

Thank you for reading my question.

2
  • 1
    It makes it much easier for people to help if you post complete code we can compile.
    – cfr
    Commented Oct 2, 2016 at 15:24
  • @cfr Okay, I understand it. From now on, I will post complete code when I ask a question. Thank you.
    – Danny_Kim
    Commented Oct 2, 2016 at 16:06

1 Answer 1

5

To add text (Y) above the arrow, you can use the additions option of smartdiagram package (see the package documentation for more information).

Concerning your size problem: If you put a something inside a minipage which is larger than said minipage, it will simply stuck out and won't be magically resized. If you want the digram to be smaller, you could try to use \resizebox or similar.

\documentclass{beamer}
\usetheme{Warsaw}

\usepackage{tikz} 
\usepackage{smartdiagram}
\usesmartdiagramlibrary{additions}

\begin{document}
\begin{frame}{}
    \begin{beamerboxesrounded}[upper=uppercol,lower=lowercol,shadow=true]{Example 2}
        \begin{minipage}[c][3cm]{\textwidth}
            \centering
                \smartdiagramset{
                    border color=none,
                    back arrow disabled=true,
                                    additions={
                                      additional item offset=-7mm,
                                      additional item fill opacity=0
                                    }
                }
                \smartdiagramadd[flow diagram:horizontal]{
                    $X$,
                    Noisy channel,
                    $f(\cdot)$,
                    $Z$
                }
                {
                        above right of module2/$Y$~~~,
                }
        \end{minipage}
    \end{beamerboxesrounded}
\end{frame}


\end{document}

enter image description here

9
  • Thank you very much!! It works. Can I ask one? Why $Y$ is not displayed if I use center environment instead of centering you suggested? And isn't there any method X and Z also without opacity
    – Danny_Kim
    Commented Oct 2, 2016 at 14:49
  • @Danny_Kim I don't see any difference if I use \begin{center} ... \end{center} instead. Can you put an example in your question? Commented Oct 2, 2016 at 14:59
  • @Danny_Kim As for changing the colour of X and Z, you could do this with a colour list (tex.stackexchange.com/questions/126460/…) but this leaves behind the shadow. Maybe you should have a look into the documentation. Commented Oct 2, 2016 at 15:12
  • @Danny_Kim I think it would be easier to use TikZ directly in that case. smartdiagram is great for quickly drawing diagrams of certain kinds, but it is not designed to be infinitely flexible. That is, if you want a diagram not of one of those kinds, it is easier to just draw the diagram rather than fighting smartdiagram.
    – cfr
    Commented Oct 2, 2016 at 15:26
  • @Danny_Kim Also if Z should be without colour, what colour do you expect the arrow to have? Commented Oct 2, 2016 at 15:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .