LaTex

description: About LaTex

lang: ENG

Installation of latex and minted on Ubuntu

 sudo apt install texlive texlive-latex-extra texlive-lang-french texmaker
 sudo apt install  python3-pygments
 pdflatex -shell-escape -synctex=1 -interaction=nonstopmode %.tex
  \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

  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