fmarotta / kaobook

A LaTeX class for books, reports or theses based on https://github.com/kenohori/thesis and https://github.com/Tufte-LaTeX/tufte-latex.
https://github.com/fmarotta/kaobook
LaTeX Project Public License v1.3c
858 stars 184 forks source link

Add the wide algorithm* environment and make its caption style consistent with kaobook #257

Open pi8027 opened 2 years ago

pi8027 commented 2 years ago

This PR depends on #225. I will provide an example if needed.

taqtiqa-mark commented 6 months ago

I ran into the need to have wide algorithm, then I iterated to this workaround:

\begin{table*}[h!]
    \begin{tabular}{ c }
        \begin{algorithm}[H]
        ....
                \caption{Example code}
        \end{algorithm}\\
    \end{tabular}
\caption{Meta-Coal Algorithm}
\end{table*}

This displays as:

image

Is this not sufficient?

pi8027 commented 6 months ago

@taqtiqa-mark Having both "Table 2.1" and "Algorithm 1" seems weird to me. (This shouldn't be the case with my patch, but this PR is from two years ago, so I don't remember what I did.)

taqtiqa-mark commented 6 months ago

Having both "Table 2.1" and "Algorithm 1" seems weird to me.

Agreed. But that should be configurable without too much difficulty. I left it in for the use case where you have multiple algorithms you want to display - possibly with a different label, say "Set Algorithms", etc.

Any way I'll leave this here for anyone who needs this without patching in this PR.