emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* LaTeX and syntax highlighting
@ 2009-02-02 12:55 Sebastian Rose
  2009-02-11 14:10 ` Carsten Dominik
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Rose @ 2009-02-02 12:55 UTC (permalink / raw)
  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 dieser VMap */}
\doindent \variable{x}: INT\_X, \comment{/* X-Wert in Pixeln der gewünschten Zoomstufe */}
\doindent \variable{y}: INT\_Y, \comment{/* Y-Wert in Pixeln der gewünschten Zoomstufe */}
\doindent \variable{z}: INT\_Z, \comment{/* Gewünschte 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=Lisp]
\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,

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

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

* Re: LaTeX and syntax highlighting
  2009-02-02 12:55 LaTeX and syntax highlighting Sebastian Rose
@ 2009-02-11 14:10 ` Carsten Dominik
  0 siblings, 0 replies; 2+ messages in thread
From: Carsten Dominik @ 2009-02-11 14:10 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: emacs-orgmode Org-Mode


On Feb 2, 2009, at 1:55 PM, Sebastian Rose wrote:

> 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 dieser VMap */}
> \doindent \variable{x}: INT\_X, \comment{/* X-Wert in Pixeln der  
> gewünschten Zoomstufe */}
> \doindent \variable{y}: INT\_Y, \comment{/* Y-Wert in Pixeln der  
> gewünschten Zoomstufe */}
> \doindent \variable{z}: INT\_Z, \comment{/* Gewünschte 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=Lisp]
> \dots
> \end{lstlisting}
>

This is not hard to implement, the biggest obstacle being
a list translating Emacs major mode names used for htmlize
into the language names used by the listings package.
Would you like to make such a list?

- Carsten

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

end of thread, other threads:[~2009-02-11 14:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-02 12:55 LaTeX and syntax highlighting Sebastian Rose
2009-02-11 14:10 ` Carsten Dominik

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