# How do I change font in array environment inside an equation?

I have the following code to define a piece-wise equation as shown in the following figure:

$$\label{xput_vc} Throughput_{VC} = \begin{array}{cc} 1 & N_{VC} \leq N_{slave} \\ \frac{N_{req2slave}\times N_{VC}}{N_{req2slave}+Latency} & N_{VC} > N_{slave} \\ \end{array}$$


I want to decrease the font size of the conditions in that equation (NVC less then NSlave) but I can't seem to be able to get it to do that. I tried typing \footnotesize before the condition but it makes no difference.

How can I change the font size inside the array nested in an equation environment?

• Welcome to TeX.SX. If you really need (explanatory) text in an equation use \text{Throughput} or \intertext. And you need amsmath as package, but you can't change the font size (this way) in math mode, in addition there's a case command that's meant for such piecewise functions/definitions etc.
– user31729
Nov 17 '15 at 23:16

Here are ways to do it, with the cases environment. In the second way, you can have the 1 centred easily with \hfill (thanks to @Mico's suggestion):

    \documentclass{article}
\usepackage{amsmath}

\begin{document}

$$\label{xput_vc} \text{Throughput}_{VC} = \begin{cases} 1 & \scriptstyle N_{VC} \leq N_\text{slave} \\ \frac{N_\text{req2slave}\times N_{VC}}{N_\text{req2slave}+\text{Latency}} & \scriptstyle N_{VC} > N_\text{slave} \\ \end{cases}$$
\vskip1cm
$$\label{xput_vc} \text{Throughput}_{VC} = \begin{cases} \hfill 1\hfill & \scriptstyle N_{VC} \leq N_\text{slave} \\ \frac{N_\text{req2slave}\times N_{VC}}{N_\text{req2slave}+\text{Latency}} & \scriptstyle N_{VC} > N_\text{slave} \\ \end{cases}$$

\end{document}


• Thanks! How do I center the "1" in this environment? Nov 18 '15 at 1:47
• You can with the small makebox package. Please see my updated answer. Nov 18 '15 at 9:03
• @Mico: I didn't even think of using it, not knowing how TeX measures the boxes that play here. I've incorporated it in my answer. Thanks for you suggestion: the code is much neater! Nov 18 '15 at 13:21

You can do it like this

\text{\footnotesize $N_{VC} \leq N_{slave}$}

• Maybe, but you certainly shouldn't!
– cfr
Nov 17 '15 at 23:29
• I agree, this seems too hacky; what should I do though? Nov 17 '15 at 23:49
• I must say, this did actually work fine though -- upvote for that Nov 17 '15 at 23:54