# Export an org-mode table to pdf/png image

I've started using org-roam more often recently, and I use LaTeX a lot in my workflow.

What I want to do is this:

1. Create a table in an org file with some LaTeX math symbols, using the org-mode table handler, e.g.

 #+ATTR_LATEX: :environment longtable
|-----|-----|
| A   | B   |
|-----|-----|
| $x$ |$\mu$|
|-----|-----|

2. Export just the table to a .png or .pdf file in the directory

3. Insert the .png or .pdf image into the org-file to use as a preview.

At the moment I can do this via C-c C-e C-l l o and get a .pdf, but I was thinking of something along the lines of a python source block to create a matplotlib plot as a .png.

Is there something I can do with the export tags, or with #+BEGIN_SCR latex?

The root cause of this is that I want to use latex-previews in org tables, but the previews break the table alignment, like in this question.