I am writing a code using the algorithm
package. However, I would like to put smaller edges. I used the minipage
, boxes and did not work. Could someone give me a suggestion?
I have this
\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{algorithm}
%========================
\begin{document}
\section*{Example Algorithm}
%----------------------
\begin{algorithm}
\caption{Penalty function}
\begin{itemize}
\item Let $\{c_k\}$, $k=1,2,\ldots$, be a sequence tending to infinity such that for each $k$, $0 \leq c_k < c_{k+1}$.
\item Define the function $$q(\mu_{k},x) = f(x) + \mu_{k}P(x).$$
\item For each k solve the problem
\begin{gather*} minimize \ q(\mu_{k},x), \end{gather*}
obtaining a solution point $x_{k}$.
\end{itemize}
\end{algorithm}
%----------------------
\end{document}
which results
but, I want
[H]
behind\begin{algorithm}
and it works in theminipage
.