all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [org-babel] Bug in org-babel-latex when writing to PDF
@ 2010-06-14 18:04 William Henney
  2010-06-14 18:17 ` Eric Schulte
  0 siblings, 1 reply; 7+ messages in thread
From: William Henney @ 2010-06-14 18:04 UTC (permalink / raw)
  To: emacs-org

Hi all

If I have a snippet like so:

#+begin_src latex :file foo.png
Hello from org-babel!
#+end_src

then I can execute the source block with no problems, producing the
image foo.png.

However, if I change the filename to foo.pdf then it no longer works.

An intermediate .tex file is produced that contains the line

\usepackage[AUTO]{inputenc}

which causes latex to fail. Presumably, the string "AUTO" should have
been expanded to something, but it wasn't.

This is with yesterday's org-mode and emacs 23.2.1, aquamacs 2.0

Cheers

Will


-- 

  Dr William Henney, Centro de Radioastronomía y Astrofísica,
  Universidad Nacional Autónoma de México, Campus Morelia

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

* Re: [org-babel] Bug in org-babel-latex when writing to PDF
  2010-06-14 18:04 [org-babel] Bug in org-babel-latex when writing to PDF William Henney
@ 2010-06-14 18:17 ` Eric Schulte
  2010-06-14 19:52   ` Sébastien Vauban
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Eric Schulte @ 2010-06-14 18:17 UTC (permalink / raw)
  To: William Henney; +Cc: emacs-org

Hi William,

Your code snippet exports as expected for me using the latest version of
Org-mode.

What values do you have set for the
  `org-export-latex-default-packages-alist' and
  `org-export-latex-packages-alist'
variables?

My guess is that the problem could be in a rogue entry in one of those
values.  If you'd like to re try with (a subset of) my settings you can
by evaluating the following elisp.

--8<---------------cut here---------------start------------->8---
(setq org-export-latex-default-packages-alist
      '(("" "inputenc")
        ("T1" "fontenc" t)
        ("" "fixltx2e" nil)
        ("" "graphicx" t)
        ("" "longtable" nil)
        ("" "float" nil)
        ("" "wrapfig" nil)
        ("" "soul" t)
        ("" "t1enc" t)
        ("" "textcomp" t)
        ("" "marvosym" t)
        ("" "wasysym" t)
        ("" "latexsym" t)
        ("" "amssymb" t)
        ("" "hyperref" nil)
        "\\tolerance=1000"))
(setq org-export-latex-default-packages-alist '())
--8<---------------cut here---------------end--------------->8---

Best -- Eric

William Henney <whenney@gmail.com> writes:

> Hi all
>
> If I have a snippet like so:
>
> #+begin_src latex :file foo.png
> Hello from org-babel!
> #+end_src
>
> then I can execute the source block with no problems, producing the
> image foo.png.
>
> However, if I change the filename to foo.pdf then it no longer works.
>
> An intermediate .tex file is produced that contains the line
>
> \usepackage[AUTO]{inputenc}
>
> which causes latex to fail. Presumably, the string "AUTO" should have
> been expanded to something, but it wasn't.
>
> This is with yesterday's org-mode and emacs 23.2.1, aquamacs 2.0
>
> Cheers
>
> Will

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

* Re: [org-babel] Bug in org-babel-latex when writing to PDF
  2010-06-14 18:17 ` Eric Schulte
