This question has helped me in creating a command for my own package (more a list of commands I defined) to force upright lowercase \pi, and so in my package I have the following code:
\renewcommand{\pi}{\text{$\mathup{π}$}}
I don't want to include my entire package here because it's huge. So, as a simpler example, when I run the following code (in LuaLaTeX) it works fine and the pi becomes upright:
\documentclass{article}
\usepackage{unicode-math}
\usepackage{amsmath}
\setmathfont{xits-math.otf} %I use MinionMath-Regular.otf but should work the same
\begin{document}
\renewcommand{\pi}{\text{$\mathup{π}$}}
\verb|\pi| = \pi $\pi$
%I put both \pi and $\pi$ here just to show that it can work in and out of math mode.
\end{document}
But, it only shows pi as uppercase this for that particular line! If I go to another place in the document and try $\pi$, it reverts to italicised! Since I'd rather not have to type in $\mathup{\pi}$ or $\mathrm{\pi}$ each time, is there any way to force this command as a default instead?
Below is a screenshot of what I would like as default (left) and what I wish to avoid (right):


amsmathpackage, and you use fonts that are not default in LaTeX. And I still don't understand your point, if I addamsmathand switch toxits-math.otf, I get the same symbol for\pino matter what I try. – yo' Nov 21 '14 at 12:44\renewcommand\pi{\text{$\mathup{π}$}}seems quite bad. If it's text mode, it should be text mode (just inputπ), and if it's math mode, then\renewcommand*\pi{\mathrm{π}}should work after putting that redefinition in the correct place (i.e., not inside a group). – Manuel Nov 21 '14 at 14:03\newcommand{\cpi}{\mathrm{\pi}}– egreg Nov 21 '14 at 14:07\AtBeginDocument. wrap that around your definition, and put it just before\begin{document}to outwit the other. – barbara beeton Nov 21 '14 at 14:21unicode-mathsets the math\AtBeginDocument? Then\AtBeginDocument{\renewcommand*\pi{..}}would put your command after that. In any case, your definition is wrong. – Manuel Nov 21 '14 at 14:21\text{$..$}has no sense, and you are using it outside math! – Manuel Nov 21 '14 at 14:37