Skip to content

Commit fde404b

Browse files
committed
Add automatic line breaking to output format documentation
1 parent 7496626 commit fde404b

File tree

4 files changed

+116
-8
lines changed

4 files changed

+116
-8
lines changed

docs/html/_sources/output.txt

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,49 @@ NativeMML output processor, you are making a trade-off: gaining speed
150150
at the expense of quality and reliability, a decision that should not
151151
be taken lightly.
152152

153+
.. _automatic-linebreaking:
154+
155+
Automatic Line Breaking
156+
=======================
157+
158+
The HTML-CSS and SVG output processors implement (most of) the MathML3
159+
automatic line-breaking specification. (The NativeMML output
160+
processor relies on the browser's native MathML support to handle line
161+
breaking when it is used.) Since line-breaking takes extra processing
162+
and so can slow down the mathematical output, it is off by default,
163+
but you can enable it by adding
164+
165+
.. code-block:: html
166+
167+
<script type="text/x-mathjax-config">
168+
MathJax.Hub.Config({
169+
"HTML-CSS": { linebreaks: { automatic: true } },
170+
SVG: { linebreaks: { automatic: true } }
171+
});
172+
</script>
173+
174+
to your page just before the ``<script>`` tag that loads
175+
``MathJax.js`` itself.
176+
177+
Note that line breaking only applies to displayed equations, not
178+
in-line equations (unless the in-line euqation is itself longer than a
179+
line), and that the line-breaks are only computed once when the
180+
equation is initially typeset, and do not change if the user changes
181+
the window size, or if the container changes size for some other
182+
reason.
183+
184+
You can control what width is used to determine where the line breaks
185+
shoud occur using the ``container`` parameter of the ``linebreaks``
186+
block. By default it is the width of the containing element, but you
187+
can make it a fixed width, or make it a percentage of the container.
188+
See the :ref:`HTML-CSS configuration <configure-HTML-CSS>` or
189+
:ref:`SVG configuration <configure-SVG>` pages for more details.
190+
153191

154192
.. _html-css-with-ie8:
155193

156-
HTML-CSS with IE8 and IE9
157-
=========================
194+
HTML-CSS with IE
195+
================
158196

159197
The performance of MathJax in Internet Explorer 8 and 9 has been
160198
substantially improved in version 2.0. The HTML-CSS output processing

