Git Product home page Git Product logo

django-latexify's Introduction

django-latexify

Latest PyPI version Build Status - master branch coveralls quality Python 2 support Python 3 support maintain website Software license

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

  1. Add "latexify" to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = (
        ...
        'latexify',
        ...
    )
  2. In your template, load latexify by including:

    {% load latexify %}
    
  3. In the HTML header of your template, include:

    {% include 'latexify/stylesheets.html' %}
    
  4. In the bottom of your HTML body, include the following to load the JS associated with latexify:

    {% include "latexify/scripts.html" %}
    
  5. 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:

example

  1. In you're HTML, be sure to include this before the <html> tag.

    <!DOCTYPE html>

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. 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.

django-latexify's People

Contributors

ammsa avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.