0

I want to divide one slide as the following:

----------------------block1--------------------
------------------------------------------------
------------------------------------------------
------column1-------- %%%%%%%%%%%%%%%%%%%%%------column2-------------------------------------
----------------------%%%%%%%%%%%%%%%%%%%%%--------------------------------------------------
------item1---------- ---- %%%%%%%%%%%%%%%%%%%%% -------item2----------------------------------------
------image1------ %%%%%%%%%%%%%%%%%%%% --------image2--------------------------

This is my tex file:

\documentclass{beamer}
\mode<presentation> {
    \usetheme{Madrid}
    \setbeamertemplate{footline}[page number]
}
\usepackage{graphicx} % Allows including images
\usepackage{booktabs} % Allows the use of \toprule, 
                      % \midrule and \bottomrule in tables
\usepackage{tikz}   % add background image     
\listfiles
\begin{document}

\begin{frame}
    \frametitle{Decision Boundary of logistic regression}
       \begin{block}{Define a threshold for classification}
        If the probability of output ($h_\theta (x)$) 
        exceed $0.5$  choose class $y=1$
        \begin{gather*}
        h_\theta (x)=g(\theta _0 x_0+\theta_1 x_1 ... +\theta_n x_n) \geq 0.5\\
        (\theta _0 x_0+\theta_1 x_1 ... +\theta_n x_n) \geq 0
        \end{gather*}
        \end{block}
        \column{.48\textwidth} % Left column and width
        \begin{itemize}
            \item Linear boundary 
        \end{itemize}
        \includegraphics[scale=0.35]{Linearboundary}
        \column{.48 \textwidth} % Right column and width
        \begin{itemize}
            \item Non linear boundary
        \end{itemize}
       \includegraphics[scale=0.2]{NonLinearBoundary}
        \end{columns}
\end{frame}

%-----------------------------Frame-------------------------------------------
\begin{frame}
    \frametitle{content}

\end{frame}

\end{document}

But I got a lot of errors. I was wondering if some can help me?

line 32: Undefined control sequence. \end{frame}

line 32: Undefined control sequence. \end{frame}

line 32: Undefined control sequence. \end{frame}

line 32: Package keyval Error: undefined. \end{frame}

line 32: Undefined control sequence. \end{frame}

line 32: Undefined control sequence. \end{frame}

line 32: Undefined control sequence. \end{frame}

line 32: Undefined control sequence. \end{frame}

line 32: Undefined control sequence. \end{frame}

line 32: Package keyval Error: undefined. \end{frame}

line 32: Undefined control sequence. \end{frame}

line 32: Undefined control sequence. \end{frame}

line 32: Undefined control sequence. \end{frame}

line 32: Undefined control sequence. \end{frame}

line 32: Undefined control sequence. \end{frame}

line 32: Missing } inserted. \end{frame}

line 32: \begin{document} ended by \end{beamer@framepauses}. \end{frame}

line 32: Extra \endgroup. \end{frame}

line 32: Too many }'s. \end{frame}

line 32: Undefined control sequence. \end{frame}

line 32: \begin{document} ended by \end{beamer@frameslide}. \end{frame}

line 32: Extra \endgroup. \end{frame}

line 32: Font shape `OT1/cmss/m/n' in size <4> not available(Font) size <5> substituted: Size substitutions with differences(Font) up to 1.0pt have occurred.

4
  • 1
    Without an example in front of me this could be wrong, but : The columns should be in a columns environment, i.e. \begin{columns}\column{0.48\textwidth}.
    – Chris H
    Jan 27, 2017 at 16:12
  • @ChrisH is right. \begin{columns} is missing before the first \column{...}. Jan 27, 2017 at 16:15
  • You might have a look at this answer
    – Chris H
    Jan 27, 2017 at 16:15
  • Thank you all guys the problem of error is fixed. I am also trying to put image in every columns but it does not work
    – Rasoul
    Jan 27, 2017 at 16:29

1 Answer 1

0

You have to use the column-environment (singular) within the columns-environment (plural). So you have to do something like this:

    \begin{columns}
      \begin{column}{.48\textwidth} % Left column and width
      \end{column}%
      \hfill%
      \begin{column}{.48 \textwidth} % Right column and width
      \end{column}
    \end{columns}

I corrected that in your MWE. I also had to replace the image files, of course.

This is working without an error for me.

\documentclass{beamer}
\mode<presentation> {
  \usetheme{Madrid}
  \setbeamertemplate{footline}[page number]
}

\usepackage{graphicx}           % Allows including images
\usepackage{booktabs}           % Allows the use of \toprule, 
                                % \midrule and \bottomrule in tables
\usepackage{tikz}               % add background image     

\begin{document}
\begin{frame}
  \frametitle{Decision Boundary of logistic regression}
  \begin{block}{Define a threshold for classification}
    If the probability of output ($h_\theta (x)$) 
    exceed $0.5$  choose class $y=1$
    \begin{gather*}
      h_\theta (x)=g(\theta _0 x_0+\theta_1 x_1 ... +\theta_n x_n) \geq 0.5\\
      (\theta _0 x_0+\theta_1 x_1 ... +\theta_n x_n) \geq 0
    \end{gather*}
  \end{block}

  \begin{columns}
    \begin{column}{.48\textwidth} % Left column and width
      \begin{itemize}
      \item Linear boundary
      \end{itemize}
      \includegraphics[scale=0.35]{example-image-a}
    \end{column}%
    \hfill%
    \begin{column}{.48 \textwidth} % Right column and width
      \begin{itemize}
      \item Non linear boundary
      \end{itemize}
      \includegraphics[scale=0.2]{example-image-b}
    \end{column}
  \end{columns}
\end{frame}
\end{document}

And this is the result:

enter image description here

1
  • @Rasoul I am glad I could help you.
    – Jan
    Jan 27, 2017 at 16:39

You must log in to answer this question.

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