Multiline LaTeX Formulas in Keynote

Apple Keynote’s support for LaTeX formulas is awesome: go to Insert/Equation… and enter LaTeX code directly (you can also use MathML). The code will be evaluated and results displayed as you type. Here you can find some examples. As a general rule, you should probably write multiple lines of equations as multiple individual equations and then align them using Keynote.

If however for some reason you would like to write a single multi-line equation you can use an aligned block and double backslashes to create newlines:

  \mathcal{L}(\phi)=\sum_i{l(\hat{y}_i,y_i)}+\sum_k{\Omega(f_k)} \\
  \text{where} \\
  \Omega(f)=\gamma T+\frac{1}{2}\lambda\|w\|^2

The text will be right-aligned. Add ampersands to the beginning of each line to left-align:

& \mathcal{L}(\phi)=\sum_i{l(\hat{y}_i,y_i)}+\sum_k{\Omega(f_k)} \\
& \text{where} \\
& \Omega(f)=\gamma T+\frac{1}{2}\lambda\|w\|^2

About Grischa Ekart

Follow me on Twitter: @gekart. I am a trainer and consultant for AWS, Docker, Kubernetes, Machine Learning and all things DevOps.
This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.