Skip to content

Commit 06db7fc

Browse files
committed
Update tagformat to include changes from update/4.0-tagformat branch
1 parent 3a2cecc commit 06db7fc

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

input/tex/extensions/tagformat.rst

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ with the following values:
3636
.. code-block:: javascript
3737
3838
tagformat: {
39-
number: (n) => n.toString(),
40-
tag: (tag) => '(' + tag + ')',
41-
ref: '', // means use the tag function
42-
id: (id) => 'mjx-eqn:' + id.replace(/\s/g, '_'),
43-
url: (id, base) => base + '#' + encodeURIComponent(id),
44-
}
39+
number: (n) => n.toString(),
40+
tag: (tag) => '(' + tag + ')',
41+
ref: '', // means use the tag function
42+
id: (id) => 'mjx-eqn:' + id.replace(/\s/g, '_'),
43+
url: (id, base) => base + '#' + encodeURIComponent(id),
44+
}
4545
4646
.. describe:: number: (n) => n.toString()
4747

@@ -94,9 +94,9 @@ automatic equation numbers generated when the ``tags`` option in the
9494
tex: {
9595
tags: 'ams',
9696
tagformat: {
97-
number: (n) => MathJax.config.section + '.' + n,
97+
number: (n) => MathJax.config.section + '.' + n,
9898
id: (tag) => 'eqn-id:' + tag
99-
},
99+
},
100100
packages: {'[+]': ['tagformat']}
101101
},
102102
loader: {load: ['[tex]/tagformat']},
@@ -143,7 +143,7 @@ possibility:
143143
nextSection: 'NextSection',
144144
setSection: 'SetSection',
145145
}, {
146-
NextSection(parser, name) {
146+
NextSection(parser, _name) {
147147
MathJax.config.section++;
148148
parser.tags.counter = parser.tags.allCounter = 0;
149149
},
@@ -161,7 +161,13 @@ possibility:
161161
};
162162
163163
Of course, you will want to merge this configuration in with the rest
164-
of your configuration options.
164+
of your configuration options. You also will need to load the new
165+
``sections`` configuration by adding it to your package list loaded
166+
into the TeX input jax.
167+
168+
.. code-block:: javascript
169+
170+
{packages: {'[+]': ['tagformat', 'sections']}}
165171
166172
.. warning::
167173

0 commit comments

Comments
 (0)