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 7557917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:15:27+00:00 2026-05-30T12:15:27+00:00

I am using Sphinx to write some notes. I am using the Mathjax extension

  • 0

I am using Sphinx to write some notes. I am using the Mathjax extension for Math in the notes. The default size of the math is little larger than I would like. On the Mathjax page I found that I can change that size by adding the following script to the HTML file.

MathJax.Hub.Config({
  "HTML-CSS": {scale: 90}
});

So, I tried by adding the following in a .rst file:

.. raw:: html

    <script type="text/javascript" >
        MathJax.Hub.Config({
            "HTML-CSS": {
                scale: 90
            }
        });
    </script>

==========
Objective
==========

To change math size \\( \\alpha \\).

The above works great for the math in that specific .rst file. But I want to do this for many different .rst files that are all part of the same sphinx document. Is it possible to do this without adding the above script to every .rst file?

Thank you for reading this and would appreciate if you can help.

  • 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-05-30T12:15:28+00:00Added an answer on May 30, 2026 at 12:15 pm

    This can be done with a template:

    1. Create a folder called templates in the Sphinx project directory.

    2. In conf.py, add

      templates_path = ["templates"]
      
    3. In the templates directory, create a file called layout.html with the following contents:

      {% extends "!layout.html" %}
      
      {%- block extrahead %} 
       <script type="text/javascript">
             MathJax.Hub.Config({
                 "HTML-CSS": {
                     scale: 90
                 }
             });
        </script>      
      {% endblock %}
      

    The <script> element will be included in the <head> of every generated HTML page.

    The extrahead template block is empty by default. See the Sphinx templating documentation for details.

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

Sidebar

Related Questions

I'm using the Sphinx autodoc extension to document a module, and I'd like to
I'm using sphinx to list me some items from my database here. It's almost
I'm using Thinking Sphinx for full-text search, following this video . I'd like to
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Started using thinking sphinx today and I'd like to know what's going wrong here:
I'm using Sphinx and the autodoc extension to generate API documentation for my Python
I'm using Sphinx for some software documentation because it seems to work really well...
How can I get all the records from the index using Sphinx? Just like
I'm using the SPH_MATCH_EXTENDED2 match mode with Sphinx 0.9.9 and I want to write
I would like to write a documentation for one of my Django based project.

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.