`$$ \LaTeX \text{ Overview} $$` --- ## Today you will learn: - Why LaTeX is the standard for academic writing in Computer Science - How to professionally typeset relational algebra and calculus queries using LaTeX --- ## WYSIWYG vs LaTeX - WYSIWYG: What you see is what you get - Pros: Intuitive - LaTeX: Markup language for typesetting documents - Pros: Math formulae, styles, citations, version-control --- ## LaTeX Hello World ``` \documentclass{article} \title{Hello World} \author{Peter Story} \date{\today} \begin{document} \maketitle \section{Introduction} $$ E = mc^2 $$ \end{document} ``` --- ![alt text](Hello_World.pdf) --- ## Rendering LaTeX - [Overleaf](https://www.overleaf.com) - [TeX Distributions](https://www.latex-project.org/get/) - [MathJax](https://www.mathjax.org) - Equation editors in Word, Pages, etc. --- ## Relational Algebra List the names of all the managers who have been managing a department for more than a year. `$$ \pi_\text{Fname, Minit, Lname} \left( \sigma_\text{Mgr_start_date < 1/1/23} \left( \\ \text{EMPLOYEE} \bowtie_\text{Ssn=Mgr_ssn} \text{DEPARTMENT} \right) \right) $$` ``` \pi_\text{Fname, Minit, Lname} ( \sigma_\text{Mgr_start_date < 1/1/23} ( \\ \text{EMPLOYEE} \bowtie_\text{Ssn=Mgr_ssn} \text{DEPARTMENT})) ``` --- ## Relational Calculus List the names of all the managers who have been managing a department for more than a year. `$$ \left\{ e.\text{Fname}, e.\text{Minit}, e.\text{Lname } \big| \\ \text{ EMPLOYEE}(e) \text{ AND } \\ (\exists d)\big( \text{DEPARTMENT}(d) \text{ AND } \\ e.\text{Ssn} = d.\text{Mgr_ssn} \text{ AND } \\ d.\text{Mgr_start_date} < 1/1/23 \big)\right\} $$` --- `$$ \left\{ e.\text{Fname}, e.\text{Minit}, e.\text{Lname } \big| \\ \text{ EMPLOYEE}(e) \text{ AND } \\ (\exists d)\big( \text{DEPARTMENT}(d) \text{ AND } \\ e.\text{Ssn} = d.\text{Mgr_ssn} \text{ AND } \\ d.\text{Mgr_start_date} < 1/1/23 \big)\right\} $$` ``` \left\{ e.\text{Fname}, e.\text{Minit}, e.\text{Lname } \big| \\ \text{ EMPLOYEE}(e) \text{ AND } \\ (\exists d)\big( \text{DEPARTMENT}(d) \text{ AND } \\ e.\text{Ssn} = d.\text{Mgr_ssn} \text{ AND } \\ d.\text{Mgr_start_date} < 1/1/23 \big)\right\} ``` --- ## LaTeX Tips - Write complex formulae by hand before writing LaTeX - Use [Detexify](https://detexify.kirelabs.org/classify.html) to identify symbol names - Syntax errors are easier to find if you commit often