Math & ScienceLogarithm with Base 10

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Logarithm with Base 10

Post by ghostanime2001 »

Is there a macro for log base 10? the subscript 10 has to show

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

torbjorn t.
Posts: 162
Joined: Wed Jun 17, 2009 10:18 pm

Logarithm with Base 10

Post by torbjorn t. »

Anything wrong with

Code: Select all

$\log_{10} a$
You could define your own command of course, e.g.

Code: Select all

\newcommand\logten{\ensuremath{\log_{10}}
and use as

Code: Select all

$\logten a$
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Logarithm with Base 10

Post by ghostanime2001 »

not exactly except the spacing is not so great between the subscript 10 and whatever quantity im taking the log of.... For example:

Code: Select all

$-\log_{10}(\text{0.003 mol/L})$
maxmax
Posts: 29
Joined: Sat Sep 03, 2011 11:19 am

Logarithm with Base 10

Post by maxmax »

What about a simple space after torbjorns \logten?

Code: Select all

\newcommand\logten{\ensuremath{\log_{10}\;}
By the way, i think its not a good idea to put "0.003 mol/L" in \text. You could use e.g. the "unit" package.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Logarithm with Base 10

Post by Stefan Kottwitz »

You could define it as math operator:

Code: Select all

\newcommand*{\logten}{\mathop{\log_{10}}}
For writing units I would use the siunitx package.

Stefan
LaTeX.org admin
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Logarithm with Base 10

Post by cgnieder »

You also could use the cool package:

Code: Select all

\documentclass{article}
\usepackage{cool,siunitx}
\Style{LogShowBase=always}
\sisetup{per-mode=symbol}
\begin{document}
\(\Log[10]\SI{.003}{\mole\per\liter}\)
\end{document}
site moderator & package author
Post Reply