13

A few years ago, I've processed the XML output of the twitter API with a XSLT stylesheet to produce some FOP-based slides reproducing the pages of twitter: (e.g: http://www.slideshare.net/lindenb/bioinfo-tweets )

enter image description here

What would be the best way to achieve this in beamer?

Werner
  • 603,163
Pierre
  • 253

1 Answers1

19

One possibility using tcolorbox and some minipages:

\documentclass[xcolor=dvipsnames]{beamer}
\usetheme{CambridgeUS}
\useinnertheme{rectangles}
\useoutertheme{infolines}
\usepackage{tcolorbox}
\usepackage{kpfonts}
\definecolor{twblue}{RGB}{61,157,209}
\definecolor{twback}{RGB}{112,147,151}
\definecolor{twbrown}{RGB}{139,84,43}
\title{AAAA}

\newtcolorbox{mytweet}{
  colback=white,
  colframe=white,
  arc=0pt,
  outer arc=0pt,
  width=12cm,
  left=1cm,
  right=1cm}

\newcommand\btweet[7][twblue]{%
\begingroup
\setbeamertemplate{background}{\color{twback}\rule{\paperwidth}{\paperheight}}
\begin{frame}
\begin{mytweet}
  \begin{minipage}[t][2cm][c]{1.5cm}
    \raisebox{-\height}{\includegraphics[width=1.5cm,height=1.5cm]{#2}}
  \end{minipage}\hfill%
  \begin{minipage}[t][2cm][c]{8cm}
    \textcolor{#1}{\LARGE\bfseries #3}\par
    \small \textcolor{#1}{#4},~#5
  \end{minipage}\par
  \begin{minipage}[t][4cm][t]{\linewidth}
    \raggedright\Large #6
    \vfill

    \small\textcolor{#1}{#7}
  \end{minipage}
\end{mytweet}
\end{frame}
\endgroup%
}

\begin{document}

\btweet{picture}{@hongiiv}{HongChangBum(\#\#\#)}{iphone 37.6789876}{@yokofakun Your lab notebook is very useful for me. I'm finding variation using
Roche454, GATK from Korean population. Thank you :-)
}{Thu Sep 16 18:51:39 +0000\,2010}

\btweet[twbrown]{picture}{@soilandreyes}{Stian Soiland-Reyes}{Manchester, UK}{@yokofakun I am sorry. Nobody should use \#Axis anymore, it's way too buggy. Tried Apache \#CXF?}{Tue Jan 04 14:13:07 +0000\,2010}

\end{document}

enter image description here

The \btweet command has six mandatory arguments:

 \btweet{<image>}{<username>}{<userinfo1>}{<userinfo2>}{<message>}{<time>}

and an optional argument allowing you to change the inner color.

Depending on your actual needs, you might add another argument to change the background (I used a solid color, but you could use an image instead).

Gonzalo Medina
  • 505,128