In this example I would like to reduce the pseudocode font size, but only for this slide while keeping the others in the default font size. How can I do that?
[Tex/LaTex] Reduce pseudocode font size (not global)
algorithmsbeamerfontsize
algorithmsbeamerfontsize
In this example I would like to reduce the pseudocode font size, but only for this slide while keeping the others in the default font size. How can I do that?
Best Answer
The simplest way would be to add
\small
,\footnotesize
,\scriptsize
, or\tiny
immediately after the beginning of thealgorithm
environment. This changes the size of everything inside the environment (except for the caption), and nowhere else.Edited to add: This will apparently leave the size of the line-numbers and of the caption unchanged. In order to change the size of the line-numbers for the algorithm, add the command
\algsetup{linenosize=<size>}
just inside thealgorithm
environment, where<size>
is again something like\small
,\footnotesize
, etc. Note that the default is to have line-numbers somewhat smaller than the surrounding text: if you want the appearance to be somewhat similar to algorithms elsewhere in your document, you should also choose a smaller size for the line-numbers than the algorithm body.I am not sure how best to modify the size of the caption, unfortunately.
Example document.
Result.