docs/html/output.html

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,39 @@ <h2>Automatic Selection of the Output Processor<a class="headerlink" href="#auto
177177
at the expense of quality and reliability, a decision that should not
178178
be taken lightly.</p>
179179
</div>
180-
<div class="section" id="html-css-with-ie8-and-ie9">
181-
<span id="html-css-with-ie8"></span><h2>HTML-CSS with IE8 and IE9<a class="headerlink" href="#html-css-with-ie8-and-ie9" title="Permalink to this headline"></a></h2>
180+
<div class="section" id="automatic-line-breaking">
181+
<span id="automatic-linebreaking"></span><h2>Automatic Line Breaking<a class="headerlink" href="#automatic-line-breaking" title="Permalink to this headline"></a></h2>
182+
<p>The HTML-CSS and SVG output processors implement (most of) the MathML3
183+
automatic line-breaking specification. (The NativeMML output
184+
processor relies on the browser&#8217;s native MathML support to handle line
185+
breaking when it is used.) Since line-breaking takes extra processing
186+
and so can slow down the mathematical output, it is off by default,
187+
but you can enable it by adding</p>
188+
<div class="highlight-html"><div class="highlight"><pre><span class="nt">&lt;script </span><span class="na">type=</span><span class="s">&quot;text/x-mathjax-config&quot;</span><span class="nt">&gt;</span>
189+
<span class="nx">MathJax</span><span class="p">.</span><span class="nx">Hub</span><span class="p">.</span><span class="nx">Config</span><span class="p">({</span>
190+
<span class="s2">&quot;HTML-CSS&quot;</span><span class="o">:</span> <span class="p">{</span> <span class="nx">linebreaks</span><span class="o">:</span> <span class="p">{</span> <span class="nx">automatic</span><span class="o">:</span> <span class="kc">true</span> <span class="p">}</span> <span class="p">},</span>
191+
<span class="nx">SVG</span><span class="o">:</span> <span class="p">{</span> <span class="nx">linebreaks</span><span class="o">:</span> <span class="p">{</span> <span class="nx">automatic</span><span class="o">:</span> <span class="kc">true</span> <span class="p">}</span> <span class="p">}</span>
192+
<span class="p">});</span>
193+
<span class="nt">&lt;/script&gt;</span>
194+
</pre></div>
195+
</div>
196+
<p>to your page just before the <tt class="docutils literal"><span class="pre">&lt;script&gt;</span></tt> tag that loads
197+
<tt class="docutils literal"><span class="pre">MathJax.js</span></tt> itself.</p>
198+
<p>Note that line breaking only applies to displayed equations, not
199+
in-line equations (unless the in-line euqation is itself longer than a
200+
line), and that the line-breaks are only computed once when the
201+
equation is initially typeset, and do not change if the user changes
202+
the window size, or if the container changes size for some other
203+
reason.</p>
204+
<p>You can control what width is used to determine where the line breaks
205+
shoud occur using the <tt class="docutils literal"><span class="pre">container</span></tt> parameter of the <tt class="docutils literal"><span class="pre">linebreaks</span></tt>
206+
block. By default it is the width of the containing element, but you
207+
can make it a fixed width, or make it a percentage of the container.
208+
See the <a class="reference internal" href="options/HTML-CSS.html#configure-html-css"><em>HTML-CSS configuration</em></a> or
209+
<a class="reference internal" href="options/SVG.html#configure-svg"><em>SVG configuration</em></a> pages for more details.</p>
210+
</div>
211+
<div class="section" id="html-css-with-ie">
212+
<span id="html-css-with-ie8"></span><h2>HTML-CSS with IE<a class="headerlink" href="#html-css-with-ie" title="Permalink to this headline"></a></h2>
182213
<p>The performance of MathJax in Internet Explorer 8 and 9 has been
183214
substantially improved in version 2.0. The HTML-CSS output processing
184215
was redesigned to avoid the page reflows that were the main source of
@@ -235,7 +266,8 @@ <h3><a href="index.html">Table Of Contents</a></h3>
235266
<ul>
236267
<li><a class="reference internal" href="#">MathJax Output Formats</a><ul>
237268
<li><a class="reference internal" href="#automatic-selection-of-the-output-processor">Automatic Selection of the Output Processor</a></li>
238-
<li><a class="reference internal" href="#html-css-with-ie8-and-ie9">HTML-CSS with IE8 and IE9</a></li>
269+
<li><a class="reference internal" href="#automatic-line-breaking">Automatic Line Breaking</a></li>
270+
<li><a class="reference internal" href="#html-css-with-ie">HTML-CSS with IE</a></li>
239271
<li><a class="reference internal" href="#html-css-extensions">HTML-CSS Extensions</a></li>
240272
</ul>
241273
</li>

docs/html/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/source/output.rst

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,49 @@ NativeMML output processor, you are making a trade-off: gaining speed
150150
at the expense of quality and reliability, a decision that should not
151151
be taken lightly.
152152

153+
.. _automatic-linebreaking:
154+
155+
Automatic Line Breaking
156+
=======================
157+
158+
The HTML-CSS and SVG output processors implement (most of) the MathML3
159+
automatic line-breaking specification. (The NativeMML output
160+
processor relies on the browser's native MathML support to handle line
161+
breaking when it is used.) Since line-breaking takes extra processing
162+
and so can slow down the mathematical output, it is off by default,
163+
but you can enable it by adding
164+
165+
.. code-block:: html
166+
167+
<script type="text/x-mathjax-config">
168+
MathJax.Hub.Config({
169+
"HTML-CSS": { linebreaks: { automatic: true } },
170+
SVG: { linebreaks: { automatic: true } }
171+
});
172+
</script>
173+
174+
to your page just before the ``<script>`` tag that loads
175+
``MathJax.js`` itself.
176+
177+
Note that line breaking only applies to displayed equations, not
178+
in-line equations (unless the in-line euqation is itself longer than a
179+
line), and that the line-breaks are only computed once when the
180+
equation is initially typeset, and do not change if the user changes
181+
the window size, or if the container changes size for some other
182+
reason.
183+
184+
You can control what width is used to determine where the line breaks
185+
shoud occur using the ``container`` parameter of the ``linebreaks``
186+
block. By default it is the width of the containing element, but you
187+
can make it a fixed width, or make it a percentage of the container.
188+
See the :ref:`HTML-CSS configuration <configure-HTML-CSS>` or
189+
:ref:`SVG configuration <configure-SVG>` pages for more details.
190+
153191

154192
.. _html-css-with-ie8:
155193

156-
HTML-CSS with IE8 and IE9
157-
=========================
194+
HTML-CSS with IE
195+
================
158196

159197
The performance of MathJax in Internet Explorer 8 and 9 has been
160198
substantially improved in version 2.0. The HTML-CSS output processing

0 commit comments

Comments
 (0)