emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* BUG: Export images to LaTeX
@ 2011-10-21 21:22 Anthony Lander
       [not found] ` <12962.1319239571@alphaville.americas.hpqcorp.net>
  2011-10-22 13:42 ` Bastien
  0 siblings, 2 replies; 6+ messages in thread
From: Anthony Lander @ 2011-10-21 21:22 UTC (permalink / raw)
  To: emacs-orgmode Mode

Hi List,

I've run into a strange problem with the latest org pull. Exporting inlined images with the LaTeX exporter works or not depending on whether I include org-jsinfo in org-modules(!). This is with emacs -q on the 24.0.90.1 emacs recent release.

Can someone please try to reproduce this to confirm?

Thanks,

-Anthony


My test file is:

* Test
  [[file:test.png]]

Output with org-jsinfo module loaded is as expected:

\begin{document}

\maketitle


\section*{Test}
\label{sec-1}

 \includegraphics[width=.9\linewidth]{test.png}

\end{document}

But without org-jsinfo, I get a (broken) hyperlink instead:


\begin{document}

\maketitle


\section*{Test}
\label{sec-1}

 \href{t}{file:test.png}

\end{document}

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

* Re: BUG: Export images to LaTeX
       [not found] ` <12962.1319239571@alphaville.americas.hpqcorp.net>
@ 2011-10-22 11:53   ` Anthony Lander
  2011-10-22 14:12     ` Bernt Hansen
  2011-10-22 19:45     ` Nick Dokos
  0 siblings, 2 replies; 6+ messages in thread
From: Anthony Lander @ 2011-10-22 11:53 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode Mode


On 11-Oct-21, at 7:26 PM, Nick Dokos wrote:

> Anthony Lander <anthonylander@yahoo.com> wrote:
> 
>> Hi List,
>> 
>> I've run into a strange problem with the latest org pull. Exporting inlined images with the LaTeX exporter works or not depending on whether I include org-jsinfo in org-modules(!). This is with emacs -q on the 24.0.90.1 emacs recent release.
>> 
>> Can someone please try to reproduce this to confirm?
> 
> Pretty weird - I can reproduce this by omitting org-jsinfo from org-modules and 
> starting with a minimal .emacs.

Thanks for reproducing this. It is indeed weird, as you describe below. 

Unfortunately, I pull infrequently, so I can't really narrow down when it started happening.

  -Anthony

> 
> But there seems to be something else as well: after the export (where I get the
> href link that Anthony mentions) I require org-jsinfo and reexport and get the
> \includegraphics, again as mentioned. I then unload-feature org-jsinfo, and
> try again: I get an error because org-export-options-filters now contains a function
> from org-jsinfo that is no longer present. So I reset org-export-options-filters back
> to nil: this time the reexport succeeds, but I get the \includegraphics, not the \href:
> the act of loading and unloading org-jsinfo seems to have changed the state enough
> so that latex export now does the right thing.
> 
> And no, it's not a remnant of the previous export: I delete the .tex file and recreate
> it in this last case.
> 
> Nick
> 

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

* Re: BUG: Export images to LaTeX
  2011-10-21 21:22 BUG: Export images to LaTeX Anthony Lander
       [not found] ` <12962.1319239571@alphaville.americas.hpqcorp.net>
@ 2011-10-22 13:42 ` Bastien
  1 sibling, 0 replies; 6+ messages in thread
From: Bastien @ 2011-10-22 13:42 UTC (permalink / raw)
  To: Anthony Lander; +Cc: emacs-orgmode Mode

Hi Anthony,

Anthony Lander <anthonylander@yahoo.com> writes:

> I've run into a strange problem with the latest org pull. Exporting
> inlined images with the LaTeX exporter works or not depending on
> whether I include org-jsinfo in org-modules(!). This is with emacs -q
> on the 24.0.90.1 emacs recent release.
>
> Can someone please try to reproduce this to confirm?

Mhh.. I don't have org-infojs in org-modules and I cannot 
reproduce this -- anyone else?  

-- 
 Bastien

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

* Re: BUG: Export images to LaTeX
  2011-10-22 11:53   ` Anthony Lander
@ 2011-10-22 14:12     ` Bernt Hansen
  2011-10-22 14:21       ` Jambunathan K
  2011-10-22 19:45     ` Nick Dokos
  1 sibling, 1 reply; 6+ messages in thread
From: Bernt Hansen @ 2011-10-22 14:12 UTC (permalink / raw)
  To: Anthony Lander; +Cc: nicholas.dokos, emacs-orgmode Mode

Anthony Lander <anthonylander@yahoo.com> writes:

> On 11-Oct-21, at 7:26 PM, Nick Dokos wrote:
>
>> Anthony Lander <anthonylander@yahoo.com> wrote:
>> 
>>> I've run into a strange problem with the latest org pull. Exporting
>>> inlined images with the LaTeX exporter works or not depending on
>>> whether I include org-jsinfo in org-modules(!). This is with emacs
>>> -q on the 24.0.90.1 emacs recent release.
>>> 
>>> Can someone please try to reproduce this to confirm?
>> 
>> Pretty weird - I can reproduce this by omitting org-jsinfo from org-modules and 
>> starting with a minimal .emacs.
>
> Thanks for reproducing this. It is indeed weird, as you describe below. 
>
> Unfortunately, I pull infrequently, so I can't really narrow down when it started happening.
>
>   -Anthony

