Skip to content

Commit

Permalink
Merge pull request #299 from ysulyma/master
Browse files Browse the repository at this point in the history
Document \data command
  • Loading branch information
dpvc authored Jul 6, 2023
2 parents 4ae63b1 + 790d5db commit c08ea76
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion input/tex/extensions/autoload.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ The default autoload definitions are the following:
enclose: ['enclose'],
extpfeil: ['xtwoheadrightarrow', 'xtwoheadleftarrow', 'xmapsto',
'xlongequal', 'xtofrom', 'Newextarrow'],
html: ['href', 'class', 'style', 'cssId'],
html: ['data', 'href', 'class', 'style', 'cssId'],
mhchem: ['ce', 'pu'],
newcommand: ['newcommand', 'renewcommand', 'newenvironment', 'renewenvironment', 'def', 'let'],
unicode: ['unicode'],
Expand Down
10 changes: 8 additions & 2 deletions input/tex/extensions/html.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ html
####

The `html` extension gives you access to some HTML features like
styles, classes, element ID's, and clickable links. It defines the
styles, classes, element ID's, data-* attributes, and clickable links. It defines the
following non-standard macros:

.. describe:: \\href{url}{math}
Expand Down Expand Up @@ -37,6 +37,10 @@ following non-standard macros:
Adds the give ``css`` declarations to the element associated with
``math``.

.. describe:: \\data{dataset}{math}

Adds `data-* <https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/data-*>`__ attributes to the element associated with ``math``.

For example:

.. code-block:: latex
Expand All @@ -47,6 +51,8 @@ For example:

(x+1)^2 = \cssId{step1}{\style{visibility:hidden}{(x+1)(x+1)}}

x = \data{during=quadratic}{\frac{-b\pm\sqrt{b^2-4ac}}{2a}}

.. Note::

For the ``\href`` macro, the `url` parameter is not processed
Expand Down Expand Up @@ -81,7 +87,7 @@ html Commands
-------------

The `html` extension implements the following macros:
``\class``, ``\cssId``, ``\href``, ``\style``
``\class``, ``\cssId``, ``\data``, ``\href``, ``\style``


|-----|
3 changes: 2 additions & 1 deletion input/tex/extensions/textmacros.rst
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ HTML Commands
-------------

.. list-table::

* - ``\data``
- specify data-* attributes
* - ``\href``
- make hyperlink
* - ``\style``
Expand Down
2 changes: 2 additions & 0 deletions input/tex/macros/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,8 @@ D
- **ams**
* - ``\dashv``
-
* - ``\data``
- **html**
* - ``\dbinom``
- **ams**
* - ``\dblcolon``
Expand Down

0 comments on commit c08ea76

Please sign in to comment.