Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9133323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:28:06+00:00 2026-06-17T08:28:06+00:00

I am using Django template restructuredtext filter to display an rst file in my

  • 0

I am using Django template restructuredtext filter to display an rst file in my template.
I have docutils installed, and have added django.contrib.markup to settings.py. Displaying rst text works fine.

Now, I want to add some math to the rst file:

test.rst:

.. math::
    16 \div 2

The equation is :math:`16 \div 2`.

Update:: I fixed this partially. Initially, the errors were Unknown directive. I was trying to add math directives to the template, but then realized that docutils 0.10 supports math directives by default. Hence just upgraded to docutils-0.10.

However, now what I see is:

\begin{equation*} 16 \div 2 \end{equation*}
The equation is \(16 \div 2\)

The the rst file works fine if I do rst2html and check it in the browser. The difference is that the html file loads MathJax javascript while Django template does not add the js file.

So I am guessing that some setting or config is missing…

Would really appreciate a helping hand here!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:28:07+00:00Added an answer on June 17, 2026 at 8:28 am

    Fixed this with 2 things:

    1. Initial errors were Unknown directive. I was trying to add math directives to the template to load latex, but then realized that docutils 0.10 supports math directives by default. Hence just upgraded to docutils-0.10.

    2. After that the error was that I was seeing the latex math code enclosed in \begin{equation*} and \end{equation*} tags. Comparing the output of rst2html and django template filter, I realized that the MathJax javascript needed to do latex is not added by django restructuredtext filter. So, in my template file section, I manually added:

      <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

    Now, it works!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem using css in my django template, In my settings.py i
How can I achieve this using the Django template system: Say I have 2
I'm using Django 1.4 with Python 2.7 on Ubuntu 12.04. I have a template
In my django template I have some Event items listed using a for loop.The
Im using Django 1.3.1.In my django code, i have the following template for the
I am using Django's Template Fragment Caching so in a template.html file {% extends
I've got a problem with using django's {% trans %} template function. I have
So I'm using django and I have a page/template that looks like (simplified to
I am using django-easy-maps to display maps on a my page and i have
In Django template language I can display a time with microseconds using : {{

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.