# Equation tags in lining numerals

This is a follow-up to this question; I'd like also the tags (typeset by the \tag command) to be in lining numerals. However, inspecting the definition of \tag in amsmath didn't reveal too much to me - it is \let to different macros, depending on (I guess) which exactly environment is being used.

-

Here's how I would do it

\documentclass{article}
\usepackage{amsmath}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX,Numbers=OldStyle]{Linux Libertine O}
\newfontfamily{\tagfont}[Ligatures=TeX]{Linux Libertine O}

\makeatletter
\def\maketag@@@#1{\hbox{\m@th\normalfont\tagfont#1}}
\makeatother

\begin{document}
123
$$a+b=c\tag{1234567890}\label{x}$$
\setcounter{equation}{455}
$$aaa$$
456--\eqref{x}--456
\end{document}


The important macro is \maketag@@@; you can also use the \Lpnum method of the other answer, but I believe that this is cleaner.

-

If you don't want to change the internal macros directly, mathtools package is more friendly (c.f. egreg's solution):

\documentclass{article}
\usepackage{mathtools}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX,Numbers=OldStyle]{Linux Libertine O}
\newfontfamily\lining[Ligatures=TeX]{Linux Libertine O}

\newtagform{lining}{(\lining}{)}
\usetagform{lining}

\begin{document}
123
$$a+b=c\tag{1234567890}\label{x}$$
\setcounter{equation}{455}
$$aaa$$
456--\eqref{x}--456
\end{document}

-