From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Wishlist: indicate language in LaTeX export of literal source examples Date: Mon, 08 Feb 2010 19:11:55 -0700 Message-ID: <87ocjzi2dw.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nefa5-0004Zt-Gv for emacs-orgmode@gnu.org; Mon, 08 Feb 2010 21:12:01 -0500 Received: from [199.232.76.173] (port=60597 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nefa5-0004Zl-61 for emacs-orgmode@gnu.org; Mon, 08 Feb 2010 21:12:01 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nefa4-00016B-79 for emacs-orgmode@gnu.org; Mon, 08 Feb 2010 21:12:00 -0500 Received: from mail-pz0-f188.google.com ([209.85.222.188]:62332) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nefa3-000167-Tg for emacs-orgmode@gnu.org; Mon, 08 Feb 2010 21:12:00 -0500 Received: by pzk26 with SMTP id 26so7664816pzk.26 for ; Mon, 08 Feb 2010 18:11:58 -0800 (PST) In-Reply-To: (Hsiu-Khuern Tang's message of "Mon, 8 Feb 2010 16:10:34 -0800") 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: Hsiu-Khuern Tang Cc: emacs-orgmode@gnu.org Hi Hsiu-Khuern, This may be overkill, but you could try the following which will indicate the source-code language in the generated .tex ;; tell org to use listings (setq org-export-latex-listings t) If you actually want to use the listings package you can also include the following ;; you must include the listings package (add-to-list 'org-export-latex-packages-alist '("" "listings")) ;; if you want colored source code then you need to include the color package (add-to-list 'org-export-latex-packages-alist '("" "color")) in either case a block such as #+begin_src R ... #+end_src will export to \lstset{language=R} \begin{lstlisting} ... \end{lstlisting} Best -- Eric Hsiu-Khuern Tang writes: > (Resending because of earlier problems -- my apologies if this is a duplicate!) > > Hi, > > Currently, literal examples (#+BEGIN_EXAMPLE and #+BEGIN_SRC) are exported to > > \begin{verbatim} > ... > \end{verbatim} > > in LaTeX. For #+BEGIN_SRC blocks, could we indicate the language in a > LaTeX comment, e.g., > > #+BEGIN_SRC R > ... > #+END_SRC > > becomes > > % R > \begin{verbatim} > ... > \end{verbatim} > > > I'm trying to post-process the LaTeX output, and knowing the language would > help me. > > Thanks! > > -- > Best, > Hsiu-Khuern. > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode