I configured my document in chapters that are self compilable. Each chapter is configured like this:
\documentclass[crop=false,class=embedchap]{standalone}
\begin{document}
\begin{subappendices}
\input{merge-algo}
\end{subappendices}
\end{document}
With the following embedchap.cls:
% embedchap
% This package provides common settings for chapters embedded in the book
%
% When a chapter is compiled by itself is compiled as an article
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{embedchap}[2019/09/01 Common configurations for the chapters embedded in the book]
% This class is based on KOMA script article class
\LoadClass{scrartcl}
% We want the title as in an article, instead of a book
\KOMAoptions{titlepage=false,fontsize=12pt}
% :: Language and charset
\RequirePackage[utf8]{inputenc}
\RequirePackage[french,american]{babel}
\RequirePackage[T1]{fontenc}
\RequirePackage{standalone}
\RequirePackage{appendix}
\RequirePackage{algorithm}
\RequirePackage{algpseudocode}
Now, if the content of merge-algo.tex is the following:
\section{Algorithm to handle multiblock simulations}
\begin{algorithm}
\caption{Algorithm to merge a multi-block simulation}
\label{algo:merge}
\begin{algorithmic}[1]
\Procedure{MergeBlocks}{$blocks$}
\State $blocks\gets$\Call{Sort}{$blocks$}
\State $b_0 \gets blocks[0]$
\State $n_x, n_y, n_z \gets$ \Call{GetDimensions}{$b_0$}\Comment{Get first block dimensions}
\State $b_0\rightarrow$ \Call{SetStartIJK}{$0, 0, 0$}\Comment{The starting $i, j, k$ indices in the merged block}
\EndProcedure
\end{algorithmic}
\end{algorithm}
when I compile the individual chapter, I get the following error:
! Extra }, or forgotten \endgroup.
\@endfloatbox ...pagefalse \outer@nobreak \egroup
\color@endbox
l.13 \end{algorithm}
Any help on how to solve?
main.texfile of the book with the others, independently, as a KOMA script article. Everything works as expected, including figure floats, but it does not work if I use subappendices. If I remove the subappendices environment, it also works as expected. – rdbisme Jan 06 '21 at 19:57\includeand\includeonly? – rdbisme Jan 06 '21 at 22:20