0

enter image description here

\documentclass[usenames,dvipsnames]{beamer}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{listings}
\usepackage{algpseudocode}
\usefonttheme[onlymath]{serif}
\usepackage{amsmath}
\usetheme{Madrid}
\begin{document}
\begin{frame}
  \frametitle{The Euclidian Algorithm}
  \footnotesize
  \begin{columns}[t]
  \begin{column}{0.5\linewidth}
  \vspace*{-2cm}
  \begin{exampleblock}{Algorithm}
   \[ a=q_1b+r_1 \quad\quad 0<r_1<b \]
   \[ b=q_2r_1+r_2 \quad\quad 0<r_2<r_1 \]
   \[ r_1=q_2r_2+r_3 \quad\quad 0<r_3<r_2 \]
   \[ r_{n-2}=q_nr_{n-1}+r_n \quad\quad 0<r_n<r_{n-1} \]
    \[ r_{n-1}=q_{n+1}r_n+0 \]
    \[ d=gcd(a,b)=r_n\]
  \end{exampleblock}
  \end{column}
 \begin{column}{0.33\linewidth}
  \hspace*{-9cm}
  \begin{exampleblock}{Example 1: gcd(10,63)}
   \[63=10.6+3\]
   \[10=3.3.+1\]
   \[3=3.1+0\]
  \end{exampleblock}
    \end{column}
  \begin{column}{0.6\linewidth}
  \vspace*{-1cm}
\footnotesize
  \begin{exampleblock}{Example 2: gcd(1701,3768)}
   \[3768=1701.2+366\]
   \[1701=366.4+237\]
   \[366=237.1+129\]
   \[237=129.1+108\]
   \[129=108.1+21\]
   \[108=21.5+3\]
   \[21=3.7+0\]
  \end{exampleblock}
  \end{column}
\end{columns}
\end{frame}
\end{document}

I want to position the Example 1 column bellow the Algorithm and Example 2 in right to the Algorithm.

I put hspace*{-9cm} left move the Example 1 column left, but not moves.

  • 1
    Why don't you just put it into the same column if is supposed to sit below? – user121799 Jul 23 '18 at 16:56
  • @marmot As they are different block(one is algorithm and one is example) I want to put in separate. – alhelal Jul 23 '18 at 17:03
  • the position of the exampleblock after an hspace is the same as the position after abc it does not move to the right or left as it starts a new pararaph, below, the \hspace* here just starts a (white) paragraph with no text. – David Carlisle Jul 23 '18 at 18:19
5

Is this the layout you are looking for?

\documentclass[usenames,dvipsnames]{beamer}
%\usepackage{xcolor}
\usepackage{tikz}
\usepackage{listings}
\usepackage{algpseudocode}
\usefonttheme[onlymath]{serif}
\usepackage{amsmath}
\usetheme{Madrid}
\begin{document}
\begin{frame}
  \frametitle{The Euclidian Algorithm}
  \footnotesize
  \begin{columns}[T]
  \begin{column}{0.5\linewidth}
  \begin{exampleblock}{Algorithm}
   \[ a=q_1b+r_1 \quad\quad 0<r_1<b \]
   \[ b=q_2r_1+r_2 \quad\quad 0<r_2<r_1 \]
   \[ r_1=q_2r_2+r_3 \quad\quad 0<r_3<r_2 \]
   \[ r_{n-2}=q_nr_{n-1}+r_n \quad\quad 0<r_n<r_{n-1} \]
    \[ r_{n-1}=q_{n+1}r_n+0 \]
    \[ d=gcd(a,b)=r_n\]
  \end{exampleblock}
    \begin{exampleblock}{Example 1: gcd(10,63)}
     \[63=10.6+3\]
     \[10=3.3.+1\]
     \[3=3.1+0\]
    \end{exampleblock}
  \end{column}
 \begin{column}{0.45\linewidth}
    \begin{exampleblock}{Example 2: gcd(1701,3768)}
     \[3768=1701.2+366\]
     \[1701=366.4+237\]
     \[366=237.1+129\]
     \[237=129.1+108\]
     \[129=108.1+21\]
     \[108=21.5+3\]
     \[21=3.7+0\]
    \end{exampleblock}
    \end{column}
\end{columns}
\end{frame}
\end{document}

enter image description here

And as already said for you previous question: you don't need xcolor with beamer

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.