forked from bjornoka/latex-course
Oppdaterte kurs for 2025
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
# latex-course
|
# latex-course
|
||||||
|
|
||||||
Presentation and content for the latex course I have held and maybe will hold for PVV.
|
This LaTeX course was originally created by Bjørnar Kaarevik (Bjornoka) and is now being held by Torstein (Torsteno) for PVV.
|
||||||
|
|
||||||
## Compiling example document
|
## Compiling example document
|
||||||
|
|
||||||
Document found in `example-document/main.tex` can be compiled with the command:
|
Document found in `example-document/main.tex` can be compiled with the command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
latexmk -xelatex main.tex
|
latexmk -lualatex main.tex
|
||||||
```
|
```
|
||||||
|
|
||||||
## Compiling presentation
|
## Compiling presentation
|
||||||
|
|||||||
BIN
example-document.zip
Normal file
BIN
example-document.zip
Normal file
Binary file not shown.
@@ -1,3 +1,3 @@
|
|||||||
\section{The Appendix}
|
\section{The Appendix}
|
||||||
|
|
||||||
\lipsum[1]
|
\lipsum[1]
|
||||||
|
|||||||
@@ -129,4 +129,4 @@ Matrices (and vectors)
|
|||||||
% Works like a charm
|
% Works like a charm
|
||||||
\begin{gather*}
|
\begin{gather*}
|
||||||
\myvec{x_1\\x_2\\x_3} \leftarrow \text{My vector command}
|
\myvec{x_1\\x_2\\x_3} \leftarrow \text{My vector command}
|
||||||
\end{gather*}
|
\end{gather*}
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ I can also cite \cite{dirac}. % The only citation of dirac, if we remove it, di
|
|||||||
% If you're quoting larger passages from your sources, consider putting them in the
|
% If you're quoting larger passages from your sources, consider putting them in the
|
||||||
% "quote" environment
|
% "quote" environment
|
||||||
\begin{quote}
|
\begin{quote}
|
||||||
This is a quote which cites %\cite{einstein}
|
This is a quote which cites \cite{einstein}
|
||||||
\end{quote}
|
\end{quote}
|
||||||
|
|
||||||
% Small phrases may be quoted inline with "enquote"
|
% Small phrases may be quoted inline with "enquote"
|
||||||
I may also \enquote{quote} my sources \cite{einstein}.
|
I may also \enquote{quote} my sources \cite{einstein}.
|
||||||
|
|||||||
@@ -42,4 +42,4 @@ If you wish to write an entire paragraph, you may write everything on one line.
|
|||||||
\item[*] Do
|
\item[*] Do
|
||||||
\item[$\rightarrow$] This
|
\item[$\rightarrow$] This
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
\end{enumerate}
|
\end{enumerate}
|
||||||
|
|||||||
BIN
example-document/main.pdf
Normal file
BIN
example-document/main.pdf
Normal file
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
% Input encoding, ensures compatibility with UTF-8
|
% Input encoding, ensures compatibility with UTF-8
|
||||||
\usepackage[utf8]{inputenc} % Only necessary if using pdfLaTeX
|
\usepackage[utf8]{inputenc} % Only necessary if using pdfLaTeX
|
||||||
% XeLaTeX is a more modern compiler which supports utf8 by default
|
% XeLaTeX or LuaLaTeX are more modern compilers which supports utf8 by default
|
||||||
|
|
||||||
% Localization
|
% Localization
|
||||||
\usepackage[english]{babel} % Babel renews "hardcoded" strings to reflect the given language
|
\usepackage[english]{babel} % Babel renews "hardcoded" strings to reflect the given language
|
||||||
@@ -49,5 +49,3 @@
|
|||||||
%%% Custom Commands %%%
|
%%% Custom Commands %%%
|
||||||
% Unit commands, ensures math to exponentiate and un-italicises text
|
% Unit commands, ensures math to exponentiate and un-italicises text
|
||||||
\newcommand{\un}[1]{\ensuremath{\, \mathrm{#1}}}
|
\newcommand{\un}[1]{\ensuremath{\, \mathrm{#1}}}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,4 +20,4 @@ If you have `pandoc` you can write a markdown file (or many other document forma
|
|||||||
You can even integrate python code which is to be run and its output used as information for the source which is to be compiled to a pdf.
|
You can even integrate python code which is to be run and its output used as information for the source which is to be compiled to a pdf.
|
||||||
|
|
||||||
Since everything is in plain text files, you may programatically alter any of these text files to do really complex things.
|
Since everything is in plain text files, you may programatically alter any of these text files to do really complex things.
|
||||||
It is, however, way outside of the scope of this course.
|
It is, however, way outside of the scope of this course.
|
||||||
|
|||||||
@@ -1,10 +1,27 @@
|
|||||||
# Introductory Course to \LaTeX
|
# Introductory Course to \LaTeX
|
||||||
|
|
||||||
|
## About this course
|
||||||
|
|
||||||
|
- Created by Bjørnar Kaarevik
|
||||||
|
- Updated by Torstein Nordgård-Hansen in 2025
|
||||||
|
|
||||||
|
Slides available on [git.pvv.ntnu.no/Kurs/latex-course](https://git.pvv.ntnu.no/Kurs/latex-course)
|
||||||
|
|
||||||
|
## Get \LaTeX
|
||||||
|
|
||||||
|
- Linux: `sudo apt install texlive-full`
|
||||||
|
- Mac: `brew install mactex`
|
||||||
|
- BSD: `texlive?`
|
||||||
|
- Windows: `choco install texlive`
|
||||||
|
- Online: `overleaf.com`
|
||||||
|
|
||||||
|
Recommended etidors: TeXstudio, Emacs, VSCode
|
||||||
|
|
||||||
## What even is \LaTeX?
|
## What even is \LaTeX?
|
||||||
|
|
||||||
- 1978: Donald Knuth gets fed up by typographical errors in his documents and creates \TeX
|
- 1978: Donald Knuth gets fed up by typographical errors in his documents and creates \TeX
|
||||||
- 1984: Leslie Lamport gets fed up with having to write bonkers \TeX\ -commands and piles on a bunch of macros
|
- 1984: Leslie Lamport gets fed up with having to write bonkers \TeX\ -commands and piles on a bunch of macros
|
||||||
- 2025: We're here, still stuck with this ancient crap
|
- 2025: We're here, still stuck with this ancient mess
|
||||||
|
|
||||||
But actually, it is a pretty good **document preparation system**.
|
But actually, it is a pretty good **document preparation system**.
|
||||||
|
|
||||||
@@ -163,7 +180,7 @@ $$
|
|||||||
|
|
||||||
## Referencing
|
## Referencing
|
||||||
|
|
||||||
- `\usepackage{biblatex}`
|
- `\usepackage[backend=biber, style=ieee]{biblatex}`
|
||||||
- Reference list styling
|
- Reference list styling
|
||||||
- Many other options
|
- Many other options
|
||||||
- Needs a file containing available sources
|
- Needs a file containing available sources
|
||||||
@@ -228,7 +245,7 @@ better choices than you.
|
|||||||
## Figures and tables
|
## Figures and tables
|
||||||
|
|
||||||
- Width, height and angle:
|
- Width, height and angle:
|
||||||
- `[width=\textwidth, height=100mm, angle=45]`
|
- `[width=0.8\linewidth, height=100mm, angle=45]`
|
||||||
- `[!htbp]`
|
- `[!htbp]`
|
||||||
- Here, top, bottom and "special page"
|
- Here, top, bottom and "special page"
|
||||||
- Floats
|
- Floats
|
||||||
@@ -252,6 +269,7 @@ Some examples:
|
|||||||
- Everything on Overleaf.com
|
- Everything on Overleaf.com
|
||||||
- Documentation for packages on CTAN
|
- Documentation for packages on CTAN
|
||||||
- StackExchange
|
- StackExchange
|
||||||
|
- LLMs (sometimes)
|
||||||
|
|
||||||
\vspace{2em}
|
\vspace{2em}
|
||||||
|
|
||||||
|
|||||||
BIN
presentation/presentation.pdf
Normal file
BIN
presentation/presentation.pdf
Normal file
Binary file not shown.
Reference in New Issue
Block a user