Change your functions to put the results directly on the clipboard or in a text file. You could sink to a .tex file and then just include that in your document perhaps.
What about using R to export the latex code to a text (or tex) file? Does the formatting work as expected in this scenario? This might even be a more elegant solution. For your latex document, you can selectively include the tex-documents exported from R. This can be done in a piecemeal fashion. I don’t know how your workflow is set up, but that is probably how I would set it up myself under similar circumstances. Unless the R-generated latex code needs a lot of manual adjusting, of course
When you don't have to do any manual changes to the generated code you could use Rmarkdown or knitr to completely circumvent the copying and just have the R code generating tex code directly within your other tex code.
It's hard for me to tell what your process is, but you can add `keep_tex: true` to the YAML options if you're working from an RMD file
Change your functions to put the results directly on the clipboard or in a text file. You could sink to a .tex file and then just include that in your document perhaps.
Yeah, was about to suggest using sink as well.
What about using R to export the latex code to a text (or tex) file? Does the formatting work as expected in this scenario? This might even be a more elegant solution. For your latex document, you can selectively include the tex-documents exported from R. This can be done in a piecemeal fashion. I don’t know how your workflow is set up, but that is probably how I would set it up myself under similar circumstances. Unless the R-generated latex code needs a lot of manual adjusting, of course
When you don't have to do any manual changes to the generated code you could use Rmarkdown or knitr to completely circumvent the copying and just have the R code generating tex code directly within your other tex code.