skip to Main Content

I want to write a simple line as below in my Sphinx reST document:
enter image description here

To write the line using :math: flag:

We know that :math:`A to B vdash A to forall x B`, provided that :math:`x` is not free in :math:`A`.

The appearance shown in browser after make html:

enter image description here

How can make it a one line without line break?
I want to tune the line with restructuredtext grammar to get the desired appearnce ,instead of tune the html or css code.

I have installed Furo as my default theme, try to write logic formula :

math formula
===================
p1:

We know that :math:`A to B vdash A to forall x B`, provided that :math:`x` is not free in :math:`A`.


p2:

.. raw:: html

   <!DOCTYPE html>
   <html>
   <head>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width">
     <title>MathJax example</title>
   <script type="text/javascript" async
     src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML">
   </script>
   <script type="text/x-mathjax-config">
   MathJax.Hub.Config({
     tex2jax: {inlineMath: [['$','$'], ['\(','\)']]},
   });
   </script>
   </head>
   <body>
   We know that `A to B vdash A to forall x B`, provided that `x` is not free in `A`.
   </body>
   </html>

The appearance:

enter image description here

If i delete the p2 part,all multipe math equations inline can’t be on a single line shown in my browser:

enter image description here

How can fix it then?

2

Answers


  1. Chosen as BEST ANSWER

    Upgrade my sphinx to the latest version-8,inline math words do not have a break line.


  2. Whether you like it or not, the result of make html is HTML and CSS so the rendering will be fully controlled by the rules.

    Your snippet in reStructuredText is compiled to the following HTML elements,

    <p>We know that <span class="math notranslate nohighlight">(A to B vdash A to forall x B)</span>, provided that <span class="math notranslate nohighlight">(x)</span> is not free in <span class="math notranslate nohighlight">(A)</span>.</p>
    

    So, when I use the Furo theme to test, the preview looks like this,

    enter image description here

    You see something differently, probably because the theme you chose aligns elements another way.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search