I wrote a little pandoc plugin since I use it a lot to convert markdown / markdown+latex files to pdf and liked to have a preview of my current document.
It"s my first plugin, it’s very rudimentary and the result of a lot of try and error.
Every suggestion for improvement or features is highly welcome.
I don’t create PDFs all that often myself, but this looks to be pretty useful for people who do. Well done!
One thing I noticed - in your code, there’s a couple of places where you try to remove the file’s extension by splitting the filename on the first . character. That’s a bit unreliable, as you can imagine a filename might have many . in it, and even the directory path might have . in it.
Instead, a better way is to use the shell’s “remove smallest suffix” pattern:
without_extension=${kak_buffile%.*}
${kak_buffile} and $kak_buffile are the same - they just mean the kak_buffile environment variable
% means “remove smallest suffix”, and is one of the “remove {smallest,largest} {prefix,suffix}” string-slicing operators the shell has
.* is a shell pattern (glob) that matches the suffix we want to remove: the . of the extension and everything that follows it