4

I am looking for a way to define a new mathematical symbol, namely a lowercase pi, that will resize according to the font size of the surrounding text. The normal \pi will not suffice as I am already using it to denote the constant 3.14... I am also using \varpi for something else. I was thinking that a lowercase version of \varPi, that is \scriptstyle \varPi, would work. Basically, I want something like:

pi

and so on. It is important that the lower case pi looks like \scriptstyle \varPi because I am using it to denote a realization of a stochastic process denoted by \varPi.

2
  • as much as i don't love it, there's an international standard that says that constants should be rendered upright. so maybe making that change would give you the flexibility you're looking for. (i'm pretty sure there's a question here that says where you can find an upright pi; i don't know, offhand.) euler cursive might also be useful. but it also seems that you're overloading this one letter to the point where (some) readers will have trouble distinguishing between them; that's a disservice to readers. Dec 4, 2014 at 18:05
  • @barbarabeeton I completely agree. The problem is that I have already written an article where I used \varPi to denote a stochastic process. So in my new article, where I also need to denote its realizations, I'm stuck with that choice.
    – tot
    Dec 5, 2014 at 10:17

2 Answers 2

3

This might be what you're looking for:

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newcommand{\smallPi}{\mathpalette\small@Pi\relax}
\newcommand{\small@Pi}[2]{%
  \mbox{\fontsize{\sf@size}{\z@}\selectfont$\m@th#1\varPi$}%
}
\makeatother

\begin{document}
\[
% first like it is in inline formulas
{\textstyle\smallPi x_{x\smallPi}}\qquad
% then in displays
\int_{\smallPi}
\]
\end{document}

The macro typesets \varPi at the size used for subscripts, but taking into account the current style.

enter image description here

3
  • But this does not seem to carry over to \scriptscriptstyle. Dec 4, 2014 at 17:48
  • @StevenB.Segletes I didn't even try. But it depends on \DeclareMathSizes{7}{7}{5}{5} (there's no reliable font below 5pt).
    – egreg
    Dec 4, 2014 at 18:58
  • @egreg Thank you very much for your solution. Very nice. But as Steven B. Segletes notices, it does carry over to \scriptscriptstyle. Also, the pi looks a little wide compared to Steven's suggestion.
    – tot
    Dec 5, 2014 at 8:56
2

This approach uses the scalerel package to scale the \varPI to the same vertical extent as an x in the local math style. Thus it automatically works for sub- and superscripts, as well as in all cases of \scriptstyle and \scriptscriptstyle.

\documentclass{article}
\usepackage{amsmath, scalerel}

\newcommand{\smallPi}{\scalerel*{\varPi}{x}}

\begin{document}
\[
% first like it is in inline formulas
{\textstyle\smallPi x_{x\smallPi}}\qquad
% then in displays
\int_{\smallPi} 
\]
\[
% first like it is in inline formulas
{\scriptstyle\smallPi x_{x\smallPi}}\qquad
% then in displays
\scriptstyle\int_{\smallPi} 
\]

\end{document}

enter image description here

1
  • Thanks for the elegant solution. Very neat. I'm going to use this one.
    – tot
    Dec 5, 2014 at 9:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .