[Tex/LaTex] How to change the font size during the new defined environment

environmentsfontsize

I want to change the font size of the new environment defined as below:

\newsavebox{\ieeealgbox}
\newenvironment{boxedalgorithmic}
{\begin{lrbox}{\ieeealgbox}
\begin{minipage}{\dimexpr\columnwidth-2\fboxsep-2\fboxrule}
\begin{algorithmic}}
{\end{algorithmic}
\end{minipage}
\end{lrbox}\noindent\fbox{\usebox{\ieeealgbox}}}

and the environment is used like below:

\begin{table}[ht]          
\caption{...} 
\centering
\begin{boxedalgorithmic}
...
\end{boxedalgorithmic}
\label{alg}
\end{table}

I really don't know how to change the font size of the content in the Table.

Best Answer

The font size can be changed with the standard LaTeX font changing commands. The following table (taken from this answer) lists the resulting size for the standard classes (depending on the class option 10pt, 11pt, 12pt:

                    10pt    11pt    12pt
\tiny               5       6       6
\scriptsize         7       8       8
\footnotesize       8       9       10
\small              9       10      10.95
\normalsize         10      10.95   12
\large              12      12      14.4
\Large              14.4    14.4    17.28
\LARGE              17.28   17.28   20.74
\huge               20.74   20.74   24.88
\Huge               24.88   24.88   24.88

As with all font commands, they are in effect until the end of the current group (innermost closing brace } or end of the innermost environment). So

\begin{boxedalgorithmic}
  \normalsize
  ...
\end{boxedalgorithmic} 

will change the font to size "normal" for the content of the environment. If you want to be this the default, it is better to put this in the environment definition itself.

\newsavebox{\ieeealgbox}
\newenvironment{boxedalgorithmic}
{\begin{lrbox}{\ieeealgbox}
\begin{minipage}{\dimexpr\columnwidth-2\fboxsep-2\fboxrule}
\begin{algorithmic}%
\normalsize}
{\end{algorithmic}
\end{minipage}
\end{lrbox}\noindent\fbox{\usebox{\ieeealgbox}}}