Skip to content

How do I enable / install tikz package for drawing graphs ? #2431

Answered by jonatanklosko
gourav asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @gourav, Livebook uses Markdown not LaTeX, other than TeX-style equations, but without any external packages. However, there is a service called Kroki for rendering diagrams in various formats and there is a Livebook integration, so you could do this:

# (setup cell)
Mix.install([
  {:kino_kroki, "~> 0.1.0"}
])
Kino.Kroki.new(
  ~S"""
  \usepackage{tikz}
  \usepackage{amsmath}
  \begin{document}
  \begin{tikzpicture}
    \draw[thin,gray!40] (-2,-2) grid (2,2);
    \draw[<->] (-2,0)--(2,0) node[right]{$x$};
    \draw[<->] (0,-2)--(0,2) node[above]{$y$};
    \draw[line width=2pt,blue,-stealth](0,0)--(1,1) node[anchor=south west]{$\boldsymbol{u}$};
    \draw[line width=2pt,red,-stealth](0…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gourav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants