From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Mon, 2 Sep 2019 13:46:59 +0900
Subject: Initial commit

---
 .../contrib/messagebubbles/messagebubbles.sty      | 58 ++++++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 macros/latex/contrib/messagebubbles/messagebubbles.sty

(limited to 'macros/latex/contrib/messagebubbles/messagebubbles.sty')

diff --git a/macros/latex/contrib/messagebubbles/messagebubbles.sty b/macros/latex/contrib/messagebubbles/messagebubbles.sty
new file mode 100644
index 0000000000..59bb4d07c6
--- /dev/null
+++ b/macros/latex/contrib/messagebubbles/messagebubbles.sty
@@ -0,0 +1,58 @@
+% dependencies
+\usepackage{pbox}
+\usepackage{fancybox}
+
+% commands
+\newcommand{\messagebubbleleft}[2]{
+
+  \begin{flushleft}
+    \messagebubble{#2}
+    \\ % newline after bubble
+    \timestampleft{#1}
+    \adjustvspace
+  \end{flushleft}
+}
+
+\newcommand{\messagebubbleright}[2]{
+
+  \begin{flushright}
+    \messagebubble{#2}
+    \\ % newline after bubble
+    \timestampright{#1}
+    \adjustvspace
+  \end{flushright}
+
+}
+
+\newcommand{\messagebubble}[1]{
+  \ovalbox{
+    \pbox{\messagebubblewidth}{
+      \textwidth1cm
+      #1
+    }
+  }
+}
+
+\newcommand{\messagebubblewidth}{
+  0.60\textwidth
+}
+
+\newcommand{\adjustvspace}{
+  \vspace{-0.6cm}
+}
+
+\newcommand{\timestampright}[1]{
+  \vspace{2pt}
+  \timestamp{#1} % content of timestamp
+  \hspace{1pt}
+}
+
+\newcommand{\timestampleft}[1]{
+  \vspace{2pt}
+  \hspace{1pt}
+  \timestamp{#1} % content of timestamp
+}
+
+\newcommand{\timestamp}[1]{
+  {\footnotesize \textit{#1}} % italic and small
+}
-- 
cgit v1.2.3

