From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: syntax highlighting for latex elements Date: Thu, 31 Mar 2011 16:35:30 +0100 Message-ID: <874o6j481p.fsf@ucl.ac.uk> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=54811 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5JuM-0007Nh-KY for emacs-orgmode@gnu.org; Thu, 31 Mar 2011 11:35:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q5JuL-0001xm-8r for emacs-orgmode@gnu.org; Thu, 31 Mar 2011 11:35:38 -0400 Received: from vscane-a2.ucl.ac.uk ([144.82.108.42]:48264) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q5JuL-0001xi-2p for emacs-orgmode@gnu.org; Thu, 31 Mar 2011 11:35:37 -0400 In-Reply-To: (Chris Beard's message of "Fri, 1 Apr 2011 00:18:37 +0900") 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: Chris Beard Cc: emacs-orgmode@gnu.org Chris Beard writes: > Hello, > After learning that I can output my Org documents (with tables, > outlined notes and all!) into LaTeX, I've started writing some notes > with the intention of exporting them to LaTeX. So I've been typing > stuff like (sorry, I'm not sure about the standard for formatting code > for emails): [...] > This stuff outputs fine to tex files, but one thing I'd like is LaTeX > syntax highlighting for things like \begin{...}\frac{...}\end{}. I can > get highlighting in code source blocks, but that gets exported in > verbatim environments in the LaTeX output. If I want syntax > highlighting for these things, should I just be editing a standard > .tex file with the appropriate emacs mode, or is there a (hopefully > simple) way to turn on syntax highlighting for LaTeX elements in > standard org-mode? > > Thank you > Chris You can enclose the latex: #+begin_latex \begin{equation} F_2(s) = \frac{r_1}{s+2} + \frac{r_2}{s+4} + \frac{r_3}{s+6}, \end{equation} #+end_latex Then, with point within this block, you can type C-c ' which will allow you to edit the latex in a latex-mode buffer with proper fontification. For source code blocks, you should be able to tell it to export the code as latex: #+begin_src latex :exports results :results latex \begin{equation} F_2(s) = \frac{r_1}{s+2} + \frac{r_2}{s+4} + \frac{r_3}{s+6}, \end{equation} #+end_src and you will get fortification within org-mode if you set org-src-fontify-natively to be t. However, there are (currently) some performance issues with this approach. -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 : using Org-mode version 7.5 (release_7.5.122.g2f72.dirty)