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.

  • 1
    It makes it much easier for people to help if you post complete code we can compile. – cfr Oct 2 '16 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 Oct 2 '16 at 16:06
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

| improve this answer | |
  • 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 Oct 2 '16 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? – samcarter_is_at_topanswers.xyz Oct 2 '16 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. – samcarter_is_at_topanswers.xyz Oct 2 '16 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 Oct 2 '16 at 15:26
  • @Danny_Kim Also if Z should be without colour, what colour do you expect the arrow to have? – samcarter_is_at_topanswers.xyz Oct 2 '16 at 15:30

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.