This library is used to render LaTex Math equations, based on the jLateXMath library, and applying them incanter.charts as annotations and subtitles.
This library is used to render LaTex Math equations, based on the jLateXMath library, and applying them incanter.charts as annotations and subtitles.
(add-latex chart
x
y
latex-str
&
{:keys [color] :or {color java.awt.Color/darkGray}})
Adds an LaTeX equation annotation to the chart at the given x,y coordinates.
Arguments: chart -- the chart to add the polygon to. x, y -- the coordinates to place the image latex-str -- a string of latex code
Options: :color (default java.awt.Color/darkGray) -- the text color
Examples: (use '(incanter core charts stats latex))
(doto (function-plot pdf-normal -3 3)
(add-latex 0 0.1 "f(x)=\\frac{1}{\\sqrt{2\\pi \\sigma^2}} e^{\\frac{-(x - \\mu)^2}{2 \\sigma^2}}")
view)
Adds an LaTeX equation annotation to the chart at the given x,y coordinates. Arguments: chart -- the chart to add the polygon to. x, y -- the coordinates to place the image latex-str -- a string of latex code Options: :color (default java.awt.Color/darkGray) -- the text color Examples: (use '(incanter core charts stats latex)) (doto (function-plot pdf-normal -3 3) (add-latex 0 0.1 "f(x)=\\frac{1}{\\sqrt{2\\pi \\sigma^2}} e^{\\frac{-(x - \\mu)^2}{2 \\sigma^2}}") view)
(add-latex-subtitle chart
latex-str
&
{:keys [color] :or {color java.awt.Color/darkGray}})
Adds the given LaTeX equation as a subtitle to the chart.
Options: :color (default java.awt.Color/darkGray) -- the text color
Examples: (use '(incanter core charts stats latex))
(doto (function-plot pdf-normal -3 3) (add-latex-subtitle "f(x)=\frac{1}{\sqrt{2\pi \sigma^2}} e^{\frac{-(x - \mu)^2}{2 \sigma^2}}") view)
Adds the given LaTeX equation as a subtitle to the chart. Options: :color (default java.awt.Color/darkGray) -- the text color Examples: (use '(incanter core charts stats latex)) (doto (function-plot pdf-normal -3 3) (add-latex-subtitle "f(x)=\\frac{1}{\\sqrt{2\\pi \\sigma^2}} e^{\\frac{-(x - \\mu)^2}{2 \\sigma^2}}") view)
(latex latex-txt
&
{:keys [color background border]
:or {color java.awt.Color/black
background java.awt.Color/white
border [5 5 5 5]}})
Returns the given LaTeX equation rendered as an java.awt.Image.
Options: :color (default java.awt.Color/black) -- the text color :background (default java.awt.Clolor/white) -- the background color :border (default [5 5 5 5]) -- image border
Examples: (use '(incanter io core charts stats latex))
(def latex-img (latex "\frac{(a+b)^2} {(a-b)^2}")) (save latex-img "/tmp/latex-example1.png") (view "file:///tmp/latex-example1.png")
(view (latex "f(x)=\frac {1} {\sqrt {2\pi \sigma ^2}} e^{\frac {-(x - \mu)^2}{2 \sigma ^2}}"))
(view (latex "\begin{pmatrix} a & b & c \\ d & e & f \\ g & h & i \end{pmatrix}"))
Returns the given LaTeX equation rendered as an java.awt.Image. Options: :color (default java.awt.Color/black) -- the text color :background (default java.awt.Clolor/white) -- the background color :border (default [5 5 5 5]) -- image border Examples: (use '(incanter io core charts stats latex)) (def latex-img (latex "\\frac{(a+b)^2} {(a-b)^2}")) (save latex-img "/tmp/latex-example1.png") (view "file:///tmp/latex-example1.png") (view (latex "f(x)=\\frac {1} {\\sqrt {2\\pi \\sigma ^2}} e^{\\frac {-(x - \\mu)^2}{2 \\sigma ^2}}")) (view (latex "\\begin{pmatrix} a & b & c \\\\ d & e & f \\\\ g & h & i \\end{pmatrix}"))
(to-latex mx
&
{:keys [mxtype preamble col-just row-names-tex-cmd hline table-newline
table-newline-suppress-last newline]
:or {mxtype "pmatrix"
preamble ""
col-just []
row-names-tex-cmd [""]
hline false
table-newline "\\\\"
table-newline-suppress-last false
newline ""}})
Convert an Incanter Matrix into a string of LaTeX commands to render it.
Options: :mxtype (default pmatrix) -- the type of matrix to output, see LaTeX documentation for other options. Example: (use '(incanter core latex)) (view (latex (to-latex (matrix [[1 0][0 1]]))))
Convert an Incanter Matrix into a string of LaTeX commands to render it. Options: :mxtype (default pmatrix) -- the type of matrix to output, see LaTeX documentation for other options. Example: (use '(incanter core latex)) (view (latex (to-latex (matrix [[1 0][0 1]]))))
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close