# How to change the font size during the new defined environment?

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.

• Do you want to change the boxedalgorithmic definition so that another font size is applied whenever the environment is used? Or do you want to change the font size in particular uses of boxedalgorithmic. In both cases: Have you tried just using one of the commands from one of the lists come up if you google for "LaTeX font size", such as here? – Daniel Jan 11 '12 at 8:40
• Yes. Thanks a lot. I also found this way.Through adding a sentence like '\normalsize' after \begin{boxedalgorithmic}, the font changed to my desired size. – datcn Jan 11 '12 at 10:04
• Note that you could alternatievly put \normalsize in your environment definition (directly after the \begin{algorithmic} if you want the font used inside a boxedalgorithm to default to \normalsize. – Daniel Jan 11 '12 at 10:22
• As this apparently has solved your problem, I posted my comments as an answer. – Daniel Jan 11 '12 at 20:03
• I came here by googling. I have a related question but I actually want to change the "base font" size. An example: My normal document is typeset in 11pt. I want an environment based on a minipage which has a redefined base font size of 10pt such that all other font-size commands are changed relative to that new base size. In other words a want all font-size commands to be "one step smaller". – nagmat84 Apr 19 '18 at 10:58

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}}}