Graphics, Figures & Tables ⇒ Boxed Algorithms: Parbox
Boxed Algorithms: Parbox
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
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
Boxed Algorithms: Parbox
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
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
Re: Boxed Algorithms: Parbox
- 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
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!
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10