emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: LaTeX export #+NAME failing [8.3.1 (release_8.3.1-123-g823cad @ /home/amdavis/src/org-mode/lisp/)]
@ 2015-09-15 20:08 Andrew Davis
  2015-09-16 16:27 ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Davis @ 2015-09-15 20:08 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1521 bytes --]

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen. You don't know how to make a good report? See

http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.
------------------------------------------------------------------------

#+CAPTION: Plot of something interesting.
#+ATTR_LaTeX: :width \textwidth
#+NAME: fig:result_plot
file:./img/plot.pdf

This method of placing plots into an org document no longer
works. Previously, this would correctly produce the figure with
a consistent label for internal references within the org document and
the exported LaTeX document. Now, the export results in the following
TeX code:

\begin{figure}[htb]
\centering
\includegraphics[width=\textwidth]{./img/plot.pdf}
\caption{\label{fig:orgparagraph1}
Plot of something interesting.}
\end{figure}

As it can be seen above, the intended label of fig:result_plot is no
longer exported. This breaks any reference to \ref{fig:result_plot} in
the LaTeX document while the label of ref:fig:result_plot only works
within the org document.

I do not regularly update my org-mode version, so the last working
commit I had been using behaves correctly is 83fe247. Please let me know
if I can provide any other information.

Best,
Andrew

Emacs : GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.2)
of 2015-04-20 on bitzer.hoetzel.info
Package: Org-mode version 8.3.1 (release_8.3.1-123-g823cad @
/home/amdavis/src/org-mode/lisp/)

[-- Attachment #2: Type: text/html, Size: 1952 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug: LaTeX export #+NAME failing [8.3.1 (release_8.3.1-123-g823cad @ /home/amdavis/src/org-mode/lisp/)]
  2015-09-15 20:08 Bug: LaTeX export #+NAME failing [8.3.1 (release_8.3.1-123-g823cad @ /home/amdavis/src/org-mode/lisp/)] Andrew Davis
@ 2015-09-16 16:27 ` Nicolas Goaziou
  2015-09-16 16:35   ` Andrew Davis
  2015-09-16 21:08   ` Andrew Davis
  0 siblings, 2 replies; 9+ messages in thread
From: Nicolas Goaziou @ 2015-09-16 16:27 UTC (permalink / raw)
  To: Andrew Davis; +Cc: emacs-orgmode

Hello,

Andrew Davis <amdavis@uchicago.edu> writes:

> #+CAPTION: Plot of something interesting.
> #+ATTR_LaTeX: :width \textwidth
> #+NAME: fig:result_plot
> file:./img/plot.pdf
>
> This method of placing plots into an org document no longer
> works. Previously, this would correctly produce the figure with
> a consistent label for internal references within the org document and
> the exported LaTeX document. Now, the export results in the following
> TeX code:
>
> \begin{figure}[htb]
> \centering
> \includegraphics[width=\textwidth]{./img/plot.pdf}
> \caption{\label{fig:orgparagraph1}
> Plot of something interesting.}
> \end{figure}
>
> As it can be seen above, the intended label of fig:result_plot is no
> longer exported. This breaks any reference to \ref{fig:result_plot} in
> the LaTeX document while the label of ref:fig:result_plot only works
> within the org document.

This is usually not an issue since [[fig:result_plot]] will results in
\ref{fig:result_plot}.

In any case, see `org-latex-prefer-user-labels'.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug: LaTeX export #+NAME failing [8.3.1 (release_8.3.1-123-g823cad @ /home/amdavis/src/org-mode/lisp/)]
  2015-09-16 16:27 ` Nicolas Goaziou
@ 2015-09-16 16:35   ` Andrew Davis
  2015-09-16 17:17     ` Nicolas Goaziou
  2015-09-16 21:08   ` Andrew Davis
  1 sibling, 1 reply; 9+ messages in thread
From: Andrew Davis @ 2015-09-16 16:35 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1713 bytes --]

