UnitfulLatexify.jl

Author gustaphe
Popularity
10 Stars
Updated Last
2 Years Ago
Started In
January 2021

UnitfulLatexify

Code Style: Blue

Adds Latexify recipes for Unitful units and quantities.

Because Github doesn't display \\LaTeX strings very well, I recommend reading the documentation instead of the README.

Installation

] add UnitfulLatexify

Usage

julia> using Unitful, Latexify, UnitfulLatexify;

julia> q = 612.2u"nm";

julia> u = u"kg*m/s^2";

julia> latexify(q)
L"$612.2\;\mathrm{nm}$"

julia> latexify(q,unitformat=:siunitx)
L"\SI{612.2}{\nano\meter}"

julia> latexify(u,unitformat=:mathrm) # explicit default
L"$\mathrm{kg}\,\mathrm{m}\,\mathrm{s}^{-2}$"

julia> latexify(u,unitformat=:siunitx)
L"\si{\kilo\gram\meter\per\second\tothe{2}}"

Results

Results

Used By Packages