@ 2010-06-14 19:52   ` Sébastien Vauban
  2010-06-14 20:32   ` Eric Schulte
  2010-06-14 21:22   ` William Henney
  2 siblings, 0 replies; 7+ messages in thread
From: Sébastien Vauban @ 2010-06-14 19:52 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Eric,

"Eric Schulte" wrote:
> [...] try with (a subset of) my settings you can by evaluating the following
> elisp.
>
> (setq org-export-latex-default-packages-alist
>       '(("" "inputenc")
>         ("T1" "fontenc" t)
>         ("" "fixltx2e" nil)
>         ("" "graphicx" t)
>         ("" "longtable" nil)
>         ("" "float" nil)
>         ("" "wrapfig" nil)
>         ("" "soul" t)
>         ("" "t1enc" t)
>         ("" "textcomp" t)
>         ("" "marvosym" t)
>         ("" "wasysym" t)
>         ("" "latexsym" t)
>         ("" "amssymb" t)
>         ("" "hyperref" nil)
>         "\\tolerance=1000"))
> (setq org-export-latex-default-packages-alist '())

Aren't these 2 lines a bit contradictory, addressing the same var?

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [org-babel] Bug in org-babel-latex when writing to PDF
  2010-06-14 18:17 ` Eric Schulte
  2010-06-14 19:52   ` Sébastien Vauban
@ 2010-06-14 20:32   ` Eric Schulte
  2010-06-14 21:22   ` William Henney
  2 siblings, 0 replies; 7+ messages in thread
From: Eric Schulte @ 2010-06-14 20:32 UTC (permalink / raw)
  To: William Henney; +Cc: emacs-org

typo in my previous mail -- see below

"Eric Schulte" <schulte.eric@gmail.com> writes:

[...]
> (setq org-export-latex-default-packages-alist
>       '(("" "inputenc")
>         ("T1" "fontenc" t)
>         ("" "fixltx2e" nil)
>         ("" "graphicx" t)
>         ("" "longtable" nil)
>         ("" "float" nil)
>         ("" "wrapfig" nil)
>         ("" "soul" t)
>         ("" "t1enc" t)
>         ("" "textcomp" t)
>         ("" "marvosym" t)
>         ("" "wasysym" t)
>         ("" "latexsym" t)
>         ("" "amssymb" t)
>         ("" "hyperref" nil)
>         "\\tolerance=1000"))
> (setq org-export-latex-default-packages-alist '())

should have been

--8<---------------cut here---------------start------------->8---
(setq org-export-latex-default-packages-alist
      '(("" "inputenc")
        ("T1" "fontenc" t)
        ("" "fixltx2e" nil)
        ("" "graphicx" t)
        ("" "longtable" nil)
        ("" "float" nil)
        ("" "wrapfig" nil)
        ("" "soul" t)
        ("" "t1enc" t)
        ("" "textcomp" t)
        ("" "marvosym" t)
        ("" "wasysym" t)
        ("" "latexsym" t)
        ("" "amssymb" t)
        ("" "hyperref" nil)
        "\\tolerance=1000"))
(setq org-export-latex-packages-alist '())
--8<---------------cut here---------------end--------------->8---

Best -- Eric

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

* Re: [org-babel] Bug in org-babel-latex when writing to PDF
  2010-06-14 18:17 ` Eric Schulte
  2010-06-14 19:52   ` Sébastien Vauban
  2010-06-14 20:32   ` Eric Schulte
@ 2010-06-14 21:22   ` William Henney
  2010-06-14 21:46     ` Eric Schulte
  2 siblings, 1 reply; 7+ messages in thread
From: William Henney @ 2010-06-14 21:22 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-org

Hi Eric

Thanks for your response

On Mon, Jun 14, 2010 at 1:17 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
> Your code snippet exports as expected for me using the latest version of
> Org-mode.
>
> What values do you have set for the
>  `org-export-latex-default-packages-alist' and
>  `org-export-latex-packages-alist'
> variables?
>
> My guess is that the problem could be in a rogue entry in one of those
> values.  If you'd like to re try with (a subset of) my settings you can
> by evaluating the following elisp.

I see the error even when I start a vanilla emacs with no
customizations. Yes, you are right that
org-export-latex-default-packages-alist is the culprit, but the
problem is with the default value of this variable. You do not see the
problem because you have overwritten that variable to remove the
problematic part!

The default value of org-export-latex-default-packages-alist, as
defined on line 3076 of org.el, begins