Thanks for getting back to me. Unfortunately this is not the issue I am
reporting. The problem is that the #+NAME that produces the label is
incorrectly exported to the LaTeX document. That is it is the weird
\label{fig:orgparagraph1} which is not what I am trying to label the figure
as.

You are right that [[fig:result_plot]] does produce the
\ref{fig:result_plot}, However, the reference appears unresolved in the
resulting document because the figure itself is incorrectly labeled.

Best,
Andrew

On Wed, Sep 16, 2015 at 11:26 AM Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Andrew Davis <amdavis@uchicago.edu> writes:
>
> > #+CAPTION: Plot of something interesting.
> > #+ATTR_LaTeX: :width \textwidth
> > #+NAME: fig:result_plot
> > file:./img/plot.pdf
> >
> > This method of placing plots into an org document no longer
> > works. Previously, this would correctly produce the figure with
> > a consistent label for internal references within the org document and
> > the exported LaTeX document. Now, the export results in the following
> > TeX code:
> >
> > \begin{figure}[htb]
> > \centering
> > \includegraphics[width=\textwidth]{./img/plot.pdf}
> > \caption{\label{fig:orgparagraph1}
> > Plot of something interesting.}
> > \end{figure}
> >
> > As it can be seen above, the intended label of fig:result_plot is no
> > longer exported. This breaks any reference to \ref{fig:result_plot} in
> > the LaTeX document while the label of ref:fig:result_plot only works
> > within the org document.
>
> This is usually not an issue since [[fig:result_plot]] will results in
> \ref{fig:result_plot}.
>
> In any case, see `org-latex-prefer-user-labels'.
>
> Regards,
>
> --
> Nicolas Goaziou
>

[-- Attachment #2: Type: text/html, Size: 2265 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug: LaTeX export #+NAME failing [8.3.1 (release_8.3.1-123-g823cad @ /home/amdavis/src/org-mode/lisp/)]
  2015-09-16 16:35   ` Andrew Davis
@ 2015-09-16 17:17     ` Nicolas Goaziou
  2015-09-16 17:30       ` Andrew Davis
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2015-09-16 17:17 UTC (permalink / raw)
  To: Andrew Davis; +Cc: emacs-orgmode

Andrew Davis <amdavis@uchicago.edu> writes:

> Thanks for getting back to me. Unfortunately this is not the issue I am
> reporting. The problem is that the #+NAME that produces the label is
> incorrectly exported to the LaTeX document. That is it is the weird
> \label{fig:orgparagraph1} which is not what I am trying to label the figure
> as.
>
> You are right that [[fig:result_plot]] does produce the
> \ref{fig:result_plot}, However, the reference appears unresolved in the
> resulting document because the figure itself is incorrectly labeled.

I cannot reproduce it. With the following document

  #+CAPTION: Plot of something interesting.
  #+ATTR_LaTeX: :width \textwidth
  #+NAME: fig:result_plot
  file:./img/plot.pdf

  [[fig:result_plot]]

I get

  \begin{figure}[htb]
  \centering
  \includegraphics[width=\textwidth]{./img/plot.pdf}
  \caption{\label{fig:orgparagraph1}
  Plot of something interesting.}
  \end{figure}

  \ref{fig:orgparagraph1}

which seems fine.

Regards,

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug: LaTeX export #+NAME failing [8.3.1 (release_8.3.1-123-g823cad @ /home/amdavis/src/org-mode/lisp/)]
  2015-09-16 17:17     ` Nicolas Goaziou
@ 2015-09-16 17:30       ` Andrew Davis
  2015-09-16 20:47         ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Davis @ 2015-09-16 17:30 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2022 bytes --]

You are getting the same results I am. What is concerning me is the fact
that the label you are applying in the document:

#+NAME: fig:result_plot

is not the label that is being applied to the the exported tex document,
i.e.

\label{fig:orgparagraph1}

