Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporting org with image showing the 2nd page. #13

Open
onlycparra opened this issue Oct 31, 2023 · 1 comment
Open

Exporting org with image showing the 2nd page. #13

onlycparra opened this issue Oct 31, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@onlycparra
Copy link

I am not sure if this is within the scope of org-inline-pdf, it seems it could be the export engine of org-mode. In any case, here it goes:

I am working in a file document.org, and I have an embedded image, the second page of a file images.pdf.

The org-file shows this correctly (with the code shown below). However, upon exporting it to tex (let's say document.tex), the tex does not indicate that \includegraphics{} should use the second page.

#+attr_org: :width 80% :page 2
#+attr_latex: :width 0.95\textwidth
#+caption: My Caption
[[./images.pdf]]

This shows (in the buffer) the second page of images.pdf. But if I export the org file to tex or pdf, the resulting tex has:

\begin{figure}[htbp]
\centering
\includegraphics[width=0.95\textwidth]{./images.pdf}
\caption{My Caption}
\end{figure}

Which leads to a pdf showing the first page of images.pdf. A natural thing to try was changing the #+attr_latex... line for

#+attr_latex: :width 0.95\textwidth :page 2

But it does nothing.

@shg
Copy link
Owner

shg commented Nov 4, 2023

Hi @onlycparra

Org-inline-pdf currently does not do anything for latex export. It is handled by ox-latex included in the org distribution. the :page attribute is an extension of org-inline-pdf's own, so ox-latex silently ignores it.

It is actually possible to specify the page of a linked multi-page PDF for exporting. Add double colon and the page number to the link, like [[./images.pdf::2]], and ox-latex will add page=2 as an option of includegraphics in the exported latex file.

I understand that it is confusing that the way org-inline-pdf specifies the page is different from the ox-latex's. I will think of a solution to this problem. As a current workaround, you can specify the page for both inline preview and export by specifying both the :page attribute and the ::n.

@shg shg added the enhancement New feature or request label Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants