From 1949f918e8be5e3668313d01bfc366b1d312998f Mon Sep 17 00:00:00 2001 From: Yuri Sulyma <> Date: Mon, 28 Mar 2022 01:15:26 -0400 Subject: [PATCH 1/2] Document \data command --- input/tex/extensions/autoload.rst | 2 +- input/tex/extensions/html.rst | 10 ++++++++-- input/tex/extensions/textmacros.rst | 3 ++- input/tex/macros/index.rst | 2 ++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/input/tex/extensions/autoload.rst b/input/tex/extensions/autoload.rst index 9d2f28a..d7efef9 100644 --- a/input/tex/extensions/autoload.rst +++ b/input/tex/extensions/autoload.rst @@ -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'], diff --git a/input/tex/extensions/html.rst b/input/tex/extensions/html.rst index d921777..9a0678e 100644 --- a/input/tex/extensions/html.rst +++ b/input/tex/extensions/html.rst @@ -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} @@ -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-* `__ attributes to the element associated with ``math``. + For example: .. code-block:: latex @@ -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 @@ -81,7 +87,7 @@ html Commands ------------- The `html` extension implements the following macros: -``\class``, ``\cssId``, ``\href``, ``\style`` +``\class``, ``\cssId``, ``\data``, ``\href``, ``\style`` |-----| diff --git a/input/tex/extensions/textmacros.rst b/input/tex/extensions/textmacros.rst index 3cbc3d7..e321bb8 100644 --- a/input/tex/extensions/textmacros.rst +++ b/input/tex/extensions/textmacros.rst @@ -256,7 +256,8 @@ HTML Commands ------------- .. list-table:: - + * - ``\data`` + - specify data-* attributes * - ``\href`` - make hyperlink * - ``\style`` diff --git a/input/tex/macros/index.rst b/input/tex/macros/index.rst index ad8b7cb..09d5c13 100644 --- a/input/tex/macros/index.rst +++ b/input/tex/macros/index.rst @@ -601,6 +601,8 @@ D - **ams** * - ``\dashv`` - + * - ``\data`` + - **html** * - ``\dbinom`` - **ams** * - ``\dblcolon`` From 790d5db3ef5aea301b05f1fd60359e75ed03699c Mon Sep 17 00:00:00 2001 From: Yuri Sulyma <> Date: Sun, 1 May 2022 17:15:03 -0400 Subject: [PATCH 2/2] Remove quotes in data example --- input/tex/extensions/html.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input/tex/extensions/html.rst b/input/tex/extensions/html.rst index 9a0678e..baf9638 100644 --- a/input/tex/extensions/html.rst +++ b/input/tex/extensions/html.rst @@ -51,7 +51,7 @@ 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}} + x = \data{during=quadratic}{\frac{-b\pm\sqrt{b^2-4ac}}{2a}} .. Note::