0

We can easily insert figures from external PDF, but how do I insert a table the same way?

For example: I have a table in .tex file in a standalone class as it is easier to generate it from an external program. And I have the compiled PDF from it.

What I want is basically this in LaTeX/PDF export:

\begin{table}
\caption{\label{tab:dams}Dams in the Basin}
\begin{center}
\includegraphics[width=.9\linewidth]{./dams.pdf}
\end{center}
\end{table}

If I do [[./dams.pdf]] then it automatically becomes an image, and the #+caption: will be Figure 1. Is there any way I can tell org mode that this is supposed to be inserted as a table?

I found a workaround using #+begin_table but it doesn't get recognized as table for the caption to be on top with the variable org-latex-caption-above variable.

But with:

#+name: tab:dams
#+caption: Dams in the Basin
#+begin_table
[[./dams.pdf]]
#+end_table

OR with

#+name: tab:dams
#+caption: Dams in the Basin
#+ATTR_LATEX: :float table
[[./dams.pdf]]

And variable setq org-latex-caption-above as (table) (default), I get:

\begin{table}
\begin{center}
\includegraphics[width=.9\linewidth]{./dams.pdf}
\end{center}
\caption{\label{tab:dams}Dams in the Basin}
\end{table}

I don't want all the captions including figures to be on top, so if there is a way to make this form recognized as table and have the caption on top would work. Or another way where I can include something as table using org syntax would work too.

I do not want to put LaTeX code for the whole table syntax in org document as I'd like to have references to that table in the text and have the link clickable to open the pdf.

1 Answer 1

0

Ok, I found the way to make the workaround work for now.

Since the #+begin_table is recognized as special-block instead of table I can add that to the org-latex-caption-above variable.

 (setq org-latex-caption-above '(table special-block))

It'll work for my usecase, but if you have other special blocks that you don't want the caption to be on the top, then it will be problematic.

It'd still be a good idea to know if there is a way to make it recognized as a table when inserted with link to a PDF/PNG file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.