# How do I write math in Technical Notes?

**URL:** <https://www.rubin.community/t/how-do-i-write-math-in-technical-notes/691>\
**Category:** Data Management\
**Tags:** technote, dm-dev\
**Created:** [April 15, 2016, 5:25pm UTC](https://www.rubin.community/t/how-do-i-write-math-in-technical-notes/691 "2016-04-15T17:25:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwv](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@mwv](https://www.rubin.community/u/mwv)\
**Post date:** [April 15, 2016, 5:25pm UTC](https://www.rubin.community/t/how-do-i-write-math-in-technical-notes/691/1 "2016-04-15T17:25:27Z")

</div>

How do I write math in Technical Notes?

As a specific example, I want to write what in LaTeX would be $C \theta/{\rm SNR}$

---

<div class="post-metadata">

**Author:** ![ljones](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/ljones/32/1804_2.png) [@ljones](https://www.rubin.community/u/ljones)\
**Post date:** [April 15, 2016, 5:38pm UTC](https://www.rubin.community/t/how-do-i-write-math-in-technical-notes/691/2 "2016-04-15T17:38:37Z")

</div>

You should just have to put it into the math context.  
Example of math equation on its own line:

> 

.. math::  
SNR = \frac{C } {\sqrt{C/g + ( B/g + \sigma^2\_{instr}) , n\_{eff}}}  
n\_{eff} = 2.266 , (FWHM\_{eff} / pixelScale)^2

But in this case you have to be sure to include a blank line after the last line and watch the indentation.

Example of math inline:

> 

pixel, :math:`\sigma_{instr}` is t

(:math: context, then backticks around the thing to be math-ed).

---

<div class="post-metadata">

**Author:** ![mwv](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@mwv](https://www.rubin.community/u/mwv)\
**Post date:** [April 15, 2016, 6:20pm UTC](https://www.rubin.community/t/how-do-i-write-math-in-technical-notes/691/3 "2016-04-15T18:20:53Z")

</div>

Perfect. Thank you.

```auto
image is :math:`C\theta/{\rm SNR}`. Note that we here

```

where the final backtick needs to be followed by a space or a ‘.’, and not another word. E.g.,

```auto
image is :math:`C\theta/`SNR. Note that we here

```

does not work.

---

<div class="post-metadata">

**Author:** ![jsick](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/jsick/32/672_2.png) [@jsick](https://www.rubin.community/u/jsick)\
**Post date:** [April 16, 2016, 2:06am UTC](https://www.rubin.community/t/how-do-i-write-math-in-technical-notes/691/4 "2016-04-16T02:06:59Z")

</div>

Guidance for writing inline math in reStructuredText can be found in the [Developer Guide](http://developer.lsst.io/en/latest/docs/rst_styleguide.html#inline-text-styling).

The Guide also specifically mentions the quirk you just mentioned on not being able to write inline syntax without a space afterwards, and offers this solution:

> Inline markup also needs to be surrounded by white space, though trailing punctuation is fine. You can get around this with an escaped space that is otherwise invisible, For example `one\ *word*` renders as onward.

That is, placing a `\` before a space will remove the space, allowing inline syntax to apply within a word.

To answer your original question, I’d also recommend using the `\mathrm` LaTeX command. For example:

```auto
:math:`C \theta/\mathrm{SNR}`

```

---

<div class="post-metadata">

**Author:** ![jsick](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/jsick/32/672_2.png) [@jsick](https://www.rubin.community/u/jsick)\
**Post date:** [April 17, 2016, 11:51pm UTC](https://www.rubin.community/t/how-do-i-write-math-in-technical-notes/691/5 "2016-04-17T23:51:13Z")

</div>

I’ve added an extra section specifically on math in reStructuredText with covers both inline and display math (including multiple aligned equations) to the DM Developer Guide.

[http://developer.lsst.io/en/latest/docs/rst\_styleguide.html#math](http://developer.lsst.io/en/latest/docs/rst_styleguide.html#math)
