# Chronicle of email correspondences

I'd like to collect all my old private email correspondences in a LaTeX document. The document should become a kind of "diary". (I also want to bind it to a book someday.)

So what I want to create should basically look like this:

\documentclass{myemailchronicle}

\begin{document}

\partner{DateAndTime}{%
Dear Max,
what an outstanding party last week, (...)
Yours Kate
}

\me{AnotherDateAndTime}{%
Hello Kate,
oh yeah it was SO GREAT, (...)
See you, Max
}

%Some more "\partner"s and "\me"s

\end{conversation}

%More conversations similar to the one shown above

\end{document}


Now, I don't have any experience with creating things like document classes or packages. I just don't know where to start...

What do you think is the best way to realize the things I want? Is there a more simple way, without using an own document class?

-
–  Speravir Feb 8 at 23:14

I don't think you need a new class here; you can use one of the standard classes (article, for example) and define your environment and commands with the help of some packages.

Here's one possibility using the tcolorbox package to define some framed boxes for the speakers (the partner and you); the conversation environment and the \partner and \me commands act as requested:

\documentclass{article}
\usepackage[a5paper]{geometry}% paper size just for the example
\usepackage[dvipsnames]{xcolor}
\usepackage{tcolorbox}
\usepackage{lipsum}% just to generate text for the example
\tcbuselibrary{most}

\newcommand\cpartner{}

\newenvironment{conversation}[3]
{\clearpage%
\noindent\parbox{\linewidth}{%
\gdef\cpartner{#1}%
\centering
{\Large\textsc{#1}}\par{\large\texttt{#2}\par#3\par}}%
\par\nobreak
}
{\par\bigskip}

\newtcolorbox{partn}[1][]{%
breakable,
enhanced,
colback=white,
title=\parbox{\linewidth}{\cpartner\par#1},
coltitle=black,
colframe=MidnightBlue!60,
colbacktitle=MidnightBlue!20,
before=\vskip20pt\noindent
}

\newtcolorbox{mebox}[1]{%
breakable,
enhanced,
colback=white,
coltitle=black,
colframe=Maroon!50,
colbacktitle=Maroon!20,
}

\newcommand\partner[2][]{%
\begin{partn}[#1]#2\end{partn}}

\newcommand\me[2]{%
\begin{mebox}{#1}#2\end{mebox}}

\begin{document}

\begin{conversation}{Kate Johnson}{kjohnson@gmail.com}{Birthday party}
\partner[28 August 1999]{\lipsum[2]\lipsum[4]}
\me{29 August 1999}{\lipsum[4]}
\partner[31 August 1999]{\lipsum[4]}
\me{2 September 1999}{\lipsum[4]}
\end{conversation}

\begin{conversation}{Liz Taylor}{ltaylor@gmail.com}{Resignation}
\partner[28 August 1999]{Some short message}
\partner[31 August 1999]{Some short message}
\end{conversation}

\end{document}


Another, more sober, alternative. In this approach, a List of all Conversations (similar to a table of contents) will be automatically produced; each entry will have the name of the partner and the topic of the conversation; colors different from black were suppressed:

\documentclass{article}
\usepackage[a5paper]{geometry}
\usepackage[dvipsnames]{xcolor}
\usepackage{tcolorbox}
\usepackage[explicit]{titlesec}
\usepackage{titletoc}
\usepackage{lipsum}
\tcbuselibrary{most}

\renewcommand\thesection{}
\titleformat{\section}
{\normalfont\Large\centering}{}{0em}{#1}
\newcommand\sectionbreak{\clearpage}

\newcommand\cpartner{}

\newenvironment{conversation}[3]
{\gdef\cpartner{#1}%
\section[\textsc{#1}~(#3)]{\textsc{#1}\\\texttt{#2}\\#3}
}
{\par}

\newtcolorbox{partn}[1][]{%
breakable,
enhanced,
colback=white,
arc=0pt,
outer arc=0pt,
title=\parbox{\linewidth}{\cpartner\par#1},
coltitle=black,
colframe=black,
boxrule=0.8pt,
colbacktitle=white,
before=\vskip20pt\noindent
}

\newtcolorbox{mebox}[1]{%
breakable,
enhanced,
arc=0pt,
outer arc=0pt,
colback=white,
coltitle=black,
colframe=black,
boxrule=0.8pt,
colbacktitle=white,
}

\newcommand\partner[2][]{%
\begin{partn}[#1]#2\end{partn}}

\newcommand\me[2]{%
\begin{mebox}{#1}#2\end{mebox}}

\renewcommand\contentsname{Conversations}
\titlecontents{section}[0em]
{}
{\contentslabel{0em}}
{}
{\titlerule*[1000pc]{.}\contentspage}

\begin{document}

\tableofcontents

\begin{conversation}{Kate Johnson}{kjohnson@gmail.com}{Birthday party}
\partner[28 August 1999]{\lipsum[2]}
\me{29 August 1999}{\lipsum[2-3]}
\partner[31 August 1999]{\lipsum[4]}
\me{2 September 1999}{\lipsum[4]}
\end{conversation}

\begin{conversation}{Liz Taylor}{ltaylor@gmail.com}{Resignation}
\partner[28 August 1999]{Some short message}
\partner[31 August 1999]{Some short message}
\end{conversation}

\begin{conversation}{Marcus Rump}{mrump@gmail.com}{Interesting offer}
\partner[28 August 1999]{Some short message}