Installation of latex and minted on Ubuntu
- LaTex Installation:
sudo apt install texlive texlive-latex-extra texlive-lang-french texmaker
- Minted dependencies:
sudo apt install python3-pygments
- In TexMaker, go in
Options > Configurer Texmaker
and add the following line inPdfLaTex
:
pdflatex -shell-escape -synctex=1 -interaction=nonstopmode %.tex
- Minted example:
\begin{minted}{python}
import numpy as np
def incmatrix(genl1,genl2):
m = len(genl1)
n = len(genl2)
M = None #to become the incidence matrix
VT = np.zeros((n*m,1), int) #dummy variable
return M
\end{minted}
More examples in: here
Installation of latex and minted with Arch based
TODO
Installation of the Metropolis theme
- Install dependencies:
- Ubuntu:
sudo apt install latexmk texlive-xetex
- Install Metropolis with Git: Link for the git repo: here
cd /tmp
git clone [email protected]:matze/mtheme.git
cd mtheme/
make sty && make install
Then you just need to change your latex with \usetheme{metropolis}
.
To use minted with Beamer, remember to add the [fragile]
keyword:
\begin{frame}[fragile]{Frame}
\begin{minted}{c}
int main() {
printf("hello, world");
return 0;
}
\end{minted}
\end{frame}
Makefile example with XeLaTeX
MAIN = main
MAIN_LATEX = $(MAIN).tex
PDF_TARGET = $(MAIN_LATEX:.tex=.pdf)
TARGET ?= $(PDF_TARGET)
LATEX = xelatex
FLAGS = --shell-escape -output-directory `pwd`/build
# BIBTEX = biber
all:
mkdir -p build
TEXINPUTS=$$TEXINPUTS $(LATEX) $(FLAGS) $(MAIN_LATEX)
cp build/$(PDF_TARGET) $(TARGET)
release:
mkdir -p build
TEXINPUTS=$$TEXINPUTS $(LATEX) $(FLAGS) $(MAIN_LATEX)
# $(BIBTEX) build/$(MAIN)
TEXINPUTS=$$TEXINPUTS $(LATEX) $(FLAGS) $(MAIN_LATEX)
cp build/$(PDF_TARGET) $(TARGET)
clean:
rm -rf build $(PDF_TARGET)
Resources
- LearnLaTex: Learn LaTex
- Detexify: Detect LaTex symbols
- Tex Stackoverflow: Write a LaTex package