From 778cda7a57540a65b9f5e0c48e32bcadbc2022b7 Mon Sep 17 00:00:00 2001 From: Till Rohrmann Date: Thu, 7 May 2015 16:09:26 +0200 Subject: [PATCH] [ml] [docs] Adds distance formulas to documentation. Automatically include latex_commands.html with mathjax markdown files. --- docs/_includes/latex_commands.html | 35 ++++++++++++++++ docs/_layouts/base.html | 4 ++ docs/libs/ml/distance_metrics.md | 64 ++++++++++++++++++++++++++---- 3 files changed, 96 insertions(+), 7 deletions(-) create mode 100644 docs/_includes/latex_commands.html diff --git a/docs/_includes/latex_commands.html b/docs/_includes/latex_commands.html new file mode 100644 index 00000000000..a070b68e1be --- /dev/null +++ b/docs/_includes/latex_commands.html @@ -0,0 +1,35 @@ + +$$ +\newcommand{\R}{\mathbb{R}} +\newcommand{\E}{\mathbb{E}} +\newcommand{\x}{\mathbf{x}} +\newcommand{\y}{\mathbf{y}} +\newcommand{\wv}{\mathbf{w}} +\newcommand{\av}{\mathbf{\alpha}} +\newcommand{\bv}{\mathbf{b}} +\newcommand{\N}{\mathbb{N}} +\newcommand{\id}{\mathbf{I}} +\newcommand{\ind}{\mathbf{1}} +\newcommand{\0}{\mathbf{0}} +\newcommand{\unit}{\mathbf{e}} +\newcommand{\one}{\mathbf{1}} +\newcommand{\zero}{\mathbf{0}} +\newcommand\rfrac[2]{^{#1}\!/_{#2}} +$$ \ No newline at end of file diff --git a/docs/_layouts/base.html b/docs/_layouts/base.html index e2833543a96..b5a2e7b6eb1 100644 --- a/docs/_layouts/base.html +++ b/docs/_layouts/base.html @@ -51,6 +51,10 @@ under the License. {% comment %} Includes are found in the _includes directory. {% endcomment %} {% include navbar.html %} + {% if page.mathjax %} + {% include latex_commands.html %} + {% endif %} +
{% comment %} diff --git a/docs/libs/ml/distance_metrics.md b/docs/libs/ml/distance_metrics.md index 9d87fa18194..4dfd1aff9d4 100644 --- a/docs/libs/ml/distance_metrics.md +++ b/docs/libs/ml/distance_metrics.md @@ -1,4 +1,5 @@ --- +mathjax: include title: Distance Metrics ---