This is a continuation of the topic Displaying a Numbered Questions and Answer.
I continue to give color to the background, then putting questions and answers in the boxes using mdframed package.
\documentclass{beamer}
\setbeamercovered{transparent=0}
\setbeamercolor{background canvas}{bg=lime!20}
\usepackage{xcolor}
\usepackage{transparent}
\usepackage[framemethod=TikZ]{mdframed}
\mdfdefinestyle{QueFrame}{%
linecolor = blue!30,
outerlinewidth = 2pt,
roundcorner = 10pt,
leftmargin = 10pt,
rightmargin = 80pt,
innertopmargin = \baselineskip,
innerbottommargin = \baselineskip,
innerrightmargin = 20pt,
innerleftmargin = 20pt,
backgroundcolor = red!20!white
}
\mdfdefinestyle{AnsFrame}{
linecolor = red!30,
outerlinewidth = 2pt,
roundcorner = 10pt,
leftmargin = 80pt,
rightmargin = 10pt,
innertopmargin = \baselineskip,
innerbottommargin = \baselineskip,
innerrightmargin = 20pt,
innerleftmargin = 20pt,
backgroundcolor = blue!20!white
}
\newcounter{num}
\setcounter{num}{0}
\newcommand<>\Que[1]{
\leavevmode\par
\stepcounter{num}
\noindent
\begin{mdframed}[style=QueFrame]
\hbox{
{\color{blue}\transparent{0.3}\Huge Q{\huge\thenum}} --- #1}
\end{mdframed}
}
\newcommand<>\Ans[2][]{
\leavevmode\par
\noindent
\begin{flushright}
\begin{mdframed}[style=AnsFrame]
\textbf{#1} #2 --- {\Huge\color{blue}\transparent{0.3} A}
\end{mdframed}
\end{flushright}
}
\resetcounteronoverlays{num}
\begin{mdframed}[style=QueFrame]
\inserttitle{\huge\color{blue} Questions and Answer}
\end{mdframed}
\begin{mdframed}[style=AnsFrame]
\insertauthor{\Large\color{blue} Edy Wihardjo}
\end{mdframed}
\date{}
\begin{document}
\frame{\titlepage}
\setbeamercolor{background canvas}{bg=green!20}
\begin{frame}
\Que{What is \LaTeX{}?}
\pause
\Ans{\LaTeX{} is a document preparation system and document markup language!}
\end{frame}
\begin{frame}
\Que{Why I should use \LaTeX?}
\pause
\Ans{\LaTeX{} provides very high quality. \LaTeX{} is free and Open Source!}
\end{frame}
\end{document}
First Problem
How to set the title to be in the middle of the page?
I've added a command:
\begin{frame}
\vspace{15pt}
\titlepage
\end{frame}
but does not work.
Second Problem
Before displaying the answer, there is an empty text box.