How do I enable / install tikz
package for drawing graphs ?
#2431
-
Beta Was this translation helpful? Give feedback.
Answered by
jonatanklosko
Jan 13, 2024
Replies: 1 comment
-
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,0)--(-1,-1) node[anchor=north east]{$\boldsymbol{-u}$};
\end{tikzpicture}
\end{document}
""",
:tikz
) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
gourav
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: