Kate build plugin: how to use distroboxes/podman containers?

Suppose I have Kate installed as a native app and have a library I need to use installed in a distrobox/podman/docker container. How do I configure the Kate Build plugin to use a library in the container?

Example: I am using Kate (deb version) on Linux Mint 21.3 Cinnamon to write LaTeX. The default package repository has an outdated version of TeXLive, so I create a distrobox image of Arch and install texlive in the container. If I want to build a TeX document from the terminal, I run

distrobox enter arch
pdflatex <file-name>

I want to be able to make the build plugin use the “build target” in Kate use the containerized version of TeXLive.


Kate build plugin is basically just a shell command runner. So in theory, setting the command as distrobox enter arch && pdflatex <file-name> should work.

But I don’t know if you can pipe commands like that inside to distrobox. Maybe it has some other way to do it.

I tried

distrobox enter arch && pdflatex %f

And it just built using the native deb version of texlive. It seems like the second command is run outside of the distrobox even though it comes after “distrobox enter.”

Yeah, I dont know but if distrobox has a way to run commands inside of it without entering it, you could try that.

It worked! I used

distrobox enter arch -- pdflatex %f

And that did exactly what I wanted. Thank you!

1 Like

Awesome, glad that you got it to work!. :slight_smile: