emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] Bug in output PDF with source blocks of unknown language
@ 2010-01-13 16:04 Sébastien Vauban
  2010-01-13 16:21 ` Eric Schulte
  0 siblings, 1 reply; 3+ messages in thread
From: Sébastien Vauban @ 2010-01-13 16:04 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Eric and Dan,

--8<---------------cut here---------------start------------->8---
#+TITLE:     Bug in output PDF with source blocks of unknown language
#+AUTHOR:    Seb Vauban
#+EMAIL:     no-LMehjL4SQ+Y@public.gmane.org
#+DATE:      2010-01-13
#+DESCRIPTION: 
#+KEYWORDS: 
#+LANGUAGE:  en_US

* Context

  Here is a perfectly outputted block of code:

#+SRCNAME: srcModifyDBPFI.sql
#+BEGIN_SRC sql :tangle srcModifyDBPFI.sql
    -- add column `rolEngagDateFin' (if column does not exist yet)
    IF NOT EXISTS (SELECT *
                   FROM INFORMATION_SCHEMA.COLUMNS
                   WHERE TABLE_NAME = 'rol'
                   AND COLUMN_NAME = 'rolEngagDateFin')
    BEGIN
        ALTER TABLE rol
        ADD rolEngagDateFin smalldatetime NULL
    END
    GO
#+END_SRC

  Here is an Excel formula (using highlighting of Delphi, being quite
  similar -- but *unknown to Babel*):

#+BEGIN_SRC Delphi
    (frmDateFin+1)+(frmNbrSem+frmDureeVA*0)*7-1
#+END_SRC

  and its simplified version:

#+BEGIN_SRC perl
    frmDateFin+(frmNbrSem*7)
#+END_SRC

* Bug

  You see that when the language is unknown to Org-babel (=Delphi= in this
  example), it gets ignored during export, and gets replaced by the previous
  code block!!

  So, the current workaround is to take whatever other language know to Babel
  (here: =perl=) for the export to (at least) output the right code in the
  generated document (even if not correctly highlighted).

* Other problem

  The selected language must also be known by =listings=... Hence, =R= cannot
  be chosen for language; generating otherwise an error when compiling the
  LaTeX document.
--8<---------------cut here---------------end--------------->8---

Best regards,
  Seb

PS- I'll answer your posts shortly (Noweb vs Babel, and incompatibility with
    Org-special-blocks). Have had no time up to now...

-- 
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] 3+ messages in thread

* Re: [babel] Bug in output PDF with source blocks of unknown language
  2010-01-13 16:04 [babel] Bug in output PDF with source blocks of unknown language Sébastien Vauban
@ 2010-01-13 16:21 ` Eric Schulte
  2010-01-18 23:55   ` Eric Schulte
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Schulte @ 2010-01-13 16:21 UTC (permalink / raw)
  To: Sébastien Vauban; +Cc: emacs-orgmode

Hi Sébastien,

Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:

[...]

> * Bug
>
>   You see that when the language is unknown to Org-babel (=Delphi= in this
>   example), it gets ignored during export, and gets replaced by the previous
>   code block!!
>
>   So, the current workaround is to take whatever other language know to Babel
>   (here: =perl=) for the export to (at least) output the right code in the
>   generated document (even if not correctly highlighted).
>

Oh, that certainly is a problem!  Thanks for reporting I'll take a look.
For reference it's being tracked as a bug on our development page here

http://eschulte.github.com/babel-dev/TODO-on-export-babel-overwrites-unrecognized-source-blocks.html

>
> * Other problem
>
>   The selected language must also be known by =listings=... Hence, =R= cannot
>   be chosen for language; generating otherwise an error when compiling the
>   LaTeX document.
>

This should be an easier fix.  It is possible to add listings alias by
adding an entry to the `org-src-lang-modes' variable.

,----[org-src-lang-modes]
| org-src-lang-modes is a variable defined in `org-src.el'.
| Its value is 
| (("ocaml" . tuareg)
|  ("elisp" . emacs-lisp)
|  ("ditaa" . artist)
|  ("asymptote" . asy)
|  ("dot" . fundamental))
| 
| 
| Documentation:
| Alist mapping languages to their major mode.
| The key is the language name, the value is the string that should
| be inserted as the name of the major mode.  For many languages this is
| simple, but for language where this is not the case, this variable
| provides a way to simplify things on the user side.
| For example, there is no ocaml-mode in Emacs, but the mode to use is
| `tuareg-mode'.
| 
| You can customize this variable.
`----

Best -- Eric

>
> Best regards,
>   Seb
>
> PS- I'll answer your posts shortly (Noweb vs Babel, and incompatibility with
>     Org-special-blocks). Have had no time up to now...

I look forward to your reply when you do have time (no rush) -- notice
I've made a slight change to the look of the source names when exported
to LaTeX.

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

* Re: [babel] Bug in output PDF with source blocks of unknown language
  2010-01-13 16:21 ` Eric Schulte
@ 2010-01-18 23:55   ` Eric Schulte
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Schulte @ 2010-01-18 23:55 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Sébastien Vauban, emacs-orgmode

This should now be fixed.

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

> Hi Sébastien,
>
> Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:
>
> [...]
>
>> * Bug
>>
>>   You see that when the language is unknown to Org-babel (=Delphi= in this
>>   example), it gets ignored during export, and gets replaced by the previous
>>   code block!!
>>
>>   So, the current workaround is to take whatever other language know to Babel
>>   (here: =perl=) for the export to (at least) output the right code in the
>>   generated document (even if not correctly highlighted).
>>
>
> Oh, that certainly is a problem!  Thanks for reporting I'll take a look.
> For reference it's being tracked as a bug on our development page here
>
> http://eschulte.github.com/babel-dev/TODO-on-export-babel-overwrites-unrecognized-source-blocks.html
>
>>
>> * Other problem
>>
>>   The selected language must also be known by =listings=... Hence, =R= cannot
>>   be chosen for language; generating otherwise an error when compiling the
>>   LaTeX document.
>>
>
> This should be an easier fix.  It is possible to add listings alias by
> adding an entry to the `org-src-lang-modes' variable.
>
> ,----[org-src-lang-modes]
> | org-src-lang-modes is a variable defined in `org-src.el'.
> | Its value is 
> | (("ocaml" . tuareg)
> |  ("elisp" . emacs-lisp)
> |  ("ditaa" . artist)
> |  ("asymptote" . asy)
> |  ("dot" . fundamental))
> | 
> | 
> | Documentation:
> | Alist mapping languages to their major mode.
> | The key is the language name, the value is the string that should
> | be inserted as the name of the major mode.  For many languages this is
> | simple, but for language where this is not the case, this variable
> | provides a way to simplify things on the user side.
> | For example, there is no ocaml-mode in Emacs, but the mode to use is
> | `tuareg-mode'.
> | 
> | You can customize this variable.
> `----
>
> Best -- Eric
>
>>
>> Best regards,
>>   Seb
>>
>> PS- I'll answer your posts shortly (Noweb vs Babel, and incompatibility with
>>     Org-special-blocks). Have had no time up to now...
>
> I look forward to your reply when you do have time (no rush) -- notice
> I've made a slight change to the look of the source names when exported
> to LaTeX.

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

end of thread, other threads:[~2010-01-18 23:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-13 16:04 [babel] Bug in output PDF with source blocks of unknown language Sébastien Vauban
2010-01-13 16:21 ` Eric Schulte
2010-01-18 23:55   ` Eric Schulte

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