[Tex/LaTex] Customized log notation


In my country, the base of logarithm is written in superscript before the log sign, i.e. $^a\log b$ means log base a of b. This doesn't look nice on LaTeX, because there is a gap between ^a and \log. How to remove this gap?

Best Answer

You can use a negative space \! to remove (or reduce) this to your liking. It would be best to define a command for this, for the sake of consistency:

enter image description here

\usepackage{xparse}% http://ctan.org/pkg/xparse
  {}^a\log xyz\ \mbox{or}\ \Log[a]xyz\ \mbox{or}\ \Log xyz\ \mbox{or}\ \log_a xyz

Of course, more specific kerning is also possible using \kern.

The above MWE defined \Log[<base>] that takes an optional argument <base>. Without <base> it defaults to \log.

Related Question