.Kind (page): .Type (posts) / .Layout ()
Bundle: n/a (regular page)
[ categories | projects | tags | search ]
Hugo Sandbox

This is an unofficial Hugo sandbox site to try to replicate possible bugs in hugo.

It is updated automatically after each commit to the hugo-sandbox repo. It was last updated on Jan 20, 2022 13:08 UTC.


This page was created/modified in commit 669d193 "Copy ox-hugo test site" on 2017-11-02.
Markdown source of this page

Inline equations

tags: equations


Description/Summary

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.


Content

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 VariableValue
Name "Inline equations"
Title "Inline equations"
ResourceType "page"
Kind "page"
Section "posts"
Draft false
Type "posts"
Layout ""
Permalink "https://hugo-sandbox.netlify.com/posts/equation-latex-frag/"
RelPermalink "/posts/equation-latex-frag/"
Data
page.Data{} (type:page.Data)
NextPageGeneral
PrevPageList following a list
NextInSectionGeneral
PrevInSectionList following a list

Page Params (Debug)

maps.Params{"date":time.Date(2017, time.July, 31, 0, 0, 0, 0, time.UTC), "draft":false, "iscjklanguage":false, "lastmod":time.Date(2017, time.November, 2, 10, 12, 52, 0, time.Location("")), "publishdate":time.Date(2017, time.July, 31, 0, 0, 0, 0, time.UTC), "tags":[]string{"equations"}, "title":"Inline equations"} (type:maps.Params)

File Object (Debug)

FileInfo VariableValue
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"

This site is generated using the ox-hugo package for Emacs/Org-mode + hugo-bare-min-theme + Hugo 0.92.0 (commit b3549403) .

[Back to Hugo Sandbox home]