(("AUTO" "inputenc" t)
 ("T1" "fontenc" t)
 ... etc ...

This works fine in the normal latex export, since the string AUTO gets
replaced by the correct file encoding, but this is not being done in
org-babel-latex.

It looks like the function that should be used is
org-export-latex-fix-inputenc, which is defined in org-latex.el

Cheers

Will




-- 

  Dr William Henney, Centro de Radioastronomía y Astrofísica,
  Universidad Nacional Autónoma de México, Campus Morelia

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

* Re: [org-babel] Bug in org-babel-latex when writing to PDF
  2010-06-14 21:22   ` William Henney
@ 2010-06-14 21:46     ` Eric Schulte
  2010-06-15 14:46       ` William Henney
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Schulte @ 2010-06-14 21:46 UTC (permalink / raw)
  To: William Henney; +Cc: emacs-org

William Henney <whenney@gmail.com> writes:

> Hi Eric
>
> Thanks for your response
>
> On Mon, Jun 14, 2010 at 1:17 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
>> Your code snippet exports as expected for me using the latest version of
>> Org-mode.
>>
>> What values do you have set for the
>>  `org-export-latex-default-packages-alist' and
>>  `org-export-latex-packages-alist'
>> variables?
>>
>> My guess is that the problem could be in a rogue entry in one of those
>> values.  If you'd like to re try with (a subset of) my settings you can
>> by evaluating the following elisp.
>
> I see the error even when I start a vanilla emacs with no
> customizations. Yes, you are right that
> org-export-latex-default-packages-alist is the culprit, but the
> problem is with the default value of this variable. You do not see the
> problem because you have overwritten that variable to remove the
> problematic part!
>

AH, you're right!  I have(had) the following in my customization
--8<---------------cut here---------------start------------->8---
;; pull a bad package out of `org-export-latex-default-packages-alist'
(setq org-export-latex-default-packages-alist
      (mapcar (lambda (el)
                (if (and (listp el) (string= "AUTO" (car el)))
                    (list "" (cadr el)) el))
              org-export-latex-default-packages-alist))
--8<---------------cut here---------------end--------------->8---

>
> The default value of org-export-latex-default-packages-alist, as
> defined on line 3076 of org.el, begins
>
> (("AUTO" "inputenc" t)
>  ("T1" "fontenc" t)
>  ... etc ...
>
> This works fine in the normal latex export, since the string AUTO gets
> replaced by the correct file encoding, but this is not being done in
> org-babel-latex.
>
> It looks like the function that should be used is
> org-export-latex-fix-inputenc, which is defined in org-latex.el
>

Great, thanks for hunting this down, I've changed org-babel-latex.el to
call the function you mentioned above and everything appears to be
working.

Many Thanks -- Eric

>
> Cheers
>
> Will

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

* Re: [org-babel] Bug in org-babel-latex when writing to PDF
  2010-06-14 21:46     ` Eric Schulte
@ 2010-06-15 14:46       ` William Henney
  0 siblings, 0 replies; 7+ messages in thread
From: William Henney @ 2010-06-15 14:46 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-org

Hi Eric

On Mon, Jun 14, 2010 at 4:46 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
> Great, thanks for hunting this down, I've changed org-babel-latex.el to
> call the function you mentioned above and everything appears to be
> working.
>

I confirm that org-babel export of latex snippets to pdf now works as
advertised. Thanks!

Cheers

Will

-- 

  Dr William Henney, Centro de Radioastronomía y Astrofísica,
  Universidad Nacional Autónoma de México, Campus Morelia

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

end of thread, other threads:[~2010-06-15 14:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-14 18:04 [org-babel] Bug in org-babel-latex when writing to PDF William Henney
2010-06-14 18:17 ` Eric Schulte
2010-06-14 19:52   ` Sébastien Vauban
2010-06-14 20:32   ` Eric Schulte
2010-06-14 21:22   ` William Henney
2010-06-14 21:46     ` Eric Schulte
2010-06-15 14:46       ` William Henney

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.