Step 1. First, run whatever command that generates what you want to annotate and use capture_text to save it to a .png file.

x <- list(cyl = c(4, 8))
sim <- regsim::regsim(lm(mpg ~ . , mtcars), x)

capture_text(summary(sim), "model_summary.png", width=1, height=2, units="in", res=400, pointsize=2)

Step 2. Next, use the tikzannotate to annotate the .png you just created.

Step 3. You’re done. There’s no step 3.

Code is available here: http://github.com/altaf-ali/rtikz

\usetikzlibrary{annotate}
\definecolor{darkgreen}{RGB}{0,128,0}
          
\begin{annotated_figure}{model_summary.png}
    \annotate{1}{blue, fill=blue, opacity=0.1}{0.05, 0.680}{9cm}{8.4cm}{west}{blue}{east}
    \annotate{2}{red,  fill=red,  opacity=0.1}{0.05, 0.585}{12cm}{2.4cm}{west}{red}{east}
    \annotate{3}{blue, fill=blue, opacity=0.1}{0.05, 0.275}{9cm}{8.4cm}{west}{blue}{east}
    \annotate{4}{red,  fill=red,  opacity=0.1}{0.05, 0.180}{12cm}{2.4cm}{west}{red}{east}
    \annotate{5}{darkgreen, fill=darkgreen, opacity=0.1}{0.05, 0.050}{14cm}{3.4cm}{west}{darkgreen}{east}
\end{annotated_figure}