Text FormattingMidline Decimal Point

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
RikRaccoon
Posts: 2
Joined: Sat Mar 05, 2011 12:29 am

Midline Decimal Point

Post by RikRaccoon »

A journal requires midline decimal points (e.g. 0·02). \cdot is available, but leaves a space either side. \!\cdot\! is an obvious fix, but not ideal. Any ideas of a better solution?

Thank you!

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Midline Decimal Point

Post by localghost »

A quick fix would look like this.

Code: Select all

0{\cdot}02
Global formatting for decimal numbers can be done with the siunitx package (especially regarding numbers in tables)

Code: Select all

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{siunitx}

\sisetup{
  output-decimal-marker={\cdot}
}
\begin{document}
  $0{\cdot}01$ \num{0.01}
\end{document}

Thorsten
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Midline Decimal Point

Post by cgnieder »

Maybe you could use the siunitx for it?

Code: Select all

\documentclass{article}
\usepackage{siunitx}
\sisetup{output-decimal-marker=\cdot}
\begin{document}

\num{.02} vs $0\cdot02$ vs $0\!\cdot\!02$ vs $0{\cdot}02$

\end{document}
It would have the advantage that you could change the layout afterwards easily if you'd wished to.
site moderator & package author
Post Reply