Graphics, Figures & TablesAlgorithm2e: display algorithms in small characters

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
tonguim
Posts: 24
Joined: Fri Nov 06, 2009 4:32 pm

Algorithm2e: display algorithms in small characters

Post by tonguim »

Hi all,

I'm using algorithm2e package; I would like to display all the algorithms text, including the comments, in small characters; what should I do please? Thanks

Code: Select all

\usepackage[lined,boxed,commentsnumbered,french]{algorithm2e}

			\begin{algorithm}[H]
				\SetLine
				%\SetAlFnt{\small\sf}
				Algorithme minCout(A[1, ..., n], B[])
				\\//***********************************
				\\//***********Variables*************
				\\//***********************************
				\\//$A[1, ..., n]$: tableau stockant, dans le désordre, les $r_j$ valeurs des coûts des $n$ licences;
				\\//$B[]$: tableau vide pour stocker les licences retenues pour achat;
				\\//n: nombre total de permis disponibles;
				\\coutTotal: coût total des permis déjà acquis;
				\\//$permis_j$, avec $j \in 1$ à $n$: permis $j$;
				\\//coutInitialPermis[j]: tableau mémorisant le coût initial du $permis_j$;
				\\//$r_j*m$ loi d'accroissement du coût en fonction du temps ou m est le ième mois;
				\\//coutPermisDuMois(j, m)=$coutInitialPermis_j*r_j*m$, m année d'acquisition;
				\\//disponibilitePermis(j, m)=(0 si indisponible, 1 si disponible) indiquant à un mois donnee si le permis $j$ est disponible au mois $m$;
				\\//permisAcquis[j]: tableau mémorisant le numéro $j$ du permis déjà acquis;(1: déjà acquis, 0: non acquis).\\

				//***********************************
				\\//**********Initialisation**********
				\\//***********************************

				\For{$i \leftarrow 1$ \KwTo $n$}
				{
					permisAcquis[j]=0\\
					coutInitialPermis[j]
				}
				coutTotal=0\\
				\While {$j<n$ (Tant qu'il reste encore des licences à acquérir)}
				{
					\For{$i \leftarrow 1$ \KwTo $n$ (Passer en revue les coûts des licences)}
					{
						\If{$r_i < r_{i+1}$ (Il s'agit de choisir d'abord la licence de plus grand coût)}
						{
							$A[i]=i+1$ \emph{(acheter maintenant la licence de plus grand coût)}\\
						}
						$j=j+1$ \emph{(Recherche de la prochaine licence à acquérir)}
					}
				}
				Retourne $A[i]$
				\caption{Algorithme permettant de trouver l'ordre d'achat des permis.}
			\end{algorithm}\\

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

tonguim
Posts: 24
Joined: Fri Nov 06, 2009 4:32 pm

Re: Algorithm2e: display algorithms in small characters

Post by tonguim »

The references of the package algorithme2e I use are: algorithm2e 2005/10/04 v3.9 algorithms environments
Post Reply