summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/messagebubbles/messagebubbles.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/messagebubbles/messagebubbles.sty
Initial commit
Diffstat (limited to 'macros/latex/contrib/messagebubbles/messagebubbles.sty')
-rw-r--r--macros/latex/contrib/messagebubbles/messagebubbles.sty58
1 files changed, 58 insertions, 0 deletions
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
+}