\ref{fig:orgparagraph1}

This is rather problematic as there are a variety of things that sometimes
need to be done with just pure LaTeX in a babel source block that operate
on the figures elsewhere in the org document. If I want to create some
multi figure plot in which the internal caption references another figure,
the reference in that caption to \ref{fig:result_plot} will no longer work.

Again, I am pretty sure this is a bug as it was previously possible to
refer to the assigned labels (i.e. fig:result_plot) rather than needing to
know whatever sequential reference is assigned by org mode on the export.

Best,
Andrew

On Wed, Sep 16, 2015 at 12:15 PM Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> Andrew Davis <amdavis@uchicago.edu> writes:
>
> > Thanks for getting back to me. Unfortunately this is not the issue I am
> > reporting. The problem is that the #+NAME that produces the label is
> > incorrectly exported to the LaTeX document. That is it is the weird
> > \label{fig:orgparagraph1} which is not what I am trying to label the
> figure
> > as.
> >
> > You are right that [[fig:result_plot]] does produce the
> > \ref{fig:result_plot}, However, the reference appears unresolved in the
> > resulting document because the figure itself is incorrectly labeled.
>
> I cannot reproduce it. With the following document
>
>   #+CAPTION: Plot of something interesting.
>   #+ATTR_LaTeX: :width \textwidth
>   #+NAME: fig:result_plot
>   file:./img/plot.pdf
>
>   [[fig:result_plot]]
>
> I get
>
>   \begin{figure}[htb]
>   \centering
>   \includegraphics[width=\textwidth]{./img/plot.pdf}
>   \caption{\label{fig:orgparagraph1}
>   Plot of something interesting.}
>   \end{figure}
>
>   \ref{fig:orgparagraph1}
>
> which seems fine.
>
> Regards,
>

