emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] SOLVED: source code block language 'makefile' and listings package


From: Rainer M Krug
Subject: [O] SOLVED: source code block language 'makefile' and listings package
Date: Tue, 08 Jul 2014 11:51:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin)

address@hidden (Thomas S. Dye) writes:

> Aloha Rainer,
>
> Rainer M Krug <address@hidden> writes:
>
>> Hi
>>
>> I used the source block language 'makefile'
>>
>> #+begin_src R makefile
>> ...
>> #+end_src
>>
>> and now I would like top export this block to html. I am using the
>> listings package for this, and it supports the syntax, but the
>> language is called 'make', while org uses 'makefile'
>>
>> Is there a way of telling the tex exporter to export 'makefile' blocks
>> as language 'make', or can I easily tell listings that the language
>> 'makefile' is equal to 'make'?
>
> You can configure the listings package with the commands
> \lstnewenvironment and \lstset.  There is a worked example here:
>
> http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-12-4

Much simpler then that: I simply changed the variable
org-latex-listings-langs to include makefile:

,----
| (setq org-latex-listings-langs 
|       '((emacs-lisp "Lisp") 
|         (lisp "Lisp") 
|         (clojure "Lisp") 
|         (c "C") 
|         (cc "C++") 
|         (fortran "fortran") 
|         (perl "Perl") 
|         (cperl "Perl")
|         (python "Python")
|         (ruby "Ruby")
|         (html "HTML")
|         (xml "XML")
|         (tex "TeX")
|         (latex "[LaTeX]TeX")
|         (shell-script "bash")
|         (gnuplot "Gnuplot")
|         (ocaml "Caml")
|         (caml "Caml")
|         (sql "SQL")
|         (sqlite "sql")
|         (makefile "make")))
`----

Works perfectly.

Now if I just could figure out on how I can simply *add* the makefile to
the list without defining it completely new..

Cheers,

Rainer

>
> hth,
> Tom

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      address@hidden

Skype:      RMkrug

PGP: 0x0F52F982

Attachment: pgpxWshF_mHWr.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]