Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,25 @@
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False

math_definitions = r"""
\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)}
\renewcommand{\i}{\mathrm{i}}
\newcommand{\scalarprod}[2]{\left\langle#1,#2\right\rangle}
\renewcommand{\vec}[1]{\mathbf{#1}}
\newcommand{\wc}{\frac{\omega}{c}}
"""

rst_prolog = """
.. only:: html

.. rst-class:: hidden
.. math::

""" + ' '.join(math_definitions.split('\n'))


# -- Options for HTML output ----------------------------------------------

Expand Down Expand Up @@ -251,7 +270,7 @@ def setup(app):
#'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#'preamble': '',
'preamble': math_definitions,

'printindex': '',
}
Expand Down
10 changes: 0 additions & 10 deletions doc/math-definitions.rst

This file was deleted.

7 changes: 1 addition & 6 deletions sfs/mono/drivingfunction.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
"""Compute driving functions for various systems.

.. include:: math-definitions.rst

"""

"""Compute driving functions for various systems."""
import numpy as np
from numpy.core.umath_tests import inner1d # element-wise inner product
from scipy.special import jn, hankel2
Expand Down
6 changes: 1 addition & 5 deletions sfs/time/drivingfunction.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
"""Compute time based driving functions for various systems.

.. include:: math-definitions.rst

"""
"""Compute time based driving functions for various systems."""
import numpy as np
from numpy.core.umath_tests import inner1d # element-wise inner product
from .. import defs
Expand Down
2 changes: 0 additions & 2 deletions sfs/time/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

The Green's function describes the spatial sound propagation over time.

.. include:: math-definitions.rst

"""

import numpy as np
Expand Down
7 changes: 1 addition & 6 deletions sfs/util.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
"""Various utility functions.

.. include:: math-definitions.rst

"""

"""Various utility functions."""
import collections
import numpy as np
from scipy.special import spherical_jn, spherical_yn
Expand Down