[-- Attachment #2: Type: text/html, Size: 2679 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug: LaTeX export #+NAME failing [8.3.1 (release_8.3.1-123-g823cad @ /home/amdavis/src/org-mode/lisp/)]
  2015-09-16 17:30       ` Andrew Davis
@ 2015-09-16 20:47         ` Nicolas Goaziou
  0 siblings, 0 replies; 9+ messages in thread
From: Nicolas Goaziou @ 2015-09-16 20:47 UTC (permalink / raw)
  To: Andrew Davis; +Cc: emacs-orgmode

Andrew Davis <amdavis@uchicago.edu> writes:

> You are getting the same results I am. What is concerning me is the fact
> that the label you are applying in the document:
>
> #+NAME: fig:result_plot
>
> is not the label that is being applied to the the exported tex document,
> i.e.
>
> \label{fig:orgparagraph1}
>
> \ref{fig:orgparagraph1}
>
> This is rather problematic as there are a variety of things that sometimes
> need to be done with just pure LaTeX in a babel source block that operate
> on the figures elsewhere in the org document. If I want to create some
> multi figure plot in which the internal caption references another figure,
> the reference in that caption to \ref{fig:result_plot} will no longer work.
>
> Again, I am pretty sure this is a bug as it was previously possible to
> refer to the assigned labels (i.e. fig:result_plot) rather than needing to
> know whatever sequential reference is assigned by org mode on the
> export.

This is a feature. And I already explained in my first answer how to
tweak it.

Regards,

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug: LaTeX export #+NAME failing [8.3.1 (release_8.3.1-123-g823cad @ /home/amdavis/src/org-mode/lisp/)]
  2015-09-16 16:27 ` Nicolas Goaziou
  2015-09-16 16:35   ` Andrew Davis
@ 2015-09-16 21:08   ` Andrew Davis
  2015-09-17  3:25     ` Benda Xu
  2015-09-17  7:16     ` Nicolas Goaziou
  1 sibling, 2 replies; 9+ messages in thread
From: Andrew Davis @ 2015-09-16 21:08 UTC (permalink / raw)
  To: Andrew Davis, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1478 bytes --]

Nicolas,

Thanks for following up on this with me. I now understand that this is
intentional. Could you just briefly let me know why this is a feature? I am
assuming that this is so that org references are unique should you
accidentally reuse a label?

Best,
Andrew

On Wed, Sep 16, 2015 at 11:26 AM Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Andrew Davis <amdavis@uchicago.edu> writes:
>
> > #+CAPTION: Plot of something interesting.
> > #+ATTR_LaTeX: :width \textwidth
> > #+NAME: fig:result_plot
> > file:./img/plot.pdf
> >
> > This method of placing plots into an org document no longer
> > works. Previously, this would correctly produce the figure with
> > a consistent label for internal references within the org document and
> > the exported LaTeX document. Now, the export results in the following
> > TeX code:
> >
> > \begin{figure}[htb]
> > \centering
> > \includegraphics[width=\textwidth]{./img/plot.pdf}
> > \caption{\label{fig:orgparagraph1}
> > Plot of something interesting.}
> > \end{figure}
> >
> > As it can be seen above, the intended label of fig:result_plot is no
> > longer exported. This breaks any reference to \ref{fig:result_plot} in
> > the LaTeX document while the label of ref:fig:result_plot only works
> > within the org document.
>
> This is usually not an issue since [[fig:result_plot]] will results in
> \ref{fig:result_plot}.
>
> In any case, see `org-latex-prefer-user-labels'.
>
> Regards,
>
> --
> Nicolas Goaziou
>

[-- Attachment #2: Type: text/html, Size: 2019 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug: LaTeX export #+NAME failing [8.3.1 (release_8.3.1-123-g823cad @ /home/amdavis/src/org-mode/lisp/)]
  2015-09-16 21:08   ` Andrew Davis
@ 2015-09-17  3:25     ` Benda Xu
  2015-09-17  7:16     ` Nicolas Goaziou
  1 sibling, 0 replies; 9+ messages in thread
From: Benda Xu @ 2015-09-17  3:25 UTC (permalink / raw)
  To: emacs-orgmode

Hi Andrew,

Andrew Davis <amdavis@uchicago.edu> writes:

> Thanks for following up on this with me. I now understand that this is
> intentional. Could you just briefly let me know why this is a feature?
> I am assuming that this is so that org references are unique should
> you accidentally reuse a label?

I think you are right.

Please refer to this thread:

  http://thread.gmane.org/gmane.emacs.orgmode/96887

Benda

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug: LaTeX export #+NAME failing [8.3.1 (release_8.3.1-123-g823cad @ /home/amdavis/src/org-mode/lisp/)]
  2015-09-16 21:08   ` Andrew Davis
  2015-09-17  3:25     ` Benda Xu
@ 2015-09-17  7:16     ` Nicolas Goaziou
  1 sibling, 0 replies; 9+ messages in thread
From: Nicolas Goaziou @ 2015-09-17  7:16 UTC (permalink / raw)
  To: Andrew Davis; +Cc: emacs-orgmode

Andrew Davis <amdavis@uchicago.edu> writes:

> Could you just briefly let me know why this is a feature? I am
> assuming that this is so that org references are unique should you
> accidentally reuse a label?

The main reason is that it puts much less restrictions on the name of
internal links and is more portable across back-ends.

Regards,

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-09-17  7:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-15 20:08 Bug: LaTeX export #+NAME failing [8.3.1 (release_8.3.1-123-g823cad @ /home/amdavis/src/org-mode/lisp/)] Andrew Davis
2015-09-16 16:27 ` Nicolas Goaziou
2015-09-16 16:35   ` Andrew Davis
2015-09-16 17:17     ` Nicolas Goaziou
2015-09-16 17:30       ` Andrew Davis
2015-09-16 20:47         ` Nicolas Goaziou
2015-09-16 21:08   ` Andrew Davis
2015-09-17  3:25     ` Benda Xu
2015-09-17  7:16     ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).