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