% Created 2020-07-21 Tue 17:48
% Intended LaTeX compiler: pdflatex
\documentclass[presentation]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage{microtype}
\usepackage[scale=0.9]{sourcecodepro}

  \usepackage[main,include]{embedall}
  \IfFileExists{./\jobname.org}{\embedfile[desc=The original file]{\jobname.org}}{}
  
  \usepackage{minted}
  \usepackage[many]{tcolorbox}
  \setminted{
    frame=none,
    % framesep=2mm,
    baselinestretch=1.2,
    fontsize=\footnotesize,
    highlightcolor=white!95!black!80!blue,
    linenos,
    breakanywhere=true,
    breakautoindent=true,
    breaklines=true,
    tabsize=4,
    xleftmargin=3.5em,
    autogobble=true,
    obeytabs=true,
    python3=true,
    % texcomments=true,
    framesep=2mm,
    breakbefore=\\.+,
    breakafter=\,
    style=autumn,
    breaksymbol=\color{white!60!black}\tiny\ensuremath{\hookrightarrow},
    breakanywheresymbolpre=\,\footnotesize\ensuremath{_{\color{white!60!black}\rfloor}},
    breakbeforesymbolpre=\,\footnotesize\ensuremath{_{\color{white!60!black}\rfloor}},
    breakaftersymbolpre=\,\footnotesize\ensuremath{_{\color{white!60!black}\rfloor}},
  }
  
  \BeforeBeginEnvironment{minted}{
    \begin{tcolorbox}[
      enhanced,
      overlay={\fill[white!90!black] (frame.south west) rectangle ([xshift=2.8em]frame.north west);},
      colback=white!95!black,
      colframe=white!95!black, % make frame colour same as background
      breakable,% Allow white breaks
      arc=0pt,outer arc=0pt,sharp corners, % sharp corners
      boxsep=0pt,left=0pt,right=0pt,top=0pt,bottom=0pt % no margin/paddding
    ]
  }
  \AfterEndEnvironment{minted}{\end{tcolorbox}}
  \renewcommand\theFancyVerbLine{\color{black!60!white}\arabic{FancyVerbLine}} % minted line numbering
\usetheme[progressbar=foot]{metropolis}
\author{Timothy}
\date{2020-07-21}
\title{Org Mode}
\subtitle{The Emacs of plain-text formats}
\let\textsc\MakeUppercase
\definecolor{verbatim}{HTML}{50a14f}
\makeatletter \def\verbatim@font{\color{verbatim}\normalfont\ttfamily} \makeatother

\colorlet{greenyblue}{blue!70!green}
\colorlet{blueygreen}{blue!40!green}
\providecolor{link}{named}{greenyblue}
\providecolor{cite}{named}{blueygreen}
\hypersetup{
  pdfauthor={Timothy},
  pdftitle={Org Mode},
  pdfkeywords={},
  pdfsubject={},
  pdfcreator={Emacs 26.3 (Org mode 9.4)},
  pdflang={English},
  breaklinks=true,
  colorlinks=true,
  linkcolor=,
  urlcolor=link,
  citecolor=cite
}
\urlstyle{same}
\begin{document}

\maketitle

\section{Plain text formats}
\label{sec:plain-text-formats}
\begin{frame}[label={sec:known-uses},fragile]{Known uses}
 When I say ``plain text'', what comes to mind?
\pause

\begin{itemize}
\item Source code \pause
\item \texttt{README} files \pause
\item \LaTeX
\item \verb~HTML~
\end{itemize}

\pause
All of these essentially consist of content and markup/syntax.
\end{frame}
\begin{frame}[label={sec:markdown},fragile]{Markdown}
 The most common plaintext markup syntax, created in 2004.

\begin{minted}[,fontsize=\tiny]{md}
# This is markdown

