Re: caption in ambiente algorithm

#52467
OldClaudio
Partecipante
    Up
    0
    Down
    ::


    `
    \documentclass{book}
    \usepackage{algorithm}
    \usepackage{algorithmic}

    \begin{document}
    %\parbox{\textwidth}{
    \begin{algorithm}
    \caption{Algoritmo}
    \label{alg1}
    \begin{algorithmic}[1]
    \STATE Choose randomly a set of points.\\
    \STATE Compute a model from these points.\\
    \STATE Compute the fit of all points to this model; check how many of them are inliers.\\
    \STATE Iterate until a maximum number of iterations has been reached or until a sufficiently high number of inliers have been found.\\
    \STATE Choose the model that has the highest number of inliers.\\
    \STATE Compute the final model using all the inliers.\\
    \end{algorithmic}
    \end{algorithm}
    %}
    \end{document}
    `

    Viene benissimo con la sua brava didascalia preceduta dal nome Algorithm e il suo numero. Ma…Non puoi mettere un oggetto flottante dentro una scatola.

    Il pacchetto caption non l’ho usato e non credo che tu abbia problemi dalla presenza o assenza del pacchetto caption. in compenso togli \parbox e lascia flottare l’oggetto mobile che di solito non occupa una sola riga.

    Go to top