5

Is there a way to display the base of a logarithm in (GitHub-flavored) Markdown so that it will be shown below the line?

I mean the number 2 in this expression: log2 n.

Null
  • 1,950
  • 9
  • 30
  • 33
moodcheerful
  • 195
  • 2
  • 7

4 Answers4

8

You can use

you can write 
log<sub>b</sub><sup>x</sup>+log<sub>b</sub><sup>y</sup>

which displays

enter code here

logbx+logby

3

If you want to use math symbols and expressions in Markdown use this syntax $<expression>$

I mean the number 2 in this expression: log2 n

Write $log{_2}{n}$ in your markdown file.

chris
  • 2,490
  • 4
  • 32
  • 56
1

The base of a logarithm is displayed as a subscript. You can produce subscripts in Markdown using <sub>. Thus log<sub>2</sub>(n) displays log2(n).

Panda
  • 6,955
  • 6
  • 40
  • 55
Null
  • 1,950
  • 9
  • 30
  • 33
1

this is the proper way to use log in markdown.

$log{_a}{n}$
Shehan Hasintha
  • 947
  • 10
  • 10