LiveType LaTeX: A Library and Guide to Rapid Typesetting in a Technical Lecture Setting

Live demos (.gif / video) will be added to this article as time permits, as I'm still developing and improving my definitions and snippets. There will be more added over time (especially for diagrams and plots). Please see my github for the current development!

Examples of my notes, created in-class during lectures. Here's the current version of an ongoing collaboration with John-Michael Laurel for Stochastic Processes by Professor Jim Pitman.

The fundamental design principle here is not to create an embellished product but minimize the time invested in the document creation, maximizing time outside for review and application of the material.

With the right tools, you can do this too! This guide will help you get there. And no, you don't need ViM or Emacs.


This article provides documentation on how you can use existing LaTeX packages (and my libraries if you choose) with your favorite code editor (I use GitHub Atom) to create beautiful math/technical notes at a blazing fast speed. This approach allows for development of notes even faster than using an already defined and customized LaTeX template, with the added benefit of flexibility to adapt note-taking to a lecturer or presenter's pace and direction.

Background:

In Spring 2019, I typeset my math homework assignments in LaTeX (example for Linear Algebra) simply to challenge myself. Doing so from scratch, I started to appreciate how fast this can be. Back when I had taken Discrete Mathematics with the EECS department at Berkeley, submissions were done via SSH/SFTP, so I started using TeX to generate neat .pdf homeworks. However, back then I used easy beginner-friendly TeX IDEs. These make typesetting "easy" and intuitive, such as clicking a formula icon and inserting values into fields of a template. Although this approach requires no knowledge of LaTeX, it turns out that IDEs like these actually take almost as much time as processing a math document within Microsoft Word.

Unimpressed with the lack of scalability of using what-you-see-is-what-you-get editors, this Spring I started typing LaTeX from scratch, learning from examples and spamming documentation for help. Now I'm taking it a step further.

Most math note-takers copy down verbatim what the professor writes on the blackboard, key definitions, theorems, examples, and expressions. However, in most higher education math courses, perhaps the most valuable content to supplement the existing course textbook is the professor's explanations, illustrations of concepts, and side remarks.

The Challenge:

Create a LaTeX environment that enables rapid non-intrusive typesetting to create beautiful notes at a low concentration cost. That is, to be able to type up notes in LaTeX faster and neater than otherwise possible by hand. There should be little to no friction, and writing notes as presented on the blackboard should feel natural as writing equations by hand, with the added speed of typing instead of written gestures.

Assumptions:

Chances are, if you're here, you're moderately experienced with LaTeX and hoping to take your typesetting to the next level (without using ViM). You'll save an immense amount of time, and maybe even want to start taking LaTeX notes of every technical lecture and presentation you attend.

Demo: (under construction)

+ examples of notes
+ (gif & images); fast/rapid production of notes

What you'll want to download:

How to set up:

Luckily, setup is super simple, and any time spent on defining your environment is invested into your future works, tailored to your own needs.

Congratulations, you're all set!

Force yourself to practice just a bit; I promise you, compared to the benefit you'll derive from this investment, the learning curve really is nothing.

If you're interested in more... under the hood...

How My LaTeX Snippets Work (included in your downloads):

Here are some examples of snippets I've written:

  ######################
  ###### PREAMBLE ######
  ######################
  'addPREAMBLE':
    'prefix': 'addPREAMBLE'
    'body': """
    %%%% BEGIN PREAMBLE %%%%
    \\\\documentclass[8pt]{article}

    % packages
    \\\\usepackage{mathtools, amsmath, amsthm, amssymb}
    \\\\usepackage{graphicx, comment, tikz-cd}
    \\\\usepackage{fancyhdr, color}
    \\\\usepackage{tabto, lastpage}
    \\\\usepackage{enumitem}
    % remove spacing in enumerations and itemize
    \\\\setlist[enumerate]{topsep=0pt,itemsep=-1ex,partopsep=1ex,parsep=1ex}
    \\\\setlist[itemize]{topsep=0pt,itemsep=-1ex,partopsep=1ex,parsep=1ex}

    % definitions
    \\\\def\\\\eqbd{\\\\mathop{{:}{=}}}
    \\\\def\\\\bdeq{\\\\mathop{{=}{:}}}
    \\\\def\\\\ii{{\\\\rm i}}
    \\\\def\\\\Re{{\\\\rm Re}}
    \\\\def\\\\Im{{\\\\rm Im}}
    \\\\def\\\\rank{{\\\\rm rank}}
    \\\\def\\\\spanuwu{{\\\\rm span}}
    \\\\def\\\\tr{{\\\\rm tr}}
    \\\\def\\\\F{\\\\mathbb{F}}
    \\\\def\\\\R{\\\\mathbb{R}}
    \\\\def\\\\C{\\\\mathbb{C}}
    \\\\def\\\\Q{\\\\mathbb{Q}}
    \\\\def\\\\N{\\\\mathbb{N}}
    \\\\def\\\\Z{\\\\mathbb{Z}}

    % Theorem, Definition, Corollary, Lemma
    \\\\theoremstyle{definition} % non-italic
    \\\\newtheorem{theorem}{Theorem}[section]
    \\\\newtheorem{lemma}[theorem]{Lemma}
    % \\\\newtheorem{definition}{Definition}[section] % uncomment if you want unboxed definition
    \\\\newtheorem{corollary}{Corollary}[theorem]
    \\\\newtheorem{proposition}{Proposition}[theorem]
    %%%% END PREAMBLE %%%%

    ${1:addNOTES, addHOMEWORK, etc}
    """

