1 of 24

Typesetting Beautiful Mathematics with LaTeX, Lyx & MathJax

Tariq Rashid

Data Science Cornwall, July 2020

2 of 24

Aim

Develop useful skill

Understand concepts

Experience with tools

3 of 24

Papers, Journals, Books

4 of 24

Comparison

5 of 24

Comparison

6 of 24

Comparison

7 of 24

Tex

Donald Knuth

8 of 24

Aim

TEX & LaTEX

9 of 24

Architecture

TEX

LATEX

(packages)

low-level typography

document elements

(separate content from style)

macros for additional capabilities

Software Like Lyx

hides all the technical stuff below

1978

1984

10 of 24

TEX

TEX

\TeX{} is good at typesetting words like `fjord', `efficiency',

and `fiasco'. It is also good at typesetting math like,

$a^2 + b^2 = c^2$.

\bye

markup, just like HTML

11 of 24

TEX

fi

ff

fj

nice!

quotes are nice too!!

12 of 24

LATEX

LATEX

\documentclass{article}

\usepackage{amsmath} % Imports amsmath

\usepackage{parskip}

\title{Cartesian closed categories and the price of eggs}

\author{Jane Doe}

\date{September 1994}

\begin{document}

\maketitle

The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog.

The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog.

% This is a comment, not shown in final output.

% The following shows typesetting power of LaTeX:

\begin{align}

E_0 &= mc^2 \\

E &= \frac{mc^2}{\sqrt{1-\frac{v^2}{c^2}}}

\end{align}

The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog.

The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog.

\end{document}

import packages

title, author, etc

aligned equations

I added this extra package

13 of 24

LATEX

aligned by ‘=’ and numbered too

14 of 24

Aim

Lyx

15 of 24

Lyx

looks just like a word processor

16 of 24

Lyx

17 of 24

Important Concept

STYLE

CONTENT

18 of 24

Lyx Demonstration

  • Basic document sections
  • Equations
  • Figures & References
  • Included Documents

Lyx Demo

19 of 24

LaTEX vs Word Processors vs Lyx

document complexity

effort

LaTEX

MS Word

Lyx

20 of 24

Aim

Web

21 of 24

MathJax

Web Browser

HTML, CSS, SVG, MathML

MathJax

core web technology

additional js library

“MathML is not intended to be written or edited directly by humans.”

22 of 24

Including MathJax

code highlighting for my blog

include and configuration for mathjax

web example

23 of 24

MathJax Demonstration

  • Inline maths
  • Display maths
  • Aligned equations
  • Matrices & arrays

MathJax Demo

24 of 24

Links

LaTEX

Online Equation Editor

Lyx

MathJax

really handy!

handy!