All Projects → korsbo → Latexify.jl

korsbo / Latexify.jl

Licence: mit
Convert julia objects to LaTeX equations, arrays or other environments.

Programming Languages

julia
2034 projects

Labels

Projects that are alternatives of or similar to Latexify.jl

cmake-cheatsheet
CMake Cheat Sheet
Stars: ✭ 37 (-87.02%)
Mutual labels:  latex
Num-Plus-Plus
A scientific & intutive calculator written in Flutter.
Stars: ✭ 62 (-78.25%)
Mutual labels:  latex
Docx2tex
Converts Microsoft Word docx to LaTeX
Stars: ✭ 271 (-4.91%)
Mutual labels:  latex
sympy-paper
Repo for the paper "SymPy: symbolic computing in python"
Stars: ✭ 42 (-85.26%)
Mutual labels:  latex
cryptography
Cryptography course slides at Harbin Institute of Technology
Stars: ✭ 86 (-69.82%)
Mutual labels:  latex
acro
acronyms for LaTeX 2e
Stars: ✭ 22 (-92.28%)
Mutual labels:  latex
ntuthesis
台大碩博士論文模板 (R Package)
Stars: ✭ 14 (-95.09%)
Mutual labels:  latex
Thuthesis
LaTeX Thesis Template for Tsinghua University
Stars: ✭ 3,272 (+1048.07%)
Mutual labels:  latex
stargazer
Python implementation of the R stargazer multiple regression model creation tool
Stars: ✭ 102 (-64.21%)
Mutual labels:  latex
Mak
A universal notepad. (WIP)
Stars: ✭ 270 (-5.26%)
Mutual labels:  latex
Fluentmark
FluentMark -- Eclipse editor for Markdown content
Stars: ✭ 29 (-89.82%)
Mutual labels:  latex
xelatex-guide-book
xelatex book template
Stars: ✭ 59 (-79.3%)
Mutual labels:  latex
Focus Beamertheme
Focus: a minimalist presentation theme for LaTeX Beamer.
Stars: ✭ 263 (-7.72%)
Mutual labels:  latex
wizpen
A font based on the Pigpen cipher, originally used to help liberate Wraxnia from the Fangs in a D&D campaign. Works in LaTeX.
Stars: ✭ 15 (-94.74%)
Mutual labels:  latex
Huxtable
An R package to create styled tables in multiple output formats, with a friendly, modern interface.
Stars: ✭ 277 (-2.81%)
Mutual labels:  latex
latex-emoji
Emoji support in (Lua)LaTeX
Stars: ✭ 32 (-88.77%)
Mutual labels:  latex
learning-notes
My learning notes.
Stars: ✭ 20 (-92.98%)
Mutual labels:  latex
Begin Latex In Minutes
📜 Brief Intro to LaTeX for beginners that helps you use LaTeX with ease.
Stars: ✭ 3,082 (+981.4%)
Mutual labels:  latex
Paper Tips And Tricks
Best practice and tips & tricks to write scientific papers in LaTeX, with figures generated in Python or Matlab.
Stars: ✭ 3,099 (+987.37%)
Mutual labels:  latex
Angourimath
Open-source symbolic algebra library for C# and F#. One of the most powerful in .NET
Stars: ✭ 266 (-6.67%)
Mutual labels:  latex

Build Status Build status codecov Coverage Status

Latexify.jl

This is a package for generating LaTeX maths from julia objects.

This package utilises Julias homoiconicity to convert expressions to LaTeX-formatted strings. Latexify.jl supplies functionalities for converting a range of different Julia objects, including:

  • Expressions,
  • Strings,
  • Numbers (including rationals and complex),
  • Symbolic expressions from SymEngine.jl,
  • ParameterizedFunctions and ReactionNetworks from DifferentialEquations.jl

as well as arrays or dicts of supported types.

Examples

latexifying expressions

using Latexify
ex = :(x/(y+x)^2)
latexify(ex)

This generates a LaTeXString (from LaTeXStrings.jl) which, when printed looks like:

$\frac{x}{\left( y + x \right)^{2}}$

And when this LaTeXString is displayed in an environment which supports the tex/latex MIME type (Jupyter notebooks, Jupyterlab and Hydrogen for Atom) it will automatically render as:

fraction

latexifying other things

Latexify.jl is equipped to convert a whole range of types to latex formatted maths. This includes primitive types such as Symbols and Complex, but also of containers such as Arrays and Dicts.

using Latexify
print(latexify("x+y/(b-2)^2"))

outputs:

$x + \frac{y}{\left( b - 2 \right)^{2}}$
arr = ["x/y" 3//7 2+3im; 1 :P_x :(gamma(3))]
latexify(arr)

matrix

The GitHub website does not really support rendering of equations in the README file, so I therefore refer you to the documentation for more info/examples.

Use with DifferentialEquations.jl

The DifferentialEquations.jl suite has some nifty tools for generating differential equations. One of them is ParameterizedFunctions which allows you to type in an ODE in something which looks very much like just plain mathematics. The ability to latexify such ODEs is pretty much what lured me to create this package.

using ParameterizedFunctions
using Latexify

f = @ode_def positiveFeedback begin
    dx = v*y^n/(k^n+y^n) - x
    dy = x/(k_2+x) - y
end v n k k_2

latexify(f)

outputs:

positiveFeedback

DiffEqBiological.jl provides another cool domain-specific language which allows you to generate equations using a chemical arrow notation.

using DiffEqBiological
using Latexify

rn = @reaction_network demoNetwork begin
  (r_bind, r_unbind), A + B  C
  Hill(C, v, k, n), 0 --> X
  d_x, X --> 0
end r_bind r_unbind v k n d_x

latexify(rn)

positiveFeedback

Or you can output the arrow notation directly to latex:

latexify(rn; env=:arrow)

positiveFeedback

There are more stuff that you can do, but for that I will refer you to the docs.

Convenience functions

  • copy_to_clipboard(::Bool), toggle automatic copying of the resulting LaTeX code to the clipboard (default is false).
  • auto_display(::Bool) toggles automatic display of your output, even if it is not the last command to have run.
  • set_default(; kwargs...), set your own default kwargs for your Julia session. This is not to be used within a package since the effect is global.
  • reset_default(; kwargs...), reset the changes you made with the above command.
  • get_default(; kwargs...), view the changes you have made to the default kwargs.

Installation

This package is registered with METADATA.jl, so to install it you can just run

Pkg.add("Latexify")

Further information

For further information see the docs.

Contributing

I would be happy to receive feedback, suggestions, and help with improving this package. Please feel free to open an issue or a PR.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].