You can use git bisect to identify the commit that caused the breakage.

ORIG_HEAD should point at the commit you used to be on before your last
pull.

-Bernt

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

* Re: BUG: Export images to LaTeX
  2011-10-22 14:12     ` Bernt Hansen
@ 2011-10-22 14:21       ` Jambunathan K
  0 siblings, 0 replies; 6+ messages in thread
From: Jambunathan K @ 2011-10-22 14:21 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode Mode

>> Unfortunately, I pull infrequently, so I can't really narrow down
>> when it started happening.
>>
>>   -Anthony
>
> You can use git bisect to identify the commit that caused the breakage.
>
> ORIG_HEAD should point at the commit you used to be on before your last
> pull.

I frequently use

git reflog --date=relative

to see my git activity.

> -Bernt
>
>

-- 

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

* Re: BUG: Export images to LaTeX
  2011-10-22 11:53   ` Anthony Lander
  2011-10-22 14:12     ` Bernt Hansen
@ 2011-10-22 19:45     ` Nick Dokos
  1 sibling, 0 replies; 6+ messages in thread
From: Nick Dokos @ 2011-10-22 19:45 UTC (permalink / raw)
  To: Anthony Lander; +Cc: nicholas.dokos, emacs-orgmode Mode

Anthony Lander <anthonylander@yahoo.com> wrote:

> 
> On 11-Oct-21, at 7:26 PM, Nick Dokos wrote:
> 
> > Anthony Lander <anthonylander@yahoo.com> wrote:
> > 
> >> Hi List,
> >> 
> >> I've run into a strange problem with the latest org pull. Exporting inlined images with the LaTeX exporter works or not depending on whether I include org-jsinfo in org-modules(!). This is with emacs -q on the 24.0.90.1 emacs recent release.
> >> 
> >> Can someone please try to reproduce this to confirm?
> > 
> > Pretty weird - I can reproduce this by omitting org-jsinfo from org-modules and 
> > starting with a minimal .emacs.
> 
> Thanks for reproducing this. It is indeed weird, as you describe below. 
> 
> Unfortunately, I pull infrequently, so I can't really narrow down when it started happening.
> 
>   -Anthony
> 
> > 
> > But there seems to be something else as well: after the export (where I get the
> > href link that Anthony mentions) I require org-jsinfo and reexport and get the
> > \includegraphics, again as mentioned. I then unload-feature org-jsinfo, and
> > try again: I get an error because org-export-options-filters now contains a function
> > from org-jsinfo that is no longer present. So I reset org-export-options-filters back
> > to nil: this time the reexport succeeds, but I get the \includegraphics, not the \href:
> > the act of loading and unloading org-jsinfo seems to have changed the state enough
> > so that latex export now does the right thing.
> > 
> > And no, it's not a remnant of the previous export: I delete the .tex file and recreate
> > it in this last case.
> > 


Oy, vey: this was painful (and I'm still not sure I got it right):
setting export options for the various backends looks like the Wild
West - everybody takes the law into his own hands and becomes judge,
jury and executioner.

The whole thing hinges on the value of :inline-images in the export
options plist: without org-jsinfo in the picture, this turns out to be
nil in the latex exporter, but with org-jsinfo, it becomes 'maybe and
that's enough to make the difference you observe.

Part of the weirdness seems to be [fn:1] that :inline-images originated
in the html exporter and then was pressed into action in the latex
exporter - the proverbial panda's thumb.

When org-jsinfo is loaded, it adds org-jsinfo-handle-options to
org-export-options-filters and that adds :inline-info 'maybe to the
latex default export options plist. The latex exporter then "works":
even when org-jsinfo is unloaded, org-export-latex-options-plist still
contains the :inline-images 'maybe setting. This is the kind of side
effect that makes the hair in the back of my neck stand up in horror :-)

But with all the the ways of getting options into the export plist,
I couldn't find a good way to do it for latex. I think that the
best way is to imitate what jsinfo does and add an options handler
to org-export-options-filters, say org-latex-handle-options. These
functions take a plist as input, modify it and return the modified
list as their output, something like this:

--8<---------------cut here---------------start------------->8---
(defun org-latex-handle-options (exp-plist)
  (let ((inlineimg (plist-get exp-plist :inline-images)))
    (if inlineimg
	exp-plist
      (plist-put exp-plist :inline-images t))))

(add-to-list 'org-export-options-filters (function org-latex-handle-options))
--8<---------------cut here---------------end--------------->8---

But I think the whole area of export options needs a radical reorg and
cleanup.

Nick

Footnotes:

[fn:1] this is pure conjecture on my part

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

end of thread, other threads:[~2011-10-22 19:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-21 21:22 BUG: Export images to LaTeX Anthony Lander
     [not found] ` <12962.1319239571@alphaville.americas.hpqcorp.net>
2011-10-22 11:53   ` Anthony Lander
2011-10-22 14:12     ` Bernt Hansen
2011-10-22 14:21       ` Jambunathan K
2011-10-22 19:45     ` Nick Dokos
2011-10-22 13:42 ` Bastien

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).