If you're familiar to LaTeX, this looks extremely normal, barring the quad-backslashes. Fair warning, typing literal backslashes ("\") in CoffeeScript to be transferred to LaTeX requires you to input 4 backslashes ("\\\\"), as opposed to the intuitive 2.

Personally, I segment my preamble in two parts: (1) general package inclusion and setup + defined variables, (2) document type-specific setup. The above is part (1), which is added to a new, completely empty .tex document simply by typing "addPREAMBLE" and pressing tab. It automatically highlights the bottom, suggesting "addNOTES" or "addHOMEWORK", which (2) will complete your preamble and set up your document completely for your needs.

For note-taking:


  ######################
  ##### NOTETAKING #####
  ######################
  ## >>>>>>>>>>>>>>>>>>>
  'addNOTES':
    'prefix': 'addNOTES'
    'body': """
    %%%% BEGIN NOTES %%%%
    \\\\usepackage[letterpaper, portrait, left=50mm, right=50mm, top=25mm]{geometry}
    \\\\pagestyle{fancy}
    \\\\fancyhf{}
    \\\\lhead{${1:Class \#\#\#}}
    \\\\rhead{Daniel Suryakusuma}
    \\\\cfoot{\\\\thepage}

    \\\\begin{document}
    \\\\[\\\\]
    \\\\centerline{\\\\Large \\\\bf ${1:Class \#\#\#}, Summer 2019} \\\\vskip 0.1cm
    \\\\centerline{\\\\Large ${2:Lecture \#, Today's Date MM/DD/YYYY}}\\\\vskip 1cm

    $3





    %%%% END DOCUMENT %%%%
    \\\\end{document}
    """

For homework:


  ######################
  ###### HOMEWORK ######
  ######################
  ## >>>>>>>>>>>>>>>>>>>
  'addASSIGNEDPROBLEMS':
    'prefix': 'addASSIGNEDPROBLEMS'
    'body': '\\\\centerline{\\\\bf ${1:INSERT PROBLEMS ASSIGNED HERE}}'
  ## >>>>>>>>>>>>>>>>>>>



  'addHOMEWORK':
    'prefix': 'addHOMEWORK'
    'body': """
    %%%% BEGIN HOMEWORK OwO %%%%
    \\\\usepackage[letterpaper, portrait, left=20mm, right=20mm, top=25mm]{geometry}
    \\\\pagestyle{fancy}
    \\\\fancyhf{}
    \\\\lhead{${1:Class \#\#\#}}
    \\\\rhead{Daniel Suryakusuma, 24756460}
    \\\\cfoot{\\\\thepage}

    \\\\begin{document}
    \\\\[\\\\]
    \\\\centerline{\\\\Large \\\\bf ${1:Class \#\#\#}, Summer 2019} \\\\vskip 0.1cm
    \\\\centerline{\\\\bf PSET \\\\#${2:\#} (due ${3:MM}/${4:DD}/2019)} \\\\vskip 1cm

    $5





    %%%% END DOCUMENT %%%%
    \\\\end{document}
    """

To create quick (colored) environments like theorems, equations, or definitions, consider the following snippets:


  ### THEOREM ###
  'addTHEOREM':
    'prefix': 'addTHEOREM'
    'body': """
    %% BEGIN THEOREM %%
    \\\\begin{center} \\\\noindent
    \\\\colorbox{pink!50!blue!15}
      {\\\\parbox{0.96\\\\textwidth}{ \\\\begin{theorem}
            ${1:Insert theorem here. }
            \\\\end{theorem}}} \\\\end{center}
    %% END THEOREM %%

    $2
    """
  ### REMARK (pink) ###
  'addREMARK':
    'prefix': 'addREMARK'
    'body': """
    %% BEGIN REMARK %%
    \\\\begin{center} \\\\noindent
    \\\\colorbox{pink!50}{\\\\parbox{0.96\\\\textwidth}{ {\\\\bf Remark: }
    ${1:TYPE REMARK HERE}
    }} \\\\end{center}
    %% END REMARK %%

    $2
    """

Creating your own LaTeX snippets, and Tailoring them to your needs.

To me, the greatest benefit from code snippets in Atom for LaTeX is quickly jumping back and forth between input fields (like pressing 'Tab' in a web form). Send me a message, and I'll walk you through creating and customizing your own snippets to improve your coding efficiency!