1

I'm trying to adapt this question's answer to my code.

The problem is that it doesn't compile, and the message error is strange:

LaTeX Error: Something's wrong--perhaps a missing \item.

For the line where we have \end{frame}, below.

Here's my code:

    \documentclass{beamer}
\mode<presentation> {
\usetheme{AnnArbor}
\usecolortheme{beaver}
}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{booktabs}
\usepackage{graphicx}



\usepackage{tikz}
\usetikzlibrary{arrows.meta,
                % automata,
                % chains,
                decorations.pathreplacing, 
                calligraphy,% had to be load after decorations.pathreplacing
                positioning,
                shapes,
                shadows,
                arrows}

\begin{document}
\begin{frame}
    \begin{figure}
            \begin{tikzpicture}[
                node distance=2cm, 
                multiple/.style = {
                    double copy shadow={
                        shadow xshift=1ex,shadow yshift=-1.5ex,
                        draw=black!30
                    },
                    fill=white,draw=black,thick
                },
                % ordinary/.style = {rectangle,draw,thick}
            ]
                \node[multiple, label={\small Source Files}] (source_files) {
                    import math\\
                    result = math.exp(1)\\
                    print("math.exp(1):", result)\\
                    \dots
                };
                \node[multiple, label={\small Object Files}] (object_files) [right=of source_files] {
                    00000100010\\
                    01010100111\\
                    01110010110\\
                    \dots
                };
                \node[ordinary, label={\small Executable Files}] (exec_files) [right=of object_files] {
                    00000100010\\
                    01010100111\\
                    01110010110\\
                    \dots
                };                
                % Arrows
                \draw[-{Latex[length=3mm, width=2mm]}, thick] (source_files) -- (object_files) node[midway, above] {Compiler};
                \draw[-{Latex[length=3mm, width=2mm]}, thick] (object_files) -- (exec_files) node[midway, above] {Linker};    
            \end{tikzpicture}
        \caption{From Assembly to machine executable instructions.}
        \label{High Level}
    \end{figure}

\end{frame}

\end{document}
2
  • Please trim this down to a minimal example (10-20 lines) that exhibits the error.
    – Teepeemm
    Commented Jul 1 at 17:47
  • 1
    Many of the packages in your preamble aren't necessary in a beamer document. Beamer also doesn't have a floating mechanism, so specifying [ht] won't do anything useful. Commented Jul 1 at 18:30

1 Answer 1

0

The code compiles without error if an align option is given to the nodes. For example, if align=left, is placed after each occurrence of \node[.

2
  • Hi, many thanks for your answer. Do you know why it works ? Commented Jul 2 at 8:40
  • 1
    @Anoldmaninthesea. The contents of the nodes contain \\ thus an align option is needed to make \\ work. Commented Jul 2 at 15:49

You must log in to answer this question.

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