lwarp
lwarp copied to clipboard
physics package
Minimum example:
\documentclass{article}
\usepackage[mathjax]{lwarp}
\usepackage{amsmath,physics}
\begin{document}
Formula $\cos[2](x)$
\end{document}
Expected
Result in HTML (similar to the one in PDF if without the physics package)
Thanks a lot. Your package is amazing.
This feature is missing in the MathJax physics extension. I'll add a patch in Lwarp.
In the meantime you can add to the preamble after loading physics:
\begin{warpMathJax}
\CustomizeMathJax{\newcommand{\LWRphystrig}[2]{\ifblank{#1}{\textrm{#2}}{\textrm{#2}^{#1}}}}
\CustomizeMathJax{\renewcommand{\sin}[1][]{\LWRphystrig{#1}{sin}}}
\CustomizeMathJax{\renewcommand{\sinh}[1][]{\LWRphystrig{#1}{sinh}}}
\CustomizeMathJax{\renewcommand{\arcsin}[1][]{\LWRphystrig{#1}{arcsin}}}
\CustomizeMathJax{\renewcommand{\asin}[1][]{\LWRphystrig{#1}{asin}}}
\CustomizeMathJax{\renewcommand{\cos}[1][]{\LWRphystrig{#1}{cos}}}
\CustomizeMathJax{\renewcommand{\cosh}[1][]{\LWRphystrig{#1}{cosh}}}
\CustomizeMathJax{\renewcommand{\arccos}[1][]{\LWRphystrig{#1}{arcos}}}
\CustomizeMathJax{\renewcommand{\acos}[1][]{\LWRphystrig{#1}{acos}}}
\CustomizeMathJax{\renewcommand{\tan}[1][]{\LWRphystrig{#1}{tan}}}
\CustomizeMathJax{\renewcommand{\tanh}[1][]{\LWRphystrig{#1}{tanh}}}
\CustomizeMathJax{\renewcommand{\arctan}[1][]{\LWRphystrig{#1}{arctan}}}
\CustomizeMathJax{\renewcommand{\atan}[1][]{\LWRphystrig{#1}{atan}}}
\CustomizeMathJax{\renewcommand{\csc}[1][]{\LWRphystrig{#1}{csc}}}
\CustomizeMathJax{\renewcommand{\csch}[1][]{\LWRphystrig{#1}{csch}}}
\CustomizeMathJax{\renewcommand{\arccsc}[1][]{\LWRphystrig{#1}{arccsc}}}
\CustomizeMathJax{\renewcommand{\acsc}[1][]{\LWRphystrig{#1}{acsc}}}
\CustomizeMathJax{\renewcommand{\sec}[1][]{\LWRphystrig{#1}{sec}}}
\CustomizeMathJax{\renewcommand{\sech}[1][]{\LWRphystrig{#1}{sech}}}
\CustomizeMathJax{\renewcommand{\arcsec}[1][]{\LWRphystrig{#1}{arcsec}}}
\CustomizeMathJax{\renewcommand{\asec}[1][]{\LWRphystrig{#1}{asec}}}
\CustomizeMathJax{\renewcommand{\cot}[1][]{\LWRphystrig{#1}{cot}}}
\CustomizeMathJax{\renewcommand{\coth}[1][]{\LWRphystrig{#1}{coth}}}
\CustomizeMathJax{\renewcommand{\arccot}[1][]{\LWRphystrig{#1}{arccot}}}
\CustomizeMathJax{\renewcommand{\acot}[1][]{\LWRphystrig{#1}{acot}}}
\end{warpMathJax}
Remove this when Lwarp v0.920 is released.
Thank you. Confirm working.