I have a many minted sections that can span more than one page. I also have tables. It seems that these tables can just be plonked right in the middle of my minted section - which I don't want.
How can I stop minted sections getting broken by figures? i.e. is there a way I can either make minted 'unbreakable' (but still spans over page breaks), or can I make tables inline?
What is the best way to do this? I saw a similar answer to this question here: https://tex.stackexchange.com/a/34860/109263. but that just puts a table on it's own page... some of my tables are very small and many could be fit on a single page.
I'm rendering the minted package with the following code in the preamble:
\usepackage[outputdir=./_build]{minted}
\definecolor{dhscodebg}{rgb}{0.01,0.199,0.1}
\setminted{
breaksymbolleft=,
fontsize=\footnotesize,
baselinestretch=1.1,
xleftmargin=2.5em,
linenos,
breaklines,
tabsize=4
}
\usemintedstyle{tango}
\BeforeBeginEnvironment{minted}
{\begin{tcolorbox}[
breakable,
boxrule=0.2pt,
arc=0pt
]}\AfterEndEnvironment{minted}{\end{tcolorbox}}
I've included tables via the following code:
\begin{table}[h]
\centering
\label{PercentTreatment}
\begin{tabular}{|l|l|l|}
...
\end{tabular}
\caption{...}
\end{table}
And the minted code is added to the document via:
\begin{minted}{sh} ... \end{minted}
I have been able to specify float treatment as H, which stops the minted sections from being interrupted. Though I would prefer to specify that a section cannot be interrupted rather than specify where a float must go
\documentclassand ending with\end{document}which potential answerers can run directly to get the current situation (a minted block interrupted by a table). This would allow answerers to try out potential solutions without spending effort to recreate what you already have, and it also avoids potential problems of starting with a different initial situation and finding solutions that do not solve the original problem. – Marijn Dec 03 '17 at 11:16