For **bold** we use twice as many asterics as neccesary, then use the same
charachter for *italic*. But wait there's another way to do _italics_, it just
seems like it should be underline. Thankfully there's only one way to do
[links](https://tecosaur.com), or is it (a link)[https://tecosaur.com]? Every so
often I forget the order, and then it's a pain. At least `inline-code` is simple.

By the way, did I mention there are about 40 functionally different markdown implementations?
(see [here](https://github.com/commonmark/commonmark-spec/wiki/markdown-flavors))
\end{minted}
\end{frame}
\begin{frame}[label={sec:org-mode},fragile]{Org-mode}
 A format developed within Emacs, created in 2003. Other systems have begun work
on supporting the format.

\begin{minted}[,fontsize=\tiny]{text}
* This is Org-mode

We have a single-emphasis-charachter *bold*, and sensible /italics/, which
makes a nice change.
There's only one way of doing [[*This is Org-mode][links]],
but unfortunately I now need to press shift for ~inline code~.

We also get =verbatim= though, and there's only one implementation of this,
so no fragmentation.
\end{minted}
\end{frame}
\begin{frame}[label={sec:one-moment}]{One moment\ldots{}}
From our \hyperlink{sec:known-uses}{first slide}, ``Content and markup''.

\pause
That applies to far more that the examples we listed.
Consider: \pause
\begin{itemize}
\item Presentations \pause
\item Spreadsheets \pause
\item (Uni) notes, \textls*[70]{\textsc{pkb}\protect\scalebox{.91}[.84]{s}}
\item Reports/Papers \pause
\item Interactive notebooks \pause
\item Books \pause
\item Todo lists / task management
\end{itemize}

\pause
That's \ldots{} a lot
\end{frame}

\begin{frame}[label={sec:consider-overlap}]{Consider the overlap}
For almost all of the different use cases just mentioned, we use a different app
for almost each use. In each app though, we spend most of our time just working
with text.

\pause
For a single task, we'll often use multiple apps, then struggle to weave a
workflow together involving them all. Most apps are well aware of this, and so
have put a good deal of effort into integrations (e.g. the Microsoft Office series).

\pause
Reflecting on this however, this state of affairs seems a bit sub-optimal.
\end{frame}

\begin{frame}[label={sec:example-comp-sci}]{Example --- Comp. Sci. Researcher}
Consider the following hypothetical, situation:

You are a computer science researcher. You have a nice idea which re-imagines
the standard method of implementing a common algorithm.
You want to try it out, then maybe write a paper/blog post.
\end{frame}

\begin{frame}[label={sec:comp-sci-researcher},fragile]{Comp Sci Researcher Hypothetical}
 \footnotesize
\begin{description}
\item[{Search the existing literature}] you'd want some sort of notes file, probably
a word doc (\texttt{.docx}), or other plaintext format (\texttt{.md}).
\item[{Write up you idea so you don't forget}] likely use a (second) word or \texttt{.md} doc, or if some
maths is involved --- \LaTeX{} (\texttt{.tex})
\item[{Test your idea}] Open up a notebook to prototype some code, using something
like Jupyter (\texttt{.ipynb})
\item[{Formally code your idea up}] Use you code editor of choice, and whatever language
\item[{Tabulate speed comparison}] A basic spreadsheet seems appropriate, \texttt{.xlsx}.
\item[{Write up a paper}] The industry standard is \LaTeX{} (\texttt{.tex})
\item[{Share a blog post on your website}] Convert aspects of you paper (\texttt{.tex}) to \texttt{.md} or
some other format that web \textls*[70]{\textsc{cms}} tools use, probably with examples from your
notebook (\texttt{.ipynb}) and maybe your speed comparison (\texttt{.xlsx})
\end{description}

Wow .. that's about six different applications/formats, and your work is spread
across about 5-8 files too!
\end{frame}
\begin{frame}[label={sec:note-workflow}]{A note on workflow}
You can do productive, maintainable and reproducible work with all kinds of
different software set-ups. So this discussion is not geared toward convincing
you there is 'One True Way' to organize things. I do think, however, that if you’re
in the early phase of your career, it's worth giving some thought to how you’re
going to organize and manage your work. Here, I will just try to detail one
particular method, and the features which I think make it a particularly worthy candidate.

\tiny
\emph{My paraphrased adaptation of Kieran's introduction in ``Choosing Your Workfow Applications''}
\end{frame}
\section{Org-mode}
\label{sec:-org-mode}
\begin{frame}[label={sec:whats-with-name}]{What's with the name?}
Why is ``mode'' in the name? \pause

It's because name of the emacs 'mode' that this format was designed/implemented in.
\end{frame}
\begin{frame}[label={sec:what-it}]{What is it?}
A plain text markup format, like we mentioned earlier.
\pause

It's designed to be easily manipulated by both humans (like markdown) and code
(like \textls*[70]{\textsc{json}}).

\pause
The mode supplies a syntax, and tools, for programmatically handling structured
text, and an ecosystem built upon that fundamental ability. And it runs inside
Emacs.
\end{frame}

\begin{frame}[label={sec:what-makes-it},fragile]{What makes it good?}
 Possibilities allowed for by that last paragraph. Particularly:

\begin{itemize}
\item The \emph{rich} functionally of the \texttt{Org-mode} mode
\item Org-babel
\item Integration
\end{itemize}
\end{frame}

\begin{frame}[label={sec:what-can-you}]{What can you do with it}
Now I demo a lot.

\pause
Please, please, \emph{please} talk to me.
We'll both get the most out of this if this segment is highly interactive.
\end{frame}

\begin{frame}[label={sec:resources}]{Resources}
\begin{itemize}
\item \href{https://github.com/hlissner/doom-emacs}{Doom Emacs}
\item \href{http://atomized.org/blog/2018/09/19/what-even-is-org-mode/}{What Even Is Org Mode? - Atomized}
\item \href{http://kieranhealy.org/files/misc/workflow-apps.pdf}{Choosing Your Workflow Application (pdf)}
\end{itemize}

And some recommendations:
\begin{itemize}
\item \href{http://pragmaticemacs.com/org-mode-tutorials/}{Org-mode tutorials | Pragmatic Emacs}
\item \href{https://www.youtube.com/watch?v=sQS06Qjnkcc\&list=PLVtKhBrRV\_ZkPnBtt\_TD1Cs9PJlU0IIdE}{OrgMode E01S01: Headlines \& outline mode - YouTube}
\end{itemize}
\end{frame}
\end{document}
