Inline equations
Description/Summary
Inline and one-per-line equationsContent
- Inline equations are wrapped between
\(and\).-
$wrapping also works, but it is not preferred as it comes with restrictions like “there should be no whitespace between the equation and the$delimiters”.So
$ a=b $will not work (it will look like: $ a=b $), but$a=b$will work (it will look like: \(a=b\)).On the other hand, both
\(a=b\)(it will look like: \(a=b\)) and\( a=b \)(it will look like: \( a=b \)) will work.
-
- One-per-line equations are wrapped between
\[and\]or$$delimiters.
For example, below in Org:
LaTeX formatted equation: \( E = -J \sum_{i=1}^N s_i s_{i+1} \)
will look like this in Hugo rendered HTML:
LaTeX formatted equation: \( E = -J \sum_{i=1}^N s_i s_{i+1 }\)
(Don’t see this in Markdown, see what it looks after Hugo has processed it.)
Here’s another example, taken from (org) LaTeX fragments.
Below in Org:
If $a^2=b$ and \( b=2 \), then the solution must be either
$$ a=+\sqrt{2} $$ or \[ a=-\sqrt{2} \]
renders to:
If \(a^2=b\) and \( b=2 \), then the solution must be either \[ a=+\sqrt{2} \] or \[ a=-\sqrt{2} \]
(Note that the last two equations show up on their own lines.)
Page (Debug)
| Page Variable | Value | |
|---|---|---|
| Name | "Inline equations" | |
| Title | "Inline equations" | |
| ResourceType | "page" | |
| Kind | "page" | |
| Section | "posts" | |
| Draft | false | |
| Type | "posts" | |
| Layout | "" | |
| Permalink | "https://ox-hugo.scripter.co/test/posts/equation-latex-frag/" | |
| RelPermalink | "/posts/equation-latex-frag/" | |
| Data |
| |
| NextPage | General | |
| PrevPage | List following a list | |
| NextInSection | General | |
| PrevInSection | List following a list |
Page Params (Debug)
| Key | Type | Value |
|---|---|---|
| date | time.Time | 2017-07-31 00:00:00 +0000 UTC |
| description | string | "Inline and _one-per-line_ equations" |
| draft | bool | false |
| iscjklanguage | bool | false |
| lastmod | time.Time | 2018-04-01 23:32:28 -0400 -0400 |
| publishdate | time.Time | 2017-07-31 00:00:00 +0000 UTC |
| tags | []string | "equations" "mathjax" |
| title | string | "Inline equations" |
File Object (Debug)
| FileInfo Variable | Value |
|---|---|
| UniqueID | "1219ba6dbea0430c632b58c344179800" |
| BaseFileName | "equation-latex-frag" |
| TranslationBaseName | "equation-latex-frag" |
| Lang | "en" |
| Section | "posts" |
| LogicalName | "equation-latex-frag.md" |
| Dir | "posts/" |
| Ext | "md" |
| Path | "posts/equation-latex-frag.md" |