\documentclass[final]{beamer}

\usepackage{dgd-theme}
\usepackage{picture}

% provides the command \pscharpath
% (see below)
\usepackage{alltt}
\usepackage{lipsum}

% insert the parameters
% \dgdposter{project code}{project title}{principal investigators}{participating universities}
\dgdposter{DOC}{Snippets}{PI1, PI2, PI3}{TU~Berlin, TU~München, etc.}
\setlength{\fboxsep}{0pt}%
\setlength{\fboxrule}{5pt}%

% code listings
\usepackage{listings}
\definecolor{lightgrey}{rgb}{0.9,0.9,0.9}
\definecolor{darkgreen}{rgb}{0,0.6,0}
 
\lstset{language=[LaTeX]TeX,
basicstyle=\ttfamily,
texcsstyle=*\bf\color{blue},
numbers=none,
breaklines=true,
keywordstyle=\color{darkgreen},
commentstyle=\color{red},
%otherkeywords={$, \{, \}, \[, \]},
frame=none,
tabsize=2,
backgroundcolor=\color{lightgrey}
}
\lstset{language=[LaTeX]tex}

\begin{document}
\begin{frame}[t,fragile]


% Example 1 : different type of boxes

\begin{lstlisting}[caption=different types of boxes]
% Example Box 1
\begin{notitlebox}{Example Box 1}
  A box without title.
\end{notitlebox}

% Example Box 2
\begin{lefttitlebox}{Example Box 2}
  A box with a title on the left.
\end{lefttitlebox}

% Example Box 3
\begin{centertitlebox}{Example Box 3}
  A box with a title in the middle.
\end{centertitlebox}

% Example Box 4
\begin{righttitlebox}{Example Box 4}
  A box with a title on the right.
\end{righttitlebox}
\end{lstlisting}

\begin{notitlebox}{Example Box 1}
  A box without title.
\end{notitlebox}
\begin{lefttitlebox}{Example Box 2}
  A box with a title on the left.
\end{lefttitlebox}
\begin{centertitlebox}{Example Box 3}
  A box with a title in the middle.
\end{centertitlebox}
\begin{righttitlebox}{Example Box 4}
  A box with a title on the right.
\end{righttitlebox}

\vspace{1cm}


% Example 2 : two columns with boxes

\begin{lstlisting}[caption=two columns with boxes]
  \begin{columns}[onlytextwidth]
    % column 1
    \begin{column}[T]{.49\textwidth}
      \begin{lefttitlebox}{Left Box 1}
        Box on the left side.
      \end{lefttitlebox}
      \begin{lefttitlebox}{Left Box 2}
        Box on the left side.
      \end{lefttitlebox}
    \end{column}
    % column 2
    \begin{column}[T]{.49\textwidth}
      \begin{righttitlebox}{Right Box}
        Box on the right side with more content.\\
        padding content
      \end{righttitlebox}
    \end{column}
  \end{columns}
\end{lstlisting}

\begin{columns}[onlytextwidth]
  \begin{column}[T]{.49\textwidth}
    \begin{lefttitlebox}{Left Box 1}
      Box on the left side.
    \end{lefttitlebox}
    \begin{lefttitlebox}{Left Box 2}
      Box on the left side.
    \end{lefttitlebox}
  \end{column}
  \begin{column}[T]{.49\textwidth}
    \begin{righttitlebox}{Right Box}
      Box on the right side. With more content.\\
      padding content
    \end{righttitlebox}
  \end{column}
\end{columns}

\end{frame}
\begin{frame}[fragile]


% Example 3 : boxes with equal height

\begin{lstlisting}[caption=two columns with boxes of the same height]
  \begin{columns}[onlytextwidth]
    % column 1
    \begin{column}[T]{.49\textwidth}
      \begin{lefttitlebox}[equal height group=A]{Left Box}
        Box on the left side.
      \end{lefttitlebox}
    \end{column}
    % column 2
    \begin{column}[T]{.49\textwidth}
      \begin{righttitlebox}[equal height group=A]{Right Box}
        Box on the right side with more content.\\
        padding content\\
        more padding
      \end{righttitlebox}
    \end{column}
  \end{columns}
\end{lstlisting}

  \begin{columns}[onlytextwidth]
    % column 1
    \begin{column}[T]{.49\textwidth}
      \begin{lefttitlebox}[equal height group=A]{Left Box}
        Box on the left side.
      \end{lefttitlebox}
    \end{column}
    % column 2
    \begin{column}[T]{.49\textwidth}
      \begin{righttitlebox}[equal height group=A]{Right Box}
        Box on the right side with more content.\\
        padding content\\
	more padding
      \end{righttitlebox}
    \end{column}
  \end{columns}

  \vspace{1cm}

% Example 4 : boxes with explicit width

\begin{lstlisting}[caption=boxes with explicit width]
  \begin{lefttitlebox}[width=10cm]{10cm Box}
    This box has a width of 10cm.
  \end{lefttitlebox}
  % narrow boxes look better if the text is aligned left using flushleft
  \begin{lefttitlebox}[width=10cm]{Flush Box}
    \begin{flushleft}
      This box has a width of 10cm and its text is aligned left.
    \end{flushleft}
  \end{lefttitlebox}
\end{lstlisting}

\begin{lefttitlebox}[width=10cm]{10cm Box}
    This box has a width of 10cm.
\end{lefttitlebox}
\begin{lefttitlebox}[width=10cm]{Flush Box}
  \begin{flushleft}
    This box has a width of 10cm and its text is aligned left.
  \end{flushleft}
\end{lefttitlebox}


% Example 5 : boxes inside a picture

\begin{lstlisting}[caption=box placed with picture environment]
\begin{picture}(.985\textwidth,12cm) \put(10cm,1cm){
  \begin{lefttitlebox}[width=40cm]{Placed Box}
    This box is placed using the picture environment.
  \end{lefttitlebox}
\end{picture}
\end{lstlisting}

\begin{picture}(.985\textwidth,12cm) \put(10cm,1cm){
  \begin{lefttitlebox}[width=40cm]{Placed Box}
    This box is placed using the picture environment.
  \end{lefttitlebox} }
\end{picture}

\end{frame}
\end{document}
