From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: listings and the new LaTeX exporter Date: Thu, 24 May 2012 22:58:36 +0200 Message-ID: <8762blwb2b.fsf@med.uni-goettingen.de> References: <87aa0xwe9c.fsf@med.uni-goettingen.de> <81zk8xxrpy.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:47566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXf8M-0005xx-2z for emacs-orgmode@gnu.org; Thu, 24 May 2012 16:59:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXf8J-00056W-VI for emacs-orgmode@gnu.org; Thu, 24 May 2012 16:59:45 -0400 Received: from plane.gmane.org ([80.91.229.3]:34548) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXf8J-00056I-E3 for emacs-orgmode@gnu.org; Thu, 24 May 2012 16:59:43 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SXf8D-0003sj-Qv for emacs-orgmode@gnu.org; Thu, 24 May 2012 22:59:37 +0200 Received: from vpn-2031.gwdg.de ([134.76.2.31]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 May 2012 22:59:37 +0200 Received: from andreas.leha by vpn-2031.gwdg.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 May 2012 22:59:37 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi Jambunathan, > M-x customize-group RET org-export-e-latex RET > > (Hint: Search for listing) Thanks for looking into this. This variable is set to "t". Sorry, that I did not give a more complete workflow of how I do *not* get listings with the new LaTeX exporter. This now follows. Here is the .emacs.org ,---- | (add-to-list 'load-path (expand-file-name "~/local/emacs/org-mode-install/lisp")) | (add-to-list 'auto-mode-alist '("\\.\\(org\\ |org_archive\\|txt\\)$" . org-mode)) | (require 'org-install) | (require 'org-habit) | | (add-to-list 'load-path (expand-file-name "~/local/emacs/org-mode/contrib/lisp")) | (require 'org-export) | | (global-set-key "\C-cl" 'org-store-link) | (global-set-key "\C-ca" 'org-agenda) | (global-set-key "\C-cb" 'org-iswitchb) `---- I do emacs -Q -l .emacs.org, set the 'org-export-latex-listings to t and run the org-export-dispatch "L" on this file: ,---- | #+TITLE: Test the listings | | | * Some listing | #+begin_src R | bh <- basehaz(coxmodel.cont.64) | #+end_src | | * Options :noexport: | #+LaTeX_CLASS_OPTIONS: [11pt] | #+LATEX_HEADER: \setlength{\parindent}{0pt} | #+LATEX_HEADER: \setlength{\parskip}{1ex} | #+LATEX_HEADER: \usepackage{listings} | #+LATEX_HEADER: \usepackage{color} | #+LATEX_HEADER: \definecolor{mylstback}{RGB}{200,200,200} % light gray | #+LATEX_HEADER: \lstloadlanguages{R} | #+LATEX_HEADER: \lstdefinelanguage{Renhanced}[]{R}{% | #+LATEX_HEADER: morekeywords={acf,ar,arima,arima.sim,colMeans,colSums,is.na,is.null,% | #+LATEX_HEADER: mapply,ms,na.rm,nlmin,replicate,row.names,rowMeans,rowSums,seasonal,% | #+LATEX_HEADER: sys.time,system.time,ts.plot,which.max,which.min}, | #+LATEX_HEADER: deletekeywords={c},% | #+LATEX_HEADER: alsoletter={._\%},% | #+LATEX_HEADER: alsoother={:\$}} | #+LATEX_HEADER: \lstset{% | #+LATEX_HEADER: extendedchars=true,% | #+LATEX_HEADER: basicstyle=\ttfamily\scriptsize, % the font that is used for the code | #+LATEX_HEADER: tabsize=4, % sets default tabsize to 4 spaces | #+LATEX_HEADER: numbers=left, % where to put the line numbers | #+LATEX_HEADER: numberstyle=\tiny, % line number font size | #+LATEX_HEADER: stepnumber=4, % step between two line numbers | #+LATEX_HEADER: breaklines=false, %!! don't break long lines of code | #+LATEX_HEADER: showtabs=false, % show tabs within strings adding particular underscores | #+LATEX_HEADER: showspaces=false, % show spaces adding particular underscores | #+LATEX_HEADER: showstringspaces=false, % underline spaces within strings | #+LATEX_HEADER: frame=tb,% | #+LATEX_HEADER: keywordstyle=\color{blue}, | #+LATEX_HEADER: identifierstyle=\color{black}, | #+LATEX_HEADER: stringstyle=\color{green}, | #+LATEX_HEADER: commentstyle={\color{red}\ttfamily\itshape}, | #+LATEX_HEADER: backgroundcolor=\color{mylstback}, % sets the background color | #+LATEX_HEADER: captionpos=t, % sets the caption position to `bottom' | #+LATEX_HEADER: extendedchars=false %!?? workaround for when the listed file is in UTF-8 | #+LATEX_HEADER: } `---- The result is this: ,---- | % Created 2012-05-24 Do 22:52 | \documentclass[11pt]{article} | \usepackage[utf8]{inputenc} | \usepackage[T1]{fontenc} | \usepackage{fixltx2e} | \usepackage{graphicx} | \usepackage{longtable} | \usepackage{float} | \usepackage{wrapfig} | \usepackage{soul} | \usepackage{textcomp} | \usepackage{marvosym} | \usepackage{wasysym} | \usepackage{latexsym} | \usepackage{amssymb} | \usepackage{hyperref} | \tolerance=1000 | \usepackage{color} | \usepackage{listings} | \setlength{\parindent}{0pt} | \setlength{\parskip}{1ex} | \usepackage{listings} | \usepackage{color} | \definecolor{mylstback}{RGB}{200,200,200} % light gray | \lstloadlanguages{R} | \lstdefinelanguage{Renhanced}[]{R}{% | morekeywords={acf,ar,arima,arima.sim,colMeans,colSums,is.na,is.null,% | mapply,ms,na.rm,nlmin,replicate,row.names,rowMeans,rowSums,seasonal,% | sys.time,system.time,ts.plot,which.max,which.min}, | deletekeywords={c},% | alsoletter={._\%},% | alsoother={:\$}} | \lstset{% | extendedchars=true,% | basicstyle=\ttfamily\scriptsize, % the font that is used for the code | tabsize=4, % sets default tabsize to 4 spaces | numbers=left, % where to put the line numbers | numberstyle=\tiny, % line number font size | stepnumber=4, % step between two line numbers | breaklines=false, %!! don't break long lines of code | showtabs=false, % show tabs within strings adding particular underscores | showspaces=false, % show spaces adding particular underscores | showstringspaces=false, % underline spaces within strings | frame=tb,% | keywordstyle=\color{blue}, | identifierstyle=\color{black}, | stringstyle=\color{green}, | commentstyle={\color{red}\ttfamily\itshape}, | backgroundcolor=\color{mylstback}, % sets the background color | captionpos=t, % sets the caption position to `bottom' | extendedchars=false %!?? workaround for when the listed file is in UTF-8 | } | \providecommand{\alert}[1]{\textbf{#1}} | \author{Andreas Leha} | \date{\today} | \title{Test the listings} | \hypersetup{ | pdfkeywords={}, | pdfsubject={}, | pdfcreator={Generated by Org mode 7.8.10 in Emacs 24.1.50.1.}} | \begin{document} | | \maketitle | \tableofcontents | \vspace*{1cm} | | | | \section{Some listing} | \label{sec-1} | \begin{verbatim} | bh <- basehaz(coxmodel.cont.64) | \end{verbatim} | % Generated by Org mode 7.8.10 in Emacs 24.1.50.1. | \end{document} `---- emacs-version: GNU Emacs 24.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2) of 2012-05-22 on zelenka, modified by Debian org-version: Org-mode version 7.8.10 (release_7.8.10-573-g7b33d9 @ /home/andreas/local/emacs/org-mode-install/lisp/) Any other idea, what I am doing wrong here? Cheers, Andreas