From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: LaTeX and syntax highlighting Date: Mon, 02 Feb 2009 13:55:13 +0100 Message-ID: <87tz7dkngu.fsf@kassiopeya.MSHEIMNETZ> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LTyHv-0001Qa-AS for emacs-orgmode@gnu.org; Mon, 02 Feb 2009 07:52:31 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LTyHt-0001QO-Su for emacs-orgmode@gnu.org; Mon, 02 Feb 2009 07:52:31 -0500 Received: from [199.232.76.173] (port=38658 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LTyHt-0001QL-QG for emacs-orgmode@gnu.org; Mon, 02 Feb 2009 07:52:29 -0500 Received: from mail.gmx.net ([213.165.64.20]:49379) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1LTyHr-0000Zw-HE for emacs-orgmode@gnu.org; Mon, 02 Feb 2009 07:52:29 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode Org-Mode Hi all, I just discovered writing LaTeX through OrgMode. It's _really_ great! Only missing thingy is just something like htmlize.el to hihglight code syntax. Currently my codes look like this here: \begin{codeblock} \openbrace \variable{action}: \dqstring{newMap}, \doindent \variable{instance}: INSTANZ\_NAME, \comment{/* Instanzname dies= er VMap */} \doindent \variable{x}: INT\_X, \comment{/* X-Wert in Pixeln der gew=C3=BCn= schten Zoomstufe */} \doindent \variable{y}: INT\_Y, \comment{/* Y-Wert in Pixeln der gew=C3=BCn= schten Zoomstufe */} \doindent \variable{z}: INT\_Z, \comment{/* Gew=C3=BCnschte Zoomstufe */} \doindent \variable{rID}: AKTUELLES\_STANDARD\_HIGHLIGHT, \doindent \variable{type}: TYPE \comment{/* Aktiver Hotel-Typ-Filter */} \closebrace \end{codeblock} In my headers I include my /home/sebastian/develop/lib/latex/code.tex which does all the formating and stuff (uses the `ifthen' package for the indentation stuff) and simply sets some faces and defines the environment `codeblock'. I wonder if it wouldn't be easy to extend htmlize.el to do this formating for me. While this is nice to have, since I can use syntaxhighlighting in headlines this way (document code), I found out about listings.el, which seems to be part of the texlive distibution (at least I can `usepackage' it here without extra installations). See http://www.ctan.org/tex-archive/macros/latex/contrib/listings/listings.pdf It supports refs to linenumbers, supports lots of languages and so on. With the listings package we could convert #+begin_src emacs-lisp ... #+end_src to \begin{lstlisting}[language=3DLisp] \dots \end{lstlisting} Could something like this be in org-blocks.el or similar? We could then export highlighted stuff to LaTeX and HTML from the same file. Regards, --=20 Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover Tel.: +49 (0)511 - 36 58 472 Fax: +49 (0)1805 - 233633 - 11044 mobil: +49 (0)173 - 83 93 417 Http: www.emma-stil.de