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

org-mode beamer/latex export requires "#+NAME:" attribute for proper captions/centering #2643

Closed
pmagwene opened this issue Jan 11, 2016 · 3 comments · Fixed by #2646
Closed

Comments

@pmagwene
Copy link

Pandoc version: 1.15.2
If the #+NAME attribute isn't specified for a figure, the corresponding figure does not get properly centered in LaTeX/beamer output.

Here's a MWE:

#+CAPTION: Your caption here
#+NAME: 
[[img.png]]

Generates this:

\begin{frame}
\begin{figure}[htbp]
\centering
\includegraphics{img.png}
\caption{Your caption here}
\end{figure}

but

#+CAPTION: Your caption here
[[img.png]]

generates

\begin{frame}
\includegraphics{img.png}
\end{frame}
@tarleb
Copy link
Collaborator

tarleb commented Jan 11, 2016

I'd classify this as a bug in the Org reader: Pandoc doesn't have a figure type, so it marks images as a figures using special attributes. Even if NAME is missing, the reader correctly recognizes that this should be a figure, but fails to set the necessary attributes to signal this fact to the writer.

If somebody wants to make a pull request for this within the next 9 hours: this should be fixable with a simple change in line 631. Otherwise I'll fix it later or tomorrow.

tarleb added a commit to tarleb/pandoc that referenced this issue Jan 11, 2016
The convention used by pandoc for figures is to mark them by prefixing
the name with "fig:".  The org reader failed to do this if a figure had
no name.  The test for this was broken as well.

This fixes jgm#2643.
@tarleb
Copy link
Collaborator

tarleb commented Jan 11, 2016

Thank you for reporting this bug, @pmagwene

@pmagwene
Copy link
Author

@tarleb -- Thanks for the quick fix!

@pmagwene pmagwene reopened this Jan 29, 2016
@jgm jgm closed this as completed in #2646 Feb 21, 2016
c-forster pushed a commit to c-forster/pandoc that referenced this issue Mar 4, 2016
The convention used by pandoc for figures is to mark them by prefixing
the name with "fig:".  The org reader failed to do this if a figure had
no name.  The test for this was broken as well.

This fixes jgm#2643.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants