Graphics, Figures & Tables ⇒ Boxed Algorithms: Parbox
Boxed Algorithms: Parbox
I am trying to put some highly enumerated text inside a box.
I don't want to use the algorithms package this time.
As I am doing this inside beamer (a power point type package for latex) I need to shrink the size of everything in the box. For some reason the standard fontsize{12pt} and \small do not work.
Please can someone advise on how I can shrink all the text/ equations etc etc
I wonder if this is something to do with using parbox and perhaps I should be using something else? If so what?
Can you help?
Thank you!
%\fontsize{6pt}{8pt} %doesnt work
\fcolorbox{black}[HTML]{E9F0E9}{\parbox{\textwidth}{%
%\noindent \textbf{blah}
\begin{description}
\item [Input:] Inputs
\begin{enumerate}
\item blah
\item blah
\item blah
\item blah
\end{enumerate}
\item [Output:] blah
\begin{enumerate}
\item Return
\item Compute
\item Compute
\item blah
\item blah
\begin{enumerate}
\item
\item
\item
\end{enumerate}
\item Calculate
\begin{enumerate}
\item
\item
\item
\end{enumerate}
\end{enumerate}
\end{description}}}
%\vspace{1cm}
%\normalsize
I don't want to use the algorithms package this time.
As I am doing this inside beamer (a power point type package for latex) I need to shrink the size of everything in the box. For some reason the standard fontsize{12pt} and \small do not work.
Please can someone advise on how I can shrink all the text/ equations etc etc
I wonder if this is something to do with using parbox and perhaps I should be using something else? If so what?
Can you help?
Thank you!
%\fontsize{6pt}{8pt} %doesnt work
\fcolorbox{black}[HTML]{E9F0E9}{\parbox{\textwidth}{%
%\noindent \textbf{blah}
\begin{description}
\item [Input:] Inputs
\begin{enumerate}
\item blah
\item blah
\item blah
\item blah
\end{enumerate}
\item [Output:] blah
\begin{enumerate}
\item Return
\item Compute
\item Compute
\item blah
\item blah
\begin{enumerate}
\item
\item
\item
\end{enumerate}
\item Calculate
\begin{enumerate}
\item
\item
\item
\end{enumerate}
\end{enumerate}
\end{description}}}
%\vspace{1cm}
%\normalsize
NEW: TikZ book now 40% off at Amazon.com for a short time.

Boxed Algorithms: Parbox
Please always post a complete minimal working example and not just a snippet. And when posting code, use a code box, as specified in the Board Rules.
Theoretically you should be able to do this:
But for reasons I don't really understand, it isn't working quite right.
I guess an alternative would be to use a resizebox or scalebox from the graphicx package.
Theoretically you should be able to do this:
Code: Select all
\setbeamerfont{enumerate item}{size*={6}{8}}
\setbeamerfont{enumerate body}{size*={6}{8}}
\setbeamerfont{enumerate subbody}{size*={6}{8}}
\setbeamerfont{enumerate subitem}{size*={6}{8}}
I guess an alternative would be to use a resizebox or scalebox from the graphicx package.
Code: Select all
\documentclass{beamer}
\begin{document}
\begin{frame}
\resizebox{!}{1.6in}{%
\fcolorbox{black}[HTML]{E9F0E9}{\parbox{1.2\textwidth}{%
\begin{description}
\item [Input:] Inputs
\begin{enumerate}
\item blaha
\item blah
\item blah
\item blah
\end{enumerate}
\item [Output:] blah
\begin{enumerate}
\item Return
\item Compute
\item Compute
\item blah
\item blah
\item blah
\item blah
\item blah
\item Calculate
\begin{enumerate}
\item blah1
\item blah2
\item blah3
\item blah4
\item blah5
\end{enumerate}
\end{enumerate}
\end{description}
}
}
}
\end{frame}
\end{document}
Re: Boxed Algorithms: Parbox
Dear frabjous.
thank you very much for your reply. That works perfectly.
I have one more question on this topic: If in the below code you remove the word "Inputs", you see that "input" is placed onto the same line as the first number (1).
I would like "input" to be on a line by itself. Then a carriage return and then the enumeration to start.
I have tried to use "\\" and "\vspace*" etc but nothing seems to work. Can you advise?
many thanks!
thank you very much for your reply. That works perfectly.
I have one more question on this topic: If in the below code you remove the word "Inputs", you see that "input" is placed onto the same line as the first number (1).
I would like "input" to be on a line by itself. Then a carriage return and then the enumeration to start.
I have tried to use "\\" and "\vspace*" etc but nothing seems to work. Can you advise?
many thanks!
Re: Boxed Algorithms: Parbox
I think it just needs to shift modes, which you could do just by replacing "Inputs" with \mbox{}. I don't know what the "right" or "proper" way of doing it is, however.
Re: Boxed Algorithms: Parbox
brilliant. thank you!
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Boxed Algorithms: Parbox
Then please be so kind and mark the topic (not the last post) accordingly as written in the Board Rules.sw3quant wrote:brilliant. […]
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Boxed Algorithms: Parbox
What's the point of that?sw3quant wrote:good stuff!
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10