Skip to content

Commit

Permalink
DOC: Make LaTeX math definitions LaTeX compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed Feb 28, 2019
1 parent e96f334 commit 1e8f43f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
6 changes: 6 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@
plot_pre_code = ''
plot_formats = ['svg', 'pdf']

mathjax_config = {
'TeX': {
'extensions': ['newcommand.js', 'begingroup.js'], # Support for \gdef
},
}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_template']

Expand Down
31 changes: 20 additions & 11 deletions doc/math-definitions.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
.. raw:: latex

\marginpar{% Avoid creating empty vertical space for the math definitions

.. rst-class:: hidden
.. math::
\newcommand{\dirac}[1]{\operatorname{\delta}\left(#1\right)}
\newcommand{\e}[1]{\operatorname{e}^{#1}}
\newcommand{\Hankel}[3]{\mathop{{}H_{#2}^{(#1)}}\!\left(#3\right)}
\newcommand{\hankel}[3]{\mathop{{}h_{#2}^{(#1)}}\!\left(#3\right)}
\newcommand{\i}{\mathrm{i}}
\newcommand{\scalarprod}[2]{\left\langle#1,#2\right\rangle}
\renewcommand{\vec}[1]{\mathbf{#1}}
\newcommand{\wc}{\frac{\omega}{c}}
\newcommand{\w}{\omega}
\newcommand{\x}{\vec{x}}
\newcommand{\n}{\vec{n}}
\gdef\dirac#1{\operatorname{\delta}\left(#1\right)}
\gdef\e#1{\operatorname{e}^{#1}}
\gdef\Hankel#1#2#3{\mathop{{}H_{#2}^{(#1)}}\!\left(#3\right)}
\gdef\hankel#1#2#3{\mathop{{}h_{#2}^{(#1)}}\!\left(#3\right)}
\gdef\i{\mathrm{i}}
\gdef\scalarprod#1#2{\left\langle#1,#2\right\rangle}
\gdef\vec#1{\mathbf{#1}}
\gdef\wc{\frac{\omega}{c}}
\gdef\w{\omega}
\gdef\x{\vec{x}}
\gdef\n{\vec{n}}
.. raw:: latex

}

0 comments on commit 1e8f43f

Please sign in to comment.