Easy LaTeX rendering for Django.
Project description
django-latexify let’s you easily render text and math equations from your template to look like LaTeX. The app lets you render math equations written in LaTeX on your HTML, or even just regular plain text.
It uses Katex (a fast, easy-to-use JavaScript library for TeX math rendering on the web) for rending math equations and a modification of WiTex (LaTeX like CSS) for rending plain text.
installation
python setup.py install
Quick start
Add “latexify” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = ( ... 'latexify', ... )
In your template, load latexify by including:
{% load latexify %}
In the HTML header of your template, include:
{% include 'latexify/stylesheets.html' %}
In the bottom of your HTML body, include the following to load the JS associated with latexify:
{% include "latexify/scripts.html" %}
Latexify your text by including the template tag, for example
{% latexify context_arg %} {% latexify context_arg parse_math=True %} {% latexify 'c = \pm\sqrt{a^2 + b^2}' math_inline=True %} {% latexify 'c = \pm\sqrt{a^2 + b^2}' math_block=True %}
Which will give you the following:
In your HTML, be sure to include this before the <html> tag.
<!DOCTYPE html>
Contributing
Fork it!
Create your feature branch: git checkout -b my-new-feature
Commit your changes: git commit -am ‘Add some feature’
Push to the branch: git push origin my-new-feature
Submit a pull request :D
License
All parts of django-latexify are free to use and abuse under the open-source MIT license.
Change Log
Version 0.2:
Support python3.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-latexify-0.3.tar.gz
.
File metadata
- Download URL: django-latexify-0.3.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dbd52e8a7a4844e01536b7f617fac0f6e8a411bb7a1ed9ba24dd0b7e63ce427 |
|
MD5 | 9a6fabf758232fd4269e9f9ab8acb357 |
|
BLAKE2b-256 | fe516556fcf531ce8cb67031770df1116fc733f8ec504c4e7c75db3875b20579 |
File details
Details for the file django_latexify-0.3-py3-none-any.whl
.
File metadata
- Download URL: django_latexify-0.3-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfc62937b3e9aee71a5bc854359793c9a82790a799d5b85b9cf35dd23a1ab7c9 |
|
MD5 | 256f4a0b6a35df5d8cc899a1ee7a6f14 |
|
BLAKE2b-256 | 8fe41bda0b4974721b663b991ec6f6fff0dcea1fbf359eae5b36c07e84ee4c95 |