Mathjax3 causing bootstrap columns to become overwhelmed

Currently, I am utilizing MathJax3 in conjunction with Bootstrap4. It seems that the feature of automatic line breaking has not yet been incorporated into MathJax3.

The code snippet below showcases a layout consisting of 3 columns: a left spacing column, a central column containing the latex equation, and a right column displaying some text.

<html lang="en">
  <head>
    <!-- Bootstrap -->
    <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet">
    
    <!-- MathJax3 -->
    <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
    <script>
    MathJax = {
      tex: {
        inlineMath: [['$', '$'], ['\\(', '\\)']],
        tags: 'ams'
      }
    };
    </script>
  </head>
  
  
  <body>
    <div class="row">
        <div class="col-sm-3"></div>
        <div class="col-sm-6">
            A lengthy mathjax equation:
            
            \begin{equation}
                y = 2^x + 6x + 9x + 2^x + 6x + 9x + 2^x + 6x + 9x 
                2^x + 6x + 9x + 2^x + 6x + 9x + 2^x + 6x + 9x + 
                2^x + 6x + 9x + 2^x + 6x + 9x + 2^x + 6x + 9x + 
            \end{equation>
        </div>
        <div class="col-sm-3">
            Additional text: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
        </div>
    </div>
    
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
  </body>
</html>

Upon rendering, the image displayed clearly demonstrates how the mathjax equation overflows the designated central column. My objective is to have the right column move below the equation if overflow occurs, similar to how it would behave on a screen smaller than sm. Is there a workaround to achieve this? https://i.sstatic.net/BOmlE.png

Answer №1

To achieve your desired outcome, simply swap out the col-sm-6 class in the MathJax column with col

Take a look here: https://example.com/example-link

By adding overflow-x: scroll to the CSS of the column containing MathJax, you can prevent overflow issues.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Verifying the current password and updating the hashed password

I have been struggling with creating a PHP script for updating user hashed passwords. Unfortunately, the script is not functioning as expected and no error messages are being displayed. Every time, it only shows "Your old password is incorrect" message. I ...

What is the best way to navigate to the href link?

After attempting to use driver.find_element_by_id // link_text // partial link text without success, I'm wondering what method I should be using to access this href. Currently encountering a No Such Element Exception. Any assistance would be greatly a ...

Passing $index variable from a bootstrap modal window does not work in AngularJS

I'm running into a wall here. My issue involves using ng-repeat to populate a table with two buttons in each row - one for updating the row content and another for uploading files. The upload button triggers a bootstrap modal window where users can se ...

Include a carbon copy when generating a script for an email

I am working on a form that sends emails, and I need to include a cc email address in the recipient list. Can someone guide me on how to modify the line below to achieve this? Thank you. mail("<a href="/cdn-cgi/l/email-protection" class="__cf_email__ ...

When there is no visible content on the mobile website, it starts scrolling horizontally to the right

Why is the website scrolling to the right when there is no content there? This issue seems to only occur on actual mobile devices when I try to recreate it. Currently in the process of transferring it over, which is why the link appears as it does. Any ...

Discover the perfect technique to employ insertString for effortlessly adding a new line onto a JEditorPane integrated with HTML functionality

Is there a difference between executing this code: conversationPane.setText(msg + conversationPane.getText()); and this code? conversationPane.setText(conversationPane.getText() + msg); I noticed that the second line does not display the message, but I ...

Execute AngularJS code when a button is clickeddoubleValue

I am in the process of developing a dynamic page where users can add anywhere from 1 to n products effortlessly. Although I have been exploring AngularJS for several months, I find myself facing some challenges when conceptualizing this scenario. The HTM ...

Scroll horizontally within each row

I am attempting to create a table with individual horizontal scrolling for each row, dynamically. Currently, my code only allows the entire table to scroll horizontally, not the individual rows. https://i.sstatic.net/3oaPl.jpg <table class="table-mai ...

Tips for creating two columns within a Bootstrap row, one with a form and the other with an image, that are both the same height and responsive

I am facing an issue with my bootstrap columns. One column has a form, while the other contains an image. The image section is set to 100% width, making it responsive when the screen size changes. However, the form remains at a fixed height regardless of t ...

The visibility of a CSS class is rendered non-apparent when formed through the implementation

function retrieve_files(){ $.ajax({ type: "GET", url: "retrieve_files.php", cache: false, success: function(result){ $("#insideT").html(result); } }); } retrieve_files.php $dir = 'upload ...

analyze and respond to inquiries

Imagine there is a question titled Q1 with four radio answer options: Q1: a) b) c) d) If you were using Python, what steps would you take to locate the question, choose one of the answers, and then submit the webpage? ...

What is the best way to increase the size of an image within a card and minimize the amount of white space

I have a card featuring an image, accompanied by a banner placed next to it. To structure this layout, I am using col-lg-8 for the card and col-lg-4 for the banner. However, I'm facing an issue with excessive white space between the card (which has a ...

How to incorporate a JavaScript file into a Handlebars template

I am having trouble receiving calls to my JavaScript file. What could be the issue? Using MVC. Here is the code in view file, file.hbs: <div class="container"> <h2 onClick="test()">Title</h2> {{>list}} </div> <script sr ...

React Native - A button positioned with a lower zIndex will always be displayed on top of a view with a higher

I am facing an interesting scenario where a button with zIndex: 5 is positioned on top of an Interactable.View with zIndex: 19. EDIT: Although the button appears to be on top, it is visible but not responsive (lack of tap functionality). Below is the cod ...

Modifying color scheme in ASP.NET web application's table

Although I'm not very familiar with this, I'll try to help out. I have an ASP.Net MVC web app in Visual Studio where one of my views, called View Details, contains a table that displays colors based on a specific scale. This scale consists of onl ...

Navigation Menu in Motion

I'm currently working on a website for my F1 in Schools team and I'm looking to implement a feature where the button in the navigation bar changes its background color and font color when that section of the page is active, even while scrolling o ...

Sequence of background colors not altering as intended

After clicking a button, I included the following jQuery code in a code snippet on my WordPress site: jQuery("#cf_course_planner tr").css("background-color", "#f66"); jQuery("#cf_course_planner tr:eq(0)").css(& ...

How to center elements vertically within a div using CSS

I am trying to align the contents vertically in a div, but the first div does not seem to be centered like the second one. I need both of them, along with their children, to be vertically centered inside the div. For example: [type='file'] { b ...

Emails can be sent through a form without the need for refreshing

I am currently working on a webpage that utilizes parallax scrolling, and the contact box is located in the last section. However, I encountered an issue where using a simple HTML + PHP contact box would cause the page to refresh back to the first section ...

When generating a PDF with TCPDF, the alignment of the table header and body on the second page is not matching up

I am struggling to create an invoice using TCPDF that includes a dynamic table based on the size of the items. Everything works perfectly until the table's size exceeds the first page. On the second page, the table header shifts to